org.apache.fop.fo

Class XMLObj

Implemented Interfaces:
Cloneable, ContentHandlerFactory.ObjectBuiltListener, EventListener
Known Direct Subclasses:
SVGObj, UnknownXMLObj

public abstract class XMLObj
extends FONode
implements ContentHandlerFactory.ObjectBuiltListener

Abstract class modelling generic, non-XSL-FO XML objects. Such objects are stored in a DOM.

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.fop.fo.FONode

FONode.FONodeIterator

Field Summary

protected Document
doc
DOM document containing this node
protected Element
element
DOM element representing this node
protected String
name
Name of the node

Fields inherited from class org.apache.fop.fo.FONode

FOX_URI, FO_URI, locator, log, parent, siblings

Constructor Summary

XMLObj(FONode parent)

Method Summary

protected void
addCharacters(char[] data, int start, int length, PropertyList pList, Locator locator)
Add parsed characters to this object
protected void
addChildNode(FONode child)
void
addElement(Document doc, Element parent)
Add an element to the DOM document
void
buildTopLevel(Document doc, Element svgRoot)
Add the top-level element to the DOM document
Document
createBasicDocument()
Create an empty DOM document
Document
getDOMDocument()
Point2D
getDimension(Point2D view)
Returns the dimensions of the generated area in pts.
Length
getIntrinsicAlignmentAdjust()
Retrieve the intrinsic alignment-adjust of the child element.
String
getLocalName()
void
notifyObjectBuilt(Object obj)
void
processNode(String elementName, Locator locator, Attributes attlist, PropertyList propertyList)
protected void
validateChildNode(Locator loc, String nsURI, String localName)

Methods inherited from class org.apache.fop.fo.FONode

addCharacters, addChildNode, attachSiblings, attributeError, attributeWarning, bind, canHaveMarkers, charIterator, clone, clone, createPropertyList, decorateWithContextInfo, endOfNode, errorText, gatherContextInfo, getChildNodes, getChildNodes, getContentHandlerFactory, getContextInfo, getExtensionAttachment, getFOEventHandler, getLocalName, getLocator, getLocatorString, getLogger, getName, getName, getNameId, getNamespaceURI, getNodeString, getNormalNamespacePrefix, getParent, getRoot, getUserAgent, inMarker, invalidChildError, invalidChildError, missingChildElementError, missingPropertyError, nodesOutOfOrderError, processNode, removeChild, setLocator, startOfNode, tooManyNodesError, tooManyNodesError, validateChildNode, warningText

Field Details

doc

protected Document doc
DOM document containing this node

element

protected Element element
DOM element representing this node

name

protected String name
Name of the node

Constructor Details

XMLObj

public XMLObj(FONode parent)
Parameters:
parent - the parent formatting object

Method Details

addCharacters

protected void addCharacters(char[] data,
                             int start,
                             int length,
                             PropertyList pList,
                             Locator locator)
Add parsed characters to this object
Overrides:
addCharacters in interface FONode
Parameters:
data - array of characters contaning the text to add
start - starting array element to add
length - number of characters from the array to add
pList - the currently applicable property list
locator - location in fo source file.

addChildNode

protected void addChildNode(FONode child)
Overrides:
addChildNode in interface FONode

addElement

public void addElement(Document doc,
                       Element parent)
Add an element to the DOM document
Parameters:
doc - DOM document to which to add an element
parent - the parent element of the element that is being added

buildTopLevel

public void buildTopLevel(Document doc,
                          Element svgRoot)
Add the top-level element to the DOM document
Parameters:
doc - DOM document
svgRoot - non-XSL-FO element to be added as the root of this document

createBasicDocument

public Document createBasicDocument()
Create an empty DOM document
Returns:
DOM document

getDOMDocument

public Document getDOMDocument()
Returns:
DOM document representing this foreign XML

getDimension

public Point2D getDimension(Point2D view)
Returns the dimensions of the generated area in pts.
Parameters:
view - Point2D instance to receive the dimensions
Returns:
the requested dimensions in pts.

getIntrinsicAlignmentAdjust

public Length getIntrinsicAlignmentAdjust()
Retrieve the intrinsic alignment-adjust of the child element.
Returns:
the intrinsic alignment-adjust.

getLocalName

public String getLocalName()
Overrides:
getLocalName in interface FONode

notifyObjectBuilt

public void notifyObjectBuilt(Object obj)
Specified by:
notifyObjectBuilt in interface ContentHandlerFactory.ObjectBuiltListener

processNode

public void processNode(String elementName,
                        Locator locator,
                        Attributes attlist,
                        PropertyList propertyList)
            throws FOPException
Overrides:
processNode in interface FONode

validateChildNode

protected void validateChildNode(Locator loc,
                                 String nsURI,
                                 String localName)
            throws ValidationException
Overrides:
validateChildNode in interface FONode

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.