com.smallx.xml.infoset
Interface Element

All Superinterfaces:
Child, Item, Location, Named, Parent, Prefixed, Validity
All Known Implementing Classes:
MemoryElement

public interface Element
extends Parent, Child, Named, Prefixed, Location, Validity

This interface represents an XML element.


Field Summary
static int 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
 
Fields inherited from interface com.smallx.xml.infoset.Validity
ATTEMPTED_FULL, ATTEMPTED_NONE, ATTEMPTED_PARTIAL, INVALID, NOT_KNOWN, VALID
 
Method Summary
 void addNamespaceBinding(java.lang.String prefix, java.net.URI namespace)
          Sets the default namespace locally.
 Characters appendCharacters(java.lang.String data)
          Appends a data object to the end of the children content.
 Characters appendData(java.lang.Object data)
          Appends a data object to the end of the children content.
 Element appendElement(Name name)
          Appends a new element to the end of the children content.
 Element appendElement(java.lang.String local)
          Appends a new element to the end of the children content.
 Attribute getAttribute(Name name)
          Gets an attribute by name.
 Attribute getAttribute(java.lang.String local)
          Gets an attribute by an unqualified name.
 java.util.Iterator getAttributes()
          Returns all the attributes specified on this element.
 java.lang.String getAttributeValue(Name name)
          Gets an attribute value by name.
 java.lang.String getAttributeValue(java.lang.String local)
          Gets an attribute value by an unqualified name.
 java.util.Iterator getAttributeValueTokenized(Name name)
          Gets an attribute value by name.
 java.util.Iterator getAttributeValueTokenized(java.lang.String local)
          Gets an attribute value by an unqualified name.
 java.util.Iterator getInScopeNamespaces()
           
 NamespaceScope getNamespaceScope()
          Returns the namespace scope associated with this element.
 java.lang.String getNormalizedText()
           
 java.lang.String getText()
           
 boolean hasAttributes()
           
 boolean hasNamespaceDeclarations()
          Signals that the namespace scope is local to this node and not the parent's namespace scope.
 Child insertCharactersBefore(int index, java.lang.String value)
          Inserts a data object into the children content.
 Child insertDataBefore(int index, java.lang.Object data)
          Inserts a data object into the children content.
 Element insertElementBefore(int index, Name name)
          Inserts a new element to the end of the children content.
 Element insertElementBefore(int index, java.lang.String local)
          Inserts a new element into the children content.
 boolean isSpacePreserving()
          Indicates if the element is set to preserve space.
 void localizeNamespaceDeclarations()
          Localizes all namespace declarations.
 void removeAttribute(Name name)
          Removes an attribute by name.
 void removeAttribute(java.lang.String local)
          Removes an attribute by an unqualified name.
 void setAttribute(Name name, java.lang.String value)
          Sets an attribute value by name.
 void setAttribute(java.lang.String localName, java.lang.String value)
          Sets an attribute value by name.
 
Methods inherited from interface com.smallx.xml.infoset.Parent
appendChild, getBaseURI, getChildAt, getChildren, getChildrenByType, getDocument, getNumberOfChildren, hasChildren, insertChildBefore, removeChild, removeChildAt, setBaseURI, swapChild
 
Methods inherited from interface com.smallx.xml.infoset.Child
compareTo, getFollowingSibling, getFollowingSiblings, getParent, getPrecedingSibling, getPrecedingSiblings
 
Methods inherited from interface com.smallx.xml.infoset.Item
getAxis, getGeneratedId, getInfoset, getOrigin, getType
 
Methods inherited from interface com.smallx.xml.infoset.Named
getName, setName, setName, setName
 
Methods inherited from interface com.smallx.xml.infoset.Prefixed
getPrefix, setPrefix
 
Methods inherited from interface com.smallx.xml.infoset.Location
getColumn, getLine, setColumn, setLine
 
Methods inherited from interface com.smallx.xml.infoset.Validity
getTypeDefinition, getValidationAttempted, getValidity, setTypeDefinition, setValidity
 

Field Detail

TYPE

public static final int TYPE
See Also:
Constant Field Values
Method Detail

hasAttributes

public boolean hasAttributes()

getAttributes

public java.util.Iterator getAttributes()
Returns all the attributes specified on this element.

Returns:
A iteration of the attributes.

getAttribute

public Attribute getAttribute(Name name)
Gets an attribute by name.

Parameters:
name - The name of the attribute.
Returns:
An attribute instance or null if the attribute does not exist.

getAttribute

public Attribute getAttribute(java.lang.String local)
Gets an attribute by an unqualified name.

