|
fop 0.93 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.fo.FONode
Base class for nodes in the XML tree
Field Summary | |
protected static java.lang.String |
FO_URI
the XSL-FO namespace URI |
protected org.xml.sax.Locator |
locator
Marks location of this object from the input FO Call locator.getSystemId(), getLineNumber(), getColumnNumber() for file, line, column information |
protected static org.apache.commons.logging.Log |
log
Logger for fo-tree related messages |
protected FONode |
parent
Parent FO node |
Constructor Summary | |
protected |
FONode(FONode parent)
Main constructor. |
Method Summary | |
protected void |
addCharacters(char[] data,
int start,
int end,
PropertyList pList,
org.xml.sax.Locator locator)
Adds characters (does nothing here) |
protected void |
addChildNode(FONode child)
Adds a node as a child of this node. |
protected void |
attributeError(java.lang.String problem)
Helper function to standardize property error exceptions (e.g., not specifying either an internal- or an external-destination property for an FO:link) |
protected void |
attributeWarning(java.lang.String problem)
Helper function to standardize attribute warnings (e.g., currently unsupported properties) |
protected boolean |
canHaveMarkers()
|
CharIterator |
charIterator()
|
protected java.lang.Object |
clone()
Perform a shallow cloning operation |
FONode |
clone(FONode cloneparent,
boolean removeChildren)
Perform a shallow cloning operation, set its parent, and optionally clean the list of child nodes |
protected PropertyList |
createPropertyList(PropertyList pList,
FOEventHandler foEventHandler)
Create a property list for this node. |
static java.lang.String |
decorateWithContextInfo(java.lang.String text,
FONode node)
Decorates a log or warning message with context information on the given node. |
protected void |
endOfNode()
Primarily used for making final content model validation checks and/or informing the FOEventHandler that the end of this FO has been reached. |
protected static java.lang.String |
errorText(org.xml.sax.Locator loc)
Helper function to return "Error(line#/column#)" string for above exception messages |
protected java.lang.String |
gatherContextInfo()
Gathers context information for the getContextInfo() method. |
java.util.ListIterator |
getChildNodes()
Return an iterator over all the child nodes of this FObj. |
java.util.ListIterator |
getChildNodes(FONode childNode)
Return an iterator over the object's child nodes starting at the passed node. |
ContentHandlerFactory |
getContentHandlerFactory()
This method is overridden by extension elements and allows the extension element to return a ContentHandlerFactory. |
java.lang.String |
getContextInfo()
Returns a String containing as much context information as possible about a node. |
ExtensionAttachment |
getExtensionAttachment()
This method is overridden by extension elements and allows the extension element to return a pass-through attachment which the parent formatting objects should simply carry with them but otherwise ignore. |
FOEventHandler |
getFOEventHandler()
Recursively goes up the FOTree hierarchy until the fo:root is found, which returns the parent FOEventHandler. |
abstract java.lang.String |
getLocalName()
Returns the local name (i.e. |
org.xml.sax.Locator |
getLocator()
|
static java.lang.String |
getLocatorString(org.xml.sax.Locator loc)
Helper function to format a Locator instance. |
org.apache.commons.logging.Log |
getLogger()
Returns the logger for the node. |
java.lang.String |
getName()
Returns the fully qualified name of the node |
java.lang.String |
getName(java.lang.String prefix)
Returns the fully qualified name of the node |
int |
getNameId()
Returns the Constants class integer value of this node |
java.lang.String |
getNamespaceURI()
|
static java.lang.String |
getNodeString(java.lang.String namespaceURI,
java.lang.String localName)
Helper function to standardize the names of all namespace URI - local name pairs in text messages. |
abstract java.lang.String |
getNormalNamespacePrefix()
|
FONode |
getParent()
|
Root |
getRoot()
Returns the root node of this tree |
FOUserAgent |
getUserAgent()
Returns the user agent for the node. |
protected boolean |
inMarker()
|
protected void |
invalidChildError(org.xml.sax.Locator loc,
java.lang.String nsURI,
java.lang.String lName)
Helper function to return "invalid child" exceptions (e.g., fo:block appearing immediately under fo:root) |
protected void |
invalidChildError(org.xml.sax.Locator loc,
java.lang.String nsURI,
java.lang.String lName,
java.lang.String ruleViolated)
Helper function to return "invalid child" exceptions with more complex validation rules (i.e., needing more explanation of the problem) |
protected void |
missingChildElementError(java.lang.String contentModel)
Helper function to throw an error caused by missing mandatory child elements. |
protected void |
missingPropertyError(java.lang.String propertyName)
Helper function to throw an error caused by missing mandatory properties |
protected void |
nodesOutOfOrderError(org.xml.sax.Locator loc,
java.lang.String tooLateNode,
java.lang.String tooEarlyNode)
Helper function to standardize "out of order" exceptions (e.g., fo:layout-master-set appearing after fo:page-sequence) |
void |
processNode(java.lang.String elementName,
org.xml.sax.Locator locator,
org.xml.sax.Attributes attlist,
PropertyList pList)
Initialize the node with its name, location information, and attributes The attributes must be used immediately as the sax attributes will be altered for the next element. |
void |
removeChild(FONode child)
Removes a child node. |
void |
setLocator(org.xml.sax.Locator locator)
Set the location information for this element |
protected void |
startOfNode()
Called after processNode() is called. |
protected void |
tooManyNodesError(org.xml.sax.Locator loc,
java.lang.String offendingNode)
Helper function to standardize "too many" error exceptions (e.g., two fo:declarations within fo:root) This overrloaded method helps make the caller code better self-documenting |
protected void |
tooManyNodesError(org.xml.sax.Locator loc,
java.lang.String nsURI,
java.lang.String lName)
Helper function to standardize "too many" error exceptions (e.g., two fo:declarations within fo:root) |
protected void |
validateChildNode(org.xml.sax.Locator loc,
java.lang.String namespaceURI,
java.lang.String localName)
Checks to make sure, during SAX processing of input document, that the incoming node is valid for the this (parent) node (e.g., checking to see that fo:table is not an immediate child of fo:root) called within FObj constructor |
protected static java.lang.String |
warningText(org.xml.sax.Locator loc)
Helper function to return "Warning(line#/column#)" string for warning messages |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String FO_URI
protected FONode parent
protected org.xml.sax.Locator locator
protected static org.apache.commons.logging.Log log
Constructor Detail |
protected FONode(FONode parent)
parent
- parent of this nodeMethod Detail |
public FONode clone(FONode cloneparent, boolean removeChildren) throws FOPException
cloneparent
- the intended parent of the cloneremoveChildren
- if true, clean the list of child nodes
FOPException
- if there's a problem while cloning the nodeprotected java.lang.Object clone()
Object.clone()
public void setLocator(org.xml.sax.Locator locator)
locator
- the org.xml.sax.Locator objectpublic org.xml.sax.Locator getLocator()
public FOEventHandler getFOEventHandler()
protected boolean inMarker()
public FOUserAgent getUserAgent()
public org.apache.commons.logging.Log getLogger()
public void processNode(java.lang.String elementName, org.xml.sax.Locator locator, org.xml.sax.Attributes attlist, PropertyList pList) throws FOPException
elementName
- element name (e.g., "fo:block")locator
- Locator object (ignored by default)attlist
- Collection of attributes passed to us from the parser.pList
- the property list of the parent node
FOPException
- for errors or inconsistencies in the attributesprotected PropertyList createPropertyList(PropertyList pList, FOEventHandler foEventHandler) throws FOPException
pList
- the closest parent propertylist.foEventHandler
- The FOEventHandler where the PropertyListMaker
instance can be found.
FOPException
- if there's a problem during processingprotected void validateChildNode(org.xml.sax.Locator loc, java.lang.String namespaceURI, java.lang.String localName) throws ValidationException
loc
- location in the FO source filenamespaceURI
- namespace of incoming nodelocalName
- (e.g. "table" for "fo:table")
ValidationException
- if incoming node not valid for parentprotected void addCharacters(char[] data, int start, int end, PropertyList pList, org.xml.sax.Locator locator) throws FOPException
data
- array of characters containing text to be addedstart
- starting array element to addend
- ending array element to addpList
- currently applicable PropertyListlocator
- location in fo source file.
FOPException
- if there's a problem during processingprotected void startOfNode() throws FOPException
FOPException
- if there's a problem during processingprotected void endOfNode() throws FOPException
FOPException
- if there's a problem during processingprotected void addChildNode(FONode child) throws FOPException
child
- child node to be added to the childNodes of this node
FOPException
- if there's a problem during processingpublic void removeChild(FONode child)
child
- child node to be removedpublic FONode getParent()
public java.util.ListIterator getChildNodes()
public java.util.ListIterator getChildNodes(FONode childNode)
childNode
- First node in the iterator
public CharIterator charIterator()
public static java.lang.String getNodeString(java.lang.String namespaceURI, java.lang.String localName)
namespaceURI
- URI of node found
(e.g., "http://www.w3.org/1999/XSL/Format")localName
- local name of node, (e.g., "root" for "fo:root")
protected void attributeError(java.lang.String problem) throws ValidationException
problem
- text to display that indicates the problem
ValidationException
- the validation error provoked by the method callprotected void attributeWarning(java.lang.String problem)
problem
- text to display that indicates the problemprotected void tooManyNodesError(org.xml.sax.Locator loc, java.lang.String nsURI, java.lang.String lName) throws ValidationException
loc
- org.xml.sax.Locator object of the error (*not* parent node)nsURI
- namespace URI of incoming invalid nodelName
- local name (i.e., no prefix) of incoming node
ValidationException
- the validation error provoked by the method callprotected void tooManyNodesError(org.xml.sax.Locator loc, java.lang.String offendingNode) throws ValidationException
loc
- org.xml.sax.Locator object of the error (*not* parent node)offendingNode
- incoming node that would cause a duplication.
ValidationException
- the validation error provoked by the method callprotected void nodesOutOfOrderError(org.xml.sax.Locator loc, java.lang.String tooLateNode, java.lang.String tooEarlyNode) throws ValidationException
loc
- org.xml.sax.Locator object of the error (*not* parent node)tooLateNode
- string name of node that should be earlier in documenttooEarlyNode
- string name of node that should be later in document
ValidationException
- the validation error provoked by the method callprotected void invalidChildError(org.xml.sax.Locator loc, java.lang.String nsURI, java.lang.String lName) throws ValidationException
loc
- org.xml.sax.Locator object of the error (*not* parent node)nsURI
- namespace URI of incoming invalid nodelName
- local name (i.e., no prefix) of incoming node
ValidationException
- the validation error provoked by the method callprotected void invalidChildError(org.xml.sax.Locator loc, java.lang.String nsURI, java.lang.String lName, java.lang.String ruleViolated) throws ValidationException
loc
- org.xml.sax.Locator object of the error (*not* parent node)nsURI
- namespace URI of incoming invalid nodelName
- local name (i.e., no prefix) of incoming noderuleViolated
- text explanation of problem
ValidationException
- the validation error provoked by the method callprotected void missingChildElementError(java.lang.String contentModel) throws ValidationException
contentModel
- The XSL Content Model for the fo: object or a similar description
indicating the necessary child elements.
ValidationException
- the validation error provoked by the method callprotected void missingPropertyError(java.lang.String propertyName) throws ValidationException
propertyName
- the name of the missing property.
ValidationException
- the validation error provoked by the method callprotected static java.lang.String errorText(org.xml.sax.Locator loc)
loc
- org.xml.sax.Locator object
protected static java.lang.String warningText(org.xml.sax.Locator loc)
loc
- org.xml.sax.Locator object
public static java.lang.String getLocatorString(org.xml.sax.Locator loc)
loc
- org.xml.sax.Locator object
public static java.lang.String decorateWithContextInfo(java.lang.String text, FONode node)
text
- the original messagenode
- the context node
public java.lang.String getContextInfo()
protected java.lang.String gatherContextInfo()
public Root getRoot()
public java.lang.String getName()
public java.lang.String getName(java.lang.String prefix)
prefix
- the namespace prefix to build the name with (may be null)
public abstract java.lang.String getLocalName()
public abstract java.lang.String getNormalNamespacePrefix()
public java.lang.String getNamespaceURI()
public int getNameId()
public ExtensionAttachment getExtensionAttachment()
public ContentHandlerFactory getContentHandlerFactory()
protected boolean canHaveMarkers()
|
fop 0.93 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |