fop 0.91beta

org.apache.fop.fo
Class XMLObj

java.lang.Object
  |
  +--org.apache.fop.fo.FONode
        |
        +--org.apache.fop.fo.XMLObj
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
SVGObj, UnknownXMLObj

public abstract class XMLObj
extends FONode

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


Field Summary
protected  org.w3c.dom.Document doc
          DOM document containing this node
protected  org.w3c.dom.Element element
          DOM element representing this node
protected  java.lang.String name
          Name of the node
 
Fields inherited from class org.apache.fop.fo.FONode
FO_URI, locator, log, parent
 
Constructor Summary
XMLObj(FONode parent)
           
 
Method Summary
protected  void addCharacters(char[] data, int start, int length, PropertyList pList, org.xml.sax.Locator locator)
          Add parsed characters to this object
protected  void addChildNode(FONode child)
          Adds a node as a child of this node.
 void addElement(org.w3c.dom.Document doc, org.w3c.dom.Element parent)
          Add an element to the DOM document
 void buildTopLevel(org.w3c.dom.Document doc, org.w3c.dom.Element svgRoot)
          Add the top-level element to the DOM document
 org.w3c.dom.Document createBasicDocument()
          Create an empty DOM document
 java.awt.geom.Point2D getDimension(java.awt.geom.Point2D view)
          Returns the dimensions of the generated area in pts.
 org.w3c.dom.Document getDOMDocument()
           
 java.lang.String getLocalName()
          Returns the local name (i.e. without namespace prefix) of the node
 void processNode(java.lang.String elementName, org.xml.sax.Locator locator, org.xml.sax.Attributes attlist, PropertyList propertyList)
          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.
protected  void validateChildNode(org.xml.sax.Locator loc, java.lang.String nsURI, 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
 
Methods inherited from class org.apache.fop.fo.FONode
attributeError, attributeWarning, charIterator, clone, clone, createPropertyList, decorateWithContextInfo, endOfNode, errorText, gatherContextInfo, getChildNodes, getChildNodes, getContextInfo, getExtensionAttachment, getFOEventHandler, getLocator, getLocatorString, getLogger, getName, getName, getNameId, getNamespaceURI, getNodeString, getNormalNamespacePrefix, getParent, getRoot, getUserAgent, invalidChildError, invalidChildError, missingChildElementError, missingPropertyError, nodesOutOfOrderError, removeChild, setLocator, startOfNode, tooManyNodesError, tooManyNodesError, warningText
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

element

protected org.w3c.dom.Element element
DOM element representing this node

doc

protected org.w3c.dom.Document doc
DOM document containing this node

name

protected java.lang.String name
Name of the node
Constructor Detail

XMLObj

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

validateChildNode

protected void validateChildNode(org.xml.sax.Locator loc,
                                 java.lang.String nsURI,
                                 java.lang.String localName)
                          throws ValidationException
Description copied from class: FONode
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
Overrides:
validateChildNode in class FONode
See Also:
here, blocks XSL FO's from having non-FO parents.

processNode

public void processNode(java.lang.String elementName,
                        org.xml.sax.Locator locator,
                        org.xml.sax.Attributes attlist,
                        PropertyList propertyList)
                 throws FOPException
Description copied from class: FONode
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.
Overrides:
processNode in class FONode
See Also:
FONode.processNode(java.lang.String, org.xml.sax.Locator, org.xml.sax.Attributes, org.apache.fop.fo.PropertyList)

getDOMDocument

public org.w3c.dom.Document getDOMDocument()
Returns:
DOM document representing this foreign XML

getDimension

public java.awt.geom.Point2D getDimension(java.awt.geom.Point2D view)
Returns the dimensions of the generated area in pts.
Returns:
the requested dimensions in pts.

getLocalName

public java.lang.String getLocalName()
Description copied from class: FONode
Returns the local name (i.e. without namespace prefix) of the node
Overrides:
getLocalName in class FONode
See Also:
FONode.getLocalName()

addElement

public void addElement(org.w3c.dom.Document doc,
                       org.w3c.dom.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(org.w3c.dom.Document doc,
                          org.w3c.dom.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 org.w3c.dom.Document createBasicDocument()
Create an empty DOM document
Returns:
DOM document

addChildNode

protected void addChildNode(FONode child)
Description copied from class: FONode
Adds a node as a child of this node. The default implementation of this method just ignores any child node being added.
Overrides:
addChildNode in class FONode
See Also:
FONode.addChildNode(FONode)

addCharacters

protected void addCharacters(char[] data,
                             int start,
                             int length,
                             PropertyList pList,
                             org.xml.sax.Locator locator)
Add parsed characters to this object
Overrides:
addCharacters in class 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.

fop 0.91beta

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