Parameters:
local - The unqualified name of the attribute.
Returns:
An attribute instance or null if the attribute does not exist.

getAttributeValue

public java.lang.String getAttributeValue(Name name)
Gets an attribute value by name.

Parameters:
name - The name of the attribute.
Returns:
A data value for the attribute or null if the attribute does not exist.

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String local)
Gets an attribute value by an unqualified name.

Parameters:
local - The unqualified name of the attribute.
Returns:
A data value for the attribute or null if the attribute does not exist.

getAttributeValueTokenized

public java.util.Iterator getAttributeValueTokenized(Name name)
Gets an attribute value by name.

Parameters:
name - The name of the attribute.
Returns:
A data value for the attribute or null if the attribute does not exist.

getAttributeValueTokenized

public java.util.Iterator getAttributeValueTokenized(java.lang.String local)
Gets an attribute value by an unqualified name.

Parameters:
local - The unqualified name of the attribute.
Returns:
A data value for the attribute or null if the attribute does not exist.

setAttribute

public void setAttribute(Name name,
                         java.lang.String value)
Sets an attribute value by name. If the attribute does not exist, it will be create.

Parameters:
name - The name of the attribute.
value - The data value to use.

setAttribute

public void setAttribute(java.lang.String localName,
                         java.lang.String value)
Sets an attribute value by name. If the attribute does not exist, it will be create.

Parameters:
localName - The unqualified name of the attribute.
value - The data value to use.

removeAttribute

public void removeAttribute(Name name)
Removes an attribute by name.

Parameters:
name - The name of the attribute.

removeAttribute

public void removeAttribute(java.lang.String local)
Removes an attribute by an unqualified name.

Parameters:
local - The unqualfied name of the attribute.

appendElement

public Element appendElement(Name name)
Appends a new element to the end of the children content.

Parameters:
name - The name of the element to create.
Returns:
An instance of element with the specified name.

appendElement

public Element appendElement(java.lang.String local)
Appends a new element to the end of the children content.

Parameters:
local - The local name to be interpreted by the namespace scope of the element to create.
Returns:
An instance of element with the specified name.

insertElementBefore

public Element insertElementBefore(int index,
                                   Name name)
Inserts a new element to the end of the children content.

Parameters:
index - The index of the position of where to create the element where zero is the beginning of the children content.
name - The name of the element to create.
Returns:
An instance of element with the specified name.

insertElementBefore

public Element insertElementBefore(int index,
                                   java.lang.String local)
Inserts a new element into the children content.

Parameters:
index - The index of the position of where to create the element where zero is the beginning of the children content.
local - The local name to be interpreted by the namespace scope of the element to create.
Returns:
An instance of element with the specified name.

appendData

public Characters appendData(java.lang.Object data)
Appends a data object to the end of the children content.

Parameters:
data - The data object to append.
Returns:
An instance of Child that conforms to Data as well.

appendCharacters

public Characters appendCharacters(java.lang.String data)
Appends a data object to the end of the children content.

Parameters:
data - The data object to append.
Returns:
An instance of Child that conforms to Data as well.

insertDataBefore

public Child insertDataBefore(int index,
                              java.lang.Object data)
Inserts a data object into the children content.

Parameters:
index - The index of the position of where to create the data child where zero is the beginning of the children content.
data - The data object to append.
Returns:
An instance of Data.

insertCharactersBefore

public Child insertCharactersBefore(int index,
                                    java.lang.String value)
Inserts a data object into the children content.

Parameters:
index - The index of the position of where to create the data child where zero is the beginning of the children content.
value - The data object to append.
Returns:
An instance of Data.

isSpacePreserving

public boolean isSpacePreserving()
Indicates if the element is set to preserve space.


addNamespaceBinding

public void addNamespaceBinding(java.lang.String prefix,
                                java.net.URI namespace)
Sets the default namespace locally.

Parameters:
namespace - The namespace name to be set as default.

getNamespaceScope

public NamespaceScope getNamespaceScope()
Returns the namespace scope associated with this element.


hasNamespaceDeclarations

public boolean hasNamespaceDeclarations()
Signals that the namespace scope is local to this node and not the parent's namespace scope.

Returns:
Returns true if namespace scope is local to this node.

localizeNamespaceDeclarations

public void localizeNamespaceDeclarations()
Localizes all namespace declarations. This is useful when mixing element item streams.


getInScopeNamespaces

public java.util.Iterator getInScopeNamespaces()

getText

public java.lang.String getText()

getNormalizedText

public java.lang.String getNormalizedText()