<?xml version="1.0" encoding="utf-8"?>
<FindBugsFilter>
- <!-- The names of public methods will not be modified -->
+ <Match>
+ <Class name="org.apache.fop.render.intermediate.IFStructureTreeBuilder"/>
+ <Field name="delegate"/>
+ <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.fop.render.pdf.PDFLogicalStructureHandler"/>
+ <Field name="currentPage"/>
+ <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.fop.render.pdf.PDFLogicalStructureHandler"/>
+ <Field name="pageParentTreeArray"/>
+ <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.fop.render.pdf.PDFStructureTreeBuilder"/>
+ <Field name="logicalStructureHandler"/>
+ <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.fop.render.pdf.PDFStructureTreeBuilder"/>
+ <Field name="pdfFactory"/>
+ <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.fop.accessibility.fo.FO2StructureTreeConverter$1"/>
+ <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
+ </Match>
+ <Match>
+ <Class name="~org.apache.fop.accessibility.fo.FOEventRecorder.*"/>
+ <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
+ </Match>
<Match>
<Class name="org.apache.fop.afp.AFPDataObjectInfo"/>
<Method name="getUri"/>
<Bug pattern="REC_CATCH_EXCEPTION"/>
</Match>
<!-- /Automatically generated list of exclusions on 18 February 2011 -->
-</FindBugsFilter>
\ No newline at end of file
+</FindBugsFilter>
private DummyStructureTreeEventHandler() { }
+ /** {@inheritDoc} */
public void startPageSequence(Locale locale) {
}
+ /** {@inheritDoc} */
public void endPageSequence() {
}
+ /** {@inheritDoc} */
public StructureTreeElement startNode(String name, Attributes attributes) {
return null;
}
+ /** {@inheritDoc} */
public void endNode(String name) {
}
+ /** {@inheritDoc} */
public StructureTreeElement startImageNode(String name, Attributes attributes) {
return null;
}
+ /** {@inheritDoc} */
public StructureTreeElement startReferencedNode(String name, Attributes attributes) {
return null;
}
/**
* Factory method that creates a new instance.
* @param contentHandler The handler that receives SAX events
+ * @return -
*/
public static StructureTreeEventHandler newInstance(ContentHandler contentHandler) {
return new StructureTree2SAXEventAdapter(contentHandler);
}
+ /** {@inheritDoc} */
public void startPageSequence(Locale locale) {
try {
}
}
+ /** {@inheritDoc} */
public void endPageSequence() {
try {
contentHandler.endElement(IFConstants.NAMESPACE, IFConstants.EL_STRUCTURE_TREE,
}
}
+ /** {@inheritDoc} */
public StructureTreeElement startNode(String name, Attributes attributes) {
try {
if (name.equals("#PCDATA")) {
}
}
+ /** {@inheritDoc} */
public void endNode(String name) {
try {
contentHandler.endElement(FOElementMapping.URI, name,
}
}
+ /** {@inheritDoc} */
public StructureTreeElement startImageNode(String name, Attributes attributes) {
return startNode(name, attributes);
}
+ /** {@inheritDoc} */
public StructureTreeElement startReferencedNode(String name, Attributes attributes) {
return startNode(name, attributes);
}
/* $Id$ */
-/**
- *
- */
package org.apache.fop.accessibility;
/**
if (node instanceof CommonAccessibilityHolder) {
addRole((CommonAccessibilityHolder) node, attributes);
}
- node.setStructureTreeElement(structureTreeEventHandler.startReferencedNode(localName, attributes));
+ node.setStructureTreeElement(
+ structureTreeEventHandler.startReferencedNode(localName, attributes));
}
private void startElementWithIDAndAltText(AbstractGraphics node) {
addRole(node, attributes);
addAttribute(attributes, ExtensionElementMapping.URI, "alt-text",
ExtensionElementMapping.STANDARD_PREFIX, node.getAltText());
- node.setStructureTreeElement(structureTreeEventHandler.startImageNode(localName, attributes));
+ node.setStructureTreeElement(
+ structureTreeEventHandler.startImageNode(localName, attributes));
}
private StructureTreeElement startElement(FONode node, AttributesImpl attributes) {
private boolean locatorEnabled = true; // true by default (for error messages).
private boolean conserveMemoryPolicy = false;
private EventBroadcaster eventBroadcaster = new FOPEventBroadcaster();
- private StructureTreeEventHandler structureTreeEventHandler = DummyStructureTreeEventHandler.INSTANCE;
+ private StructureTreeEventHandler structureTreeEventHandler
+ = DummyStructureTreeEventHandler.INSTANCE;
/** Producer: Metadata element for the system/software that produces
* the document. (Some renderers can store this in the document.)
private DOMImplementation domImplementation;
private Locator locator;
- private Attributes pageSequenceAttributes;
-
public Handler(AreaTreeModel treeModel, FOUserAgent userAgent,
ElementMappingRegistry elementMappingRegistry) {
this.treeModel = treeModel;
public void endDocument() throws SAXException {
}
+ /** {@inheritDoc} */
public void startRoot(Root root) {
}
+ /** {@inheritDoc} */
public void endRoot(Root root) {
}
}
+ /**
+ * Sets the structure tree element.
+ *
+ * @param structureTreeElement set.
+ */
public void setStructureTreeElement(StructureTreeElement structureTreeElement) {
throw new UnsupportedOperationException();
}
this.structureTreeElement = structureTreeElement;
}
+ /** @return the structure tree element. */
public StructureTreeElement getStructureTreeElement() {
return structureTreeElement;
}
}
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
return structureTreeElement;
}
+ /** @return the alternative text property. */
public String getAltText() {
return altText;
}
}
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
}
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
getFOEventHandler().endBlock(this);
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
}
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
*/
public class FootnoteBody extends FObj implements CommonAccessibilityHolder {
+ /** {@inheritDoc} */
private CommonAccessibility commonAccessibility;
/**
return FO_FOOTNOTE_BODY;
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
return FO_INITIAL_PROPERTY_SET;
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
}
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
}
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
}
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
}
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
return FO_TABLE_AND_CAPTION;
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
return FO_TABLE_CAPTION;
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
return true;
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
return columnNumberManager;
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
}
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
}
+ /** @return locale proprty. */
public Locale getLocale() {
return locale;
}
}
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
}
}
+ /** {@inheritDoc} */
public CommonAccessibility getCommonAccessibility() {
return commonAccessibility;
}
* @param area the area to set the traits on
* @param structureTreeElement the element the area is associated to in the document structure
*/
- public static void addStructureTreeElement(Area area, StructureTreeElement structureTreeElement) {
+ public static void addStructureTreeElement(Area area,
+ StructureTreeElement structureTreeElement) {
if (structureTreeElement != null) {
area.addTrait(Trait.STRUCTURE_TREE_ELEMENT, structureTreeElement);
}
}
/**
- * Sets the language identifier of the document.
- * @param lang the language identifier of the document.
+ * Sets the locale of the document.
+ * @param locale the locale of the document.
*/
public void setLanguage(Locale locale) {
if (locale == null) {
return kidsAttached;
}
+ /**
+ * Class representing a placeholder for a PDF Structure Element.
+ */
public static class Placeholder extends PDFStructElem {
@Override
}
}
+ /**
+ * Constructor
+ * @param parent -
+ * @param name -
+ */
public Placeholder(PDFObject parent, String name) {
super(parent, new PDFName(name));
}
String EL_HEADER = "header";
/** element name trailer */
String EL_TRAILER = "trailer";
+ /** element name locale */
String EL_LOCALE = "locale";
/** element name page-sequence */
String EL_PAGE_SEQUENCE = "page-sequence";
private Attributes pageSequenceAttributes;
- private Map<String, StructureTreeElement> structureTreeElements =
- new HashMap<String, StructureTreeElement>();
+ private Map<String, StructureTreeElement> structureTreeElements
+ = new HashMap<String, StructureTreeElement>();
private final class StructureTreeHandler extends DefaultHandler {
structureTreeEventHandler.startNode(localName, attributes);
} else if (localName.equals("external-graphic")
|| localName.equals("instream-foreign-object")) {
- StructureTreeElement structureTreeElement =
- structureTreeEventHandler.startImageNode(localName, attributes);
+ StructureTreeElement structureTreeElement
+ = structureTreeEventHandler.startImageNode(localName, attributes);
structureTreeElements.put(structID, structureTreeElement);
} else {
- StructureTreeElement structureTreeElement =
- structureTreeEventHandler.startReferencedNode(localName, attributes);
+ StructureTreeElement structureTreeElement = structureTreeEventHandler
+ .startReferencedNode(localName, attributes);
structureTreeElements.put(structID, structureTreeElement);
}
}
} else if (DocumentNavigationExtensionConstants.NAMESPACE.equals(uri)) {
if (this.navParser == null) {
this.navParser = new DocumentNavigationHandler(
- this.documentHandler.getDocumentNavigationHandler(), structureTreeElements);
+ this.documentHandler.getDocumentNavigationHandler(),
+ structureTreeElements);
}
delegate = this.navParser;
delegateDepth++;
/** {@inheritDoc} */
public void renderInlineViewport(InlineViewport viewport) {
- StructureTreeElement structElem =
- (StructureTreeElement) viewport.getTrait(Trait.STRUCTURE_TREE_ELEMENT);
+ StructureTreeElement structElem
+ = (StructureTreeElement) viewport.getTrait(Trait.STRUCTURE_TREE_ELEMENT);
establishStructureTreeElement(structElem);
pushdID(viewport);
Dimension dim = new Dimension(viewport.getIPD(), viewport.getBPD());
// warn if link trait found but not allowed, else create link
if (linkTraitFound) {
- StructureTreeElement structElem =
- (StructureTreeElement) ip.getTrait(Trait.STRUCTURE_TREE_ELEMENT);
+ StructureTreeElement structElem
+ = (StructureTreeElement) ip.getTrait(Trait.STRUCTURE_TREE_ELEMENT);
action.setStructureTreeElement(structElem);
Link link = new Link(action, ipRect);
this.deferredLinks.add(link);
String fontName = getInternalFontNameForArea(text);
int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
- StructureTreeElement structElem = (StructureTreeElement) text.getTrait(Trait.STRUCTURE_TREE_ELEMENT);
+ StructureTreeElement structElem
+ = (StructureTreeElement) text.getTrait(Trait.STRUCTURE_TREE_ELEMENT);
establishStructureTreeElement(structElem);
// This assumes that *all* CIDFonts use a /ToUnicode mapping
handler.startPrefixMapping(XLINK_PREFIX, XLINK_NAMESPACE);
handler.startPrefixMapping(DocumentNavigationExtensionConstants.PREFIX,
DocumentNavigationExtensionConstants.NAMESPACE);
- handler.startPrefixMapping(InternalElementMapping.STANDARD_PREFIX, InternalElementMapping.URI);
+ handler.startPrefixMapping(InternalElementMapping.STANDARD_PREFIX,
+ InternalElementMapping.URI);
handler.startElement(EL_DOCUMENT);
} catch (SAXException e) {
throw new IFException("SAX error in startDocument()", e);
}
private void addStructureReference(AttributesImpl atts) {
- IFStructureTreeElement structureTreeElement =
- (IFStructureTreeElement) getContext().getStructureTreeElement();
+ IFStructureTreeElement structureTreeElement
+ = (IFStructureTreeElement) getContext().getStructureTreeElement();
if (structureTreeElement != null) {
- addStructRefAttribute(atts, structureTreeElement.id);
+ addStructRefAttribute(atts, structureTreeElement.getId());
}
}
XMLConstants.CDATA, IFUtil.toString(link.getTargetRect()));
if (getUserAgent().isAccessibilityEnabled()) {
addStructRefAttribute(atts,
- ((IFStructureTreeElement) link.getAction().getStructureTreeElement()).id);
+ ((IFStructureTreeElement) link.getAction().getStructureTreeElement()).getId());
}
try {
handler.startElement(DocumentNavigationExtensionConstants.LINK, atts);
static final class IFStructureTreeElement implements StructureTreeElement {
- final String id;
+ private final String id;
IFStructureTreeElement() {
this.id = null;
IFStructureTreeElement(String id) {
this.id = id;
}
+
+ public String getId() {
+ return id;
+ }
}
/** A SAX handler that records events to replay them later. */
private static final class StartPrefixMapping extends SAXEventRecorder.Event {
- protected final String prefix;
- protected final String uri;
+ private final String prefix;
+ private final String uri;
private StartPrefixMapping(String prefix, String uri) {
this.prefix = prefix;
private static final class EndPrefixMapping extends SAXEventRecorder.Event {
- protected final String prefix;
+ private final String prefix;
private EndPrefixMapping(String prefix) {
this.prefix = prefix;
private StructureTreeEventHandler delegate;
- private final List<SAXEventRecorder> pageSequenceEventRecorders = new ArrayList<SAXEventRecorder>();
+ private final List<SAXEventRecorder> pageSequenceEventRecorders
+ = new ArrayList<SAXEventRecorder>();
private int idCounter;
throw new SAXException(localName + " must be the root element!");
}
Rectangle targetRect = XMLUtil.getAttributeAsRectangle(attributes, "rect");
- structureTreeElement = structureTreeElements.get(
- attributes.getValue(InternalElementMapping.URI, InternalElementMapping.STRUCT_REF));
+ structureTreeElement = structureTreeElements.get(attributes.getValue(
+ InternalElementMapping.URI, InternalElementMapping.STRUCT_REF));
Link link = new Link(null, targetRect);
objectStack.push(link);
} else if (GOTO_XY.getLocalName().equals(localName)) {
/**
* Standard structure types defined by the PDF Reference, Fourth Edition (PDF 1.5).
*/
- private static final Map<String, PDFName> STANDARD_STRUCTURE_TYPES = new HashMap<String, PDFName>();
+ private static final Map<String, PDFName> STANDARD_STRUCTURE_TYPES
+ = new HashMap<String, PDFName>();
- private static final Map<String, Mapper> DEFAULT_MAPPINGS = new java.util.HashMap<String, Mapper>();
+ private static final Map<String, Mapper> DEFAULT_MAPPINGS
+ = new java.util.HashMap<String, Mapper>();
private static final PDFName THEAD;
private static final PDFName NON_STRUCT;
RtfTextrun textrun = container.getTextrun();
textrun.addLeader(rtfAttr);
-
- } catch (Exception e) {
+ } catch (IOException e) {
+ log.error("startLeader: " + e.getMessage());
+ throw new RuntimeException(e.getMessage());
+ } catch (FOPException e) {
log.error("startLeader: " + e.getMessage());
throw new RuntimeException(e.getMessage());
}
/** If not null, the XMLRenderer will mimic another renderer by using its font setup. */
protected Renderer mimic;
- private int pageSequenceIndex;
-
/**
* Creates a new XML renderer.
*/
*
* @param locale a locale
* @return the corresponding language tag
- * @throws NullPointerException if the specified locale is null
*/
public static String toLanguageTag(Locale locale) {
StringBuffer sb = new StringBuffer(5);
/**
* Converts an RFC 3066 compliant language tag to a locale.
*
- * @throws NullPointerException if the specified language tag is null
+ * @param languageTag language tag to convert
+ * @return the corresponding locale
*/
public static Locale toLocale(String languageTag) {
String[] parts = languageTag.split("-");