|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A particular kind of node that represents an element infoset information item.
An element has a collection of children, attributes, and namespaces.
In contrast with DOM, this interface exposes namespaces separately from the attributes.
| Field Summary |
| Fields inherited from interface org.apache.axis2.om.OMNode |
CDATA_SECTION_NODE, COMMENT_NODE, DTD_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, PI_NODE, SPACE_NODE, TEXT_NODE |
| Method Summary | |
OMAttribute |
addAttribute(OMAttribute attr)
This will add an attribute to this element. |
OMAttribute |
addAttribute(java.lang.String attributeName,
java.lang.String value,
OMNamespace ns)
Add an attribute to the current element. |
OMElement |
cloneOMElement()
This method will clone this element. |
OMNamespace |
declareNamespace(OMNamespace namespace)
Declare a namespace with the element as its scope. |
OMNamespace |
declareNamespace(java.lang.String uri,
java.lang.String prefix)
THis will create a namespace in the current element scope |
OMNamespace |
findNamespace(java.lang.String uri,
java.lang.String prefix)
This will find a namespace with the given uri and prefix, in the scope of the hierarchy. |
OMNamespace |
findNamespaceURI(java.lang.String prefix)
This will check for a namespace in the context of this element with the given prefix and will return the relevant namespace object, if available. |
java.util.Iterator |
getAllAttributes()
This will return a List of OMAttributes. |
java.util.Iterator |
getAllDeclaredNamespaces()
Returns an iterator for all of the namespaces declared on this element. |
OMAttribute |
getAttribute(javax.xml.namespace.QName qname)
Return a named attribute if present. |
java.lang.String |
getAttributeValue(javax.xml.namespace.QName qname)
Return a named attribute's value, if present. |
OMXMLParserWrapper |
getBuilder()
Returns the builder object. |
java.util.Iterator |
getChildElements()
Returns a filtered list of children - just the elements. |
OMAttribute |
getFirstAttribute(javax.xml.namespace.QName qname)
This will search for an attribute with a given QName within this Element |
OMElement |
getFirstElement()
Returns the first child element of the element. |
java.lang.String |
getLocalName()
Returns the local name of the element. |
OMNamespace |
getNamespace()
|
javax.xml.namespace.QName |
getQName()
Get the QName of this node |
java.lang.String |
getText()
This will return the non-empty text children as a String |
javax.xml.stream.XMLStreamReader |
getXMLStreamReader()
Returns the pull parser that will generate the pull events relevant to THIS element. |
javax.xml.stream.XMLStreamReader |
getXMLStreamReaderWithoutCaching()
Returns the pull parser that will generate the pull events relevant to THIS element. |
void |
removeAttribute(OMAttribute attr)
Method removeAttribute |
javax.xml.namespace.QName |
resolveQName(java.lang.String qname)
Turn a prefix:local qname string into a proper QName, evaluating it in the OMElement context unprefixed qnames resolve to the local namespace |
void |
setBuilder(OMXMLParserWrapper wrapper)
Method setBuilder |
void |
setFirstChild(OMNode node)
Set the first child |
void |
setLocalName(java.lang.String localName)
Method setLocalName |
void |
setNamespace(OMNamespace namespace)
sets the Namespace |
void |
setText(java.lang.String text)
|
java.lang.String |
toString()
This is a convenience method only. |
java.lang.String |
toStringWithConsume()
This is a convenience method only. |
| Methods inherited from interface org.apache.axis2.om.OMNode |
build, detach, discard, getNextOMSibling, getParent, getPreviousOMSibling, getType, insertSiblingAfter, insertSiblingBefore, isComplete, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume |
| Methods inherited from interface org.apache.axis2.om.OMContainer |
addChild, buildNext, getChildren, getChildrenWithName, getFirstChildWithName, getFirstOMChild, isComplete |
| Method Detail |
public java.util.Iterator getChildElements()
OMContainer.getChildren(),
OMContainer.getChildrenWithName(javax.xml.namespace.QName)
public OMNamespace declareNamespace(java.lang.String uri,
java.lang.String prefix)
uri - The namespace to declare in the current scope. The
caller is expected to ensure that the URI is a valid namespace name.prefix - The prefix to associate with the given namespace.
The caller is expected to ensure that this is a valid XML prefix.
declareNamespace(OMNamespace),
findNamespace(String, String),
getAllDeclaredNamespaces()public OMNamespace declareNamespace(OMNamespace namespace)
namespace - The namespace to declare
declareNamespace(String, String),
findNamespace(String, String),
getAllDeclaredNamespaces()
public OMNamespace findNamespace(java.lang.String uri,
java.lang.String prefix)
This will search from the current element and go up the hiararchy until a match is found. If no match is found, return null.
Either prefix or uri should be null. Results are undefined if both are specified.
uri - The namespace to look for. If this is specified, prefix should be null.prefix - The prefix to look for. If this is specified, uri should be null.
declareNamespace(String, String),
declareNamespace(OMNamespace),
getAllDeclaredNamespaces()public OMNamespace findNamespaceURI(java.lang.String prefix)
prefix -
public java.util.Iterator getAllDeclaredNamespaces()
throws OMException
If you're interested in all namespaces in scope, you need to call this function for all parent elements as well. Note that the iterator may be invalidated by any call to either declareNamespace function.
OMNamespace items declared on the current element.
OMExceptionfindNamespace(String, String),
declareNamespace(String, String),
declareNamespace(OMNamespace)public OMAttribute getFirstAttribute(javax.xml.namespace.QName qname)
qname - The attribute name to match.
public java.util.Iterator getAllAttributes()
Note that the iterator returned by this function will be invalidated by any addAttribute call.
Iterator of OMAttribute items associated with the element.getAttribute(javax.xml.namespace.QName),
addAttribute(OMAttribute),
addAttribute(String, String, OMNamespace)public OMAttribute getAttribute(javax.xml.namespace.QName qname)
qname - the qualified name to search for
public java.lang.String getAttributeValue(javax.xml.namespace.QName qname)
qname - the qualified name to search for
public OMAttribute addAttribute(OMAttribute attr)
There is no order implied by added attributes.
attr - The attribute to add.
public OMAttribute addAttribute(java.lang.String attributeName,
java.lang.String value,
OMNamespace ns)
This function does not check to make sure that the given attribute value can be serialized directly as an XML value. The caller may, for example, pass a string with the character 0x01.
attributeName - The "local name" for the attribute.value - The string value of the attribute.ns - The namespace has to be one of the in scope namespace. i.e. the passed namespace
must be declared in the parent element of this attribute or ancestors of the parent element of the attribute.
public void removeAttribute(OMAttribute attr)
attr - public void setBuilder(OMXMLParserWrapper wrapper)
wrapper - public OMXMLParserWrapper getBuilder()
public void setFirstChild(OMNode node)
node - public OMElement getFirstElement()
public javax.xml.stream.XMLStreamReader getXMLStreamReader()
Caching is on.
public javax.xml.stream.XMLStreamReader getXMLStreamReaderWithoutCaching()
Caching is off.
public void setText(java.lang.String text)
text - public java.lang.String getText()
public java.lang.String getLocalName()
public void setLocalName(java.lang.String localName)
localName -
public OMNamespace getNamespace()
throws OMException
OMExceptionpublic void setNamespace(OMNamespace namespace)
namespace - public javax.xml.namespace.QName getQName()
QName for the element.public java.lang.String toString()
public java.lang.String toStringWithConsume()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic javax.xml.namespace.QName resolveQName(java.lang.String qname)
qname - prefixed qname string to resolve
public OMElement cloneOMElement()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||