| net.n3.nanoxml.IXMLElement
All known Subclasses: net.n3.nanoxml.XMLElement,
IXMLElement | public interface IXMLElement (Code) | | IXMLElement is an XML element. It provides an easy to use generic interface
on top of an XML like data structure like e.g. a DOM like structure.
Elements returned by StdXMLBuilder also implement this interface.
See Also: net.n3.nanoxml.StdXMLBuilder author: Marc De Scheemaecker version: $Name: RELEASE_2_2_1 $, $Revision: 1.4 $ |
Field Summary | |
final public static int | NO_LINE No line number defined. |
Method Summary | |
public void | addChild(IXMLElement child) Adds a child element. | public IXMLElement | createElement(String fullName) Creates an empty element. | public IXMLElement | createElement(String fullName, String systemID, int lineNr) Creates an empty element. | public IXMLElement | createElement(String fullName, String namespace) Creates an empty element. | public IXMLElement | createElement(String fullName, String namespace, String systemID, int lineNr) Creates an empty element. | public IXMLElement | createPCDataElement() Creates an element to be used for #PCDATA content. | public Enumeration | enumerateAttributeNames() Returns an enumeration of all attribute names. | public Enumeration | enumerateChildren() Returns an enumeration of all child elements. | public boolean | equals(Object rawElement) Returns true if the element equals another element. | public boolean | equalsXMLElement(IXMLElement elt) Returns true if the element equals another element. | public String | getAttribute(String name) IXMLElement.getAttribute(java.lang.String,java.lang.String) Parameters: name - the non-null name of the attribute. | public String | getAttribute(String name, String defaultValue) Returns the value of an attribute.
Parameters: name - the non-null full name of the attribute. Parameters: defaultValue - the default value of the attribute. | public String | getAttribute(String name, String namespace, String defaultValue) Returns the value of an attribute.
Parameters: name - the non-null name of the attribute. Parameters: namespace - the namespace URI, which may be null. Parameters: defaultValue - the default value of the attribute. | public int | getAttribute(String name, int defaultValue) Returns the value of an attribute.
Parameters: name - the non-null full name of the attribute. Parameters: defaultValue - the default value of the attribute. | public int | getAttribute(String name, String namespace, int defaultValue) Returns the value of an attribute.
Parameters: name - the non-null name of the attribute. Parameters: namespace - the namespace URI, which may be null. Parameters: defaultValue - the default value of the attribute. | public int | getAttributeCount() Returns the number of attributes. | public String | getAttributeNamespace(String name) Returns the namespace of an attribute.
Parameters: name - the non-null full name of the attribute. | public String | getAttributeType(String name) Returns the type of an attribute.
Parameters: name - the non-null full name of the attribute. | public String | getAttributeType(String name, String namespace) Returns the type of an attribute.
Parameters: name - the non-null name of the attribute. Parameters: namespace - the namespace URI, which may be null. | public Properties | getAttributes() Returns all attributes as a Properties object. | public Properties | getAttributesInNamespace(String namespace) Returns all attributes in a specific namespace as a Properties object.
Parameters: namespace - the namespace URI of the attributes, which may be null. | public IXMLElement | getChildAtIndex(int index) Returns the child at a specific index. | public Vector | getChildren() Returns a vector containing all the child elements. | public int | getChildrenCount() Returns the number of children. | public Vector | getChildrenNamed(String name) Returns a vector of all child elements named name.
Parameters: name - the full name of the children to search for. | public Vector | getChildrenNamed(String name, String namespace) Returns a vector of all child elements named name.
Parameters: name - the name of the children to search for. Parameters: namespace - the namespace, which may be null. | public String | getContent() Return the #PCDATA content of the element. | public IXMLElement | getFirstChildNamed(String name) Searches a child element.
Parameters: name - the full name of the child to search for. | public IXMLElement | getFirstChildNamed(String name, String namespace) Searches a child element.
Parameters: name - the name of the child to search for. Parameters: namespace - the namespace, which may be null. | public String | getFullName() Returns the full name (i.e. | public int | getLineNr() Returns the line number in the data where the element started. | public String | getName() Returns the name of the element. | public String | getNamespace() Returns the namespace of the element. | public IXMLElement | getParent() Returns the parent element. | public String | getSystemID() Returns the system ID of the data where the element started. | public boolean | hasAttribute(String name) Returns whether an attribute exists.
Parameters: name - the non-null name of the attribute. | public boolean | hasAttribute(String name, String namespace) Returns whether an attribute exists.
Parameters: name - the non-null name of the attribute. Parameters: namespace - the namespace URI of the attribute, which may be null. | public boolean | hasChildren() Returns whether the element has children. | public boolean | isLeaf() Returns whether the element is a leaf element. | public void | removeAttribute(String name) Removes an attribute. | public void | removeAttribute(String name, String namespace) Removes an attribute. | public void | removeChild(IXMLElement child) Removes a child element. | public void | removeChildAtIndex(int index) Removes the child located at a certain index. | public void | setAttribute(String name, String value) Sets an attribute. | public void | setAttribute(String fullName, String namespace, String value) Sets an attribute. | public void | setContent(String content) Sets the #PCDATA content. | public void | setName(String name) Sets the full name. | public void | setName(String fullName, String namespace) Sets the name. |
NO_LINE | final public static int NO_LINE(Code) | | No line number defined.
|
addChild | public void addChild(IXMLElement child)(Code) | | Adds a child element.
Parameters: child - the non-null child to add. |
createElement | public IXMLElement createElement(String fullName)(Code) | | Creates an empty element.
Parameters: fullName - the name of the element. |
createElement | public IXMLElement createElement(String fullName, String systemID, int lineNr)(Code) | | Creates an empty element.
Parameters: fullName - the name of the element. Parameters: systemID - the system ID of the XML data where the element starts. Parameters: lineNr - the line in the XML data where the element starts. |
createElement | public IXMLElement createElement(String fullName, String namespace)(Code) | | Creates an empty element.
Parameters: fullName - the full name of the element Parameters: namespace - the namespace URI. |
createElement | public IXMLElement createElement(String fullName, String namespace, String systemID, int lineNr)(Code) | | Creates an empty element.
Parameters: fullName - the full name of the element Parameters: namespace - the namespace URI. Parameters: systemID - the system ID of the XML data where the element starts. Parameters: lineNr - the line in the XML data where the element starts. |
createPCDataElement | public IXMLElement createPCDataElement()(Code) | | Creates an element to be used for #PCDATA content.
|
enumerateAttributeNames | public Enumeration enumerateAttributeNames()(Code) | | Returns an enumeration of all attribute names.
the non-null enumeration. |
enumerateChildren | public Enumeration enumerateChildren()(Code) | | Returns an enumeration of all child elements.
the non-null enumeration |
equals | public boolean equals(Object rawElement)(Code) | | Returns true if the element equals another element.
Parameters: rawElement - the element to compare to |
equalsXMLElement | public boolean equalsXMLElement(IXMLElement elt)(Code) | | Returns true if the element equals another element.
Parameters: rawElement - the element to compare to |
getAttribute | public String getAttribute(String name, String defaultValue)(Code) | | Returns the value of an attribute.
Parameters: name - the non-null full name of the attribute. Parameters: defaultValue - the default value of the attribute. the value, or defaultValue if the attribute does not exist. |
getAttribute | public String getAttribute(String name, String namespace, String defaultValue)(Code) | | Returns the value of an attribute.
Parameters: name - the non-null name of the attribute. Parameters: namespace - the namespace URI, which may be null. Parameters: defaultValue - the default value of the attribute. the value, or defaultValue if the attribute does not exist. |
getAttribute | public int getAttribute(String name, int defaultValue)(Code) | | Returns the value of an attribute.
Parameters: name - the non-null full name of the attribute. Parameters: defaultValue - the default value of the attribute. the value, or defaultValue if the attribute does not exist. |
getAttribute | public int getAttribute(String name, String namespace, int defaultValue)(Code) | | Returns the value of an attribute.
Parameters: name - the non-null name of the attribute. Parameters: namespace - the namespace URI, which may be null. Parameters: defaultValue - the default value of the attribute. the value, or defaultValue if the attribute does not exist. |
getAttributeCount | public int getAttributeCount()(Code) | | Returns the number of attributes.
|
getAttributeNamespace | public String getAttributeNamespace(String name)(Code) | | Returns the namespace of an attribute.
Parameters: name - the non-null full name of the attribute. the namespace, or null if there is none associated. |
getAttributeType | public String getAttributeType(String name)(Code) | | Returns the type of an attribute.
Parameters: name - the non-null full name of the attribute. the type, or null if the attribute does not exist. |
getAttributeType | public String getAttributeType(String name, String namespace)(Code) | | Returns the type of an attribute.
Parameters: name - the non-null name of the attribute. Parameters: namespace - the namespace URI, which may be null. the type, or null if the attribute does not exist. |
getAttributes | public Properties getAttributes()(Code) | | Returns all attributes as a Properties object.
the non-null set. |
getAttributesInNamespace | public Properties getAttributesInNamespace(String namespace)(Code) | | Returns all attributes in a specific namespace as a Properties object.
Parameters: namespace - the namespace URI of the attributes, which may be null. the non-null set. |
getChildren | public Vector getChildren()(Code) | | Returns a vector containing all the child elements.
the vector. |
getChildrenCount | public int getChildrenCount()(Code) | | Returns the number of children.
the count. |
getChildrenNamed | public Vector getChildrenNamed(String name)(Code) | | Returns a vector of all child elements named name.
Parameters: name - the full name of the children to search for. the non-null vector of child elements. |
getChildrenNamed | public Vector getChildrenNamed(String name, String namespace)(Code) | | Returns a vector of all child elements named name.
Parameters: name - the name of the children to search for. Parameters: namespace - the namespace, which may be null. the non-null vector of child elements. |
getContent | public String getContent()(Code) | | Return the #PCDATA content of the element. If the element has a
combination of #PCDATA content and child elements, the #PCDATA
sections can be retrieved as unnamed child objects. In this case,
this method returns null.
the content. |
getFirstChildNamed | public IXMLElement getFirstChildNamed(String name)(Code) | | Searches a child element.
Parameters: name - the full name of the child to search for. the child element, or null if no such child was found. |
getFirstChildNamed | public IXMLElement getFirstChildNamed(String name, String namespace)(Code) | | Searches a child element.
Parameters: name - the name of the child to search for. Parameters: namespace - the namespace, which may be null. the child element, or null if no such child was found. |
getFullName | public String getFullName()(Code) | | Returns the full name (i.e. the name including an eventual namespace
prefix) of the element.
the name, or null if the element only contains #PCDATA. |
getName | public String getName()(Code) | | Returns the name of the element.
the name, or null if the element only contains #PCDATA. |
getNamespace | public String getNamespace()(Code) | | Returns the namespace of the element.
the namespace, or null if no namespace is associated with theelement. |
getParent | public IXMLElement getParent()(Code) | | Returns the parent element. This method returns null for the root
element.
|
getSystemID | public String getSystemID()(Code) | | Returns the system ID of the data where the element started.
the system ID, or null if unknown. See Also: IXMLElement.getLineNr |
hasAttribute | public boolean hasAttribute(String name)(Code) | | Returns whether an attribute exists.
Parameters: name - the non-null name of the attribute. true if the attribute exists. |
hasAttribute | public boolean hasAttribute(String name, String namespace)(Code) | | Returns whether an attribute exists.
Parameters: name - the non-null name of the attribute. Parameters: namespace - the namespace URI of the attribute, which may be null. true if the attribute exists. |
hasChildren | public boolean hasChildren()(Code) | | Returns whether the element has children.
true if the element has children. |
isLeaf | public boolean isLeaf()(Code) | | Returns whether the element is a leaf element.
true if the element has no children. |
removeAttribute | public void removeAttribute(String name)(Code) | | Removes an attribute.
Parameters: name - the non-null name of the attribute. |
removeAttribute | public void removeAttribute(String name, String namespace)(Code) | | Removes an attribute.
Parameters: name - the non-null name of the attribute. Parameters: namespace - the namespace URI of the attribute, which may be null. |
removeChild | public void removeChild(IXMLElement child)(Code) | | Removes a child element.
Parameters: child - the non-null child to remove. |
removeChildAtIndex | public void removeChildAtIndex(int index)(Code) | | Removes the child located at a certain index.
Parameters: index - the index of the child, where the first child has index 0. |
setAttribute | public void setAttribute(String name, String value)(Code) | | Sets an attribute.
Parameters: name - the non-null full name of the attribute. Parameters: value - the non-null value of the attribute. |
setAttribute | public void setAttribute(String fullName, String namespace, String value)(Code) | | Sets an attribute.
Parameters: fullName - the non-null full name of the attribute. Parameters: namespace - the namespace URI of the attribute, which may be null. Parameters: value - the non-null value of the attribute. |
setContent | public void setContent(String content)(Code) | | Sets the #PCDATA content. It is an error to call this method with a
non-null value if there are child objects.
Parameters: content - the (possibly null) content. |
setName | public void setName(String name)(Code) | | Sets the full name. This method also sets the short name and clears the
namespace URI.
Parameters: name - the non-null name. |
setName | public void setName(String fullName, String namespace)(Code) | | Sets the name.
Parameters: fullName - the non-null full name. Parameters: namespace - the namespace URI, which may be null. |
|
|