com.smallx.xml.infoset.memory
Class MemoryDocument

java.lang.Object
  extended bycom.smallx.xml.infoset.memory.MemoryItem
      extended bycom.smallx.xml.infoset.memory.MemoryParent
          extended bycom.smallx.xml.infoset.memory.MemoryDocument
All Implemented Interfaces:
Child, Document, Item, Location, Parent

public class MemoryDocument
extends MemoryParent
implements Document


Field Summary
protected  Element docElement
           
protected  java.util.Map elementMap
           
protected  int standalone
           
protected  java.lang.String version
           
 
Fields inherited from class com.smallx.xml.infoset.memory.MemoryParent
baseURI, children
 
Fields inherited from class com.smallx.xml.infoset.memory.MemoryItem
infoset, origin, ranking
 
Fields inherited from interface com.smallx.xml.infoset.Document
TYPE
 
Fields inherited from interface com.smallx.xml.infoset.Item
ANCESTOR_AXIS, ANCESTOR_OR_SELF_AXIS, ATTRIBUTE, ATTRIBUTE_AXIS, CHARACTERS, CHILD_AXIS, COMMENT, DESCENDANT_AXIS, DESCENDANT_OR_SELF_AXIS, DOCUMENT, DOCUMENT_END, ELEMENT, ELEMENT_END, FOLLOWING_AXIS, FOLLOWING_SIBLING_AXIS, N_TYPES, NAMESPACE, NAMESPACE_AXIS, PARENT_AXIS, PRECEDING_AXIS, PRECEDING_SIBLING_AXIS, PROCESSING_INSTRUCTION, SELF_AXIS
 
Constructor Summary
MemoryDocument(java.net.URI base, Infoset context)
           
 
Method Summary
 void appendChild(Child n)
          Appends a child to the parents children list.
 Element createDocumentElement(Name name)
          Create the document element with the specified name.
 Element createDocumentElement(java.lang.String localName)
          Create the document element with the specified name.
 java.net.URI getBaseURI()
          Returns the base URI of the document.
 int getColumn()
           
 Element getDocumentElement()
          Returns the document element.
 Element getElementWithId(java.lang.String id)
          Returns an element with a specified id.
 Child getFollowingSibling()
          Returns the following sibling of this node.
 java.util.Iterator getFollowingSiblings()
           
 int getLine()
           
 NamespaceScope getNamespaceScope()
           
 Child getPrecedingSibling()
          Returns the preceeding sibling to this node.
 java.util.Iterator getPrecedingSiblings()
           
 byte getType()
          Returns the type of type node.
 void setBaseURI(java.net.URI base)
           
 void setColumn(int column)
           
protected  void setIndex(int index)
           
 void setLine(int line)
           
 
Methods inherited from class com.smallx.xml.infoset.memory.MemoryParent
getAxis, getChildAt, getChildren, getChildrenByType, getNumberOfChildren, getParent, hasChildren, insertChildBefore, removeChild, removeChildAt, swapChild
 
Methods inherited from class com.smallx.xml.infoset.memory.MemoryItem
compareTo, getDocument, getGeneratedId, getInfoset, getOrigin, setRank
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.smallx.xml.infoset.Parent
getChildAt, getChildren, getChildrenByType, getDocument, getNumberOfChildren, hasChildren, insertChildBefore, removeChild, removeChildAt, swapChild
 
Methods inherited from interface com.smallx.xml.infoset.Child
compareTo, getParent
 
Methods inherited from interface com.smallx.xml.infoset.Item
getAxis, getGeneratedId, getInfoset, getOrigin
 

Field Detail

standalone

protected int standalone

version

protected java.lang.String version

docElement

protected Element docElement

elementMap

protected java.util.Map elementMap
Constructor Detail

MemoryDocument

public MemoryDocument(java.net.URI base,
                      Infoset context)
Method Detail

getBaseURI

public java.net.URI getBaseURI()
Description copied from interface: Parent
Returns the base URI of the document.

Specified by:
getBaseURI in interface Parent
Overrides:
getBaseURI in class MemoryParent

setBaseURI

public void setBaseURI(java.net.URI base)
Specified by:
setBaseURI in interface Parent
Overrides:
setBaseURI in class MemoryParent

setIndex

protected void setIndex(int index)
Specified by:
setIndex in class MemoryItem

getType

public byte getType()
Description copied from interface: Item
Returns the type of type node.

Specified by:
getType in interface Item

getDocumentElement

public Element getDocumentElement()
Description copied from interface: Document
Returns the document element.

Specified by:
getDocumentElement in interface Document

getNamespaceScope

public NamespaceScope getNamespaceScope()

createDocumentElement

public Element createDocumentElement(Name name)
Description copied from interface: Document
Create the document element with the specified name.

Specified by:
createDocumentElement in interface Document
Parameters:
name - The name to use for the document element.
Returns:
An instance of Element which represents the document element created.

createDocumentElement

public Element createDocumentElement(java.lang.String localName)
Description copied from interface: Document
Create the document element with the specified name.

Specified by:
createDocumentElement in interface Document
Parameters:
localName - The name to use for the document element.
Returns:
An instance of Element which represents the document element created.

appendChild

public void appendChild(Child n)
Description copied from interface: Parent
Appends a child to the parents children list.

Specified by:
appendChild in interface Parent
Overrides:
appendChild in class MemoryParent

getElementWithId

public Element getElementWithId(java.lang.String id)
Description copied from interface: Document
Returns an element with a specified id.

Specified by:
getElementWithId in interface Document

getFollowingSibling

public Child getFollowingSibling()
Description copied from interface: Child
Returns the following sibling of this node.

Specified by:
getFollowingSibling in interface Child
Returns:
An instance of Item or null.

getPrecedingSibling

public Child getPrecedingSibling()
Description copied from interface: Child
Returns the preceeding sibling to this node.

Specified by:
getPrecedingSibling in interface Child

getFollowingSiblings

public java.util.Iterator getFollowingSiblings()
Specified by:
getFollowingSiblings in interface Child

getPrecedingSiblings

public java.util.Iterator getPrecedingSiblings()
Specified by:
getPrecedingSiblings in interface Child

getColumn

public int getColumn()
Specified by:
getColumn in interface Location

getLine

public int getLine()
Specified by:
getLine in interface Location

setColumn

public void setColumn(int column)
Specified by:
setColumn in interface Location

setLine

public void setLine(int line)
Specified by:
setLine in interface Location