|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.axis2.om.impl.llom.OMNodeImpl
org.apache.axis2.om.impl.llom.OMElementImpl
Class OMElementImpl
Field Summary | |
protected java.util.HashMap |
attributes
Field attributes |
protected OMNode |
firstChild
Field firstChild |
protected java.lang.String |
localName
Field localName |
protected java.util.HashMap |
namespaces
Field namespaces |
protected int |
noPrefixNamespaceCounter
Field noPrefixNamespaceCounter |
protected OMNamespace |
ns
Field ns |
Fields inherited from class org.apache.axis2.om.impl.llom.OMNodeImpl |
builder, done, nextSibling, nodeType, parent, previousSibling |
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 |
Fields inherited from interface org.apache.axis2.om.OMConstants |
ARRAY_ITEM_LOCALNAME, ARRAY_ITEM_NS_PREFIX, ARRAY_ITEM_NSURI, ARRAY_ITEM_QNAME, DEFAULT_CHAR_SET_ENCODING, DEFAULT_XML_VERSION, PULL_TYPE_BUILDER, PUSH_TYPE_BUILDER |
Constructor Summary | |
OMElementImpl(javax.xml.namespace.QName qname,
OMContainer parent)
Here it is assumed that this QName passed, at least contains the localName for this element |
|
OMElementImpl(java.lang.String localName,
OMNamespace ns)
Constructor OMElementImpl |
|
OMElementImpl(java.lang.String localName,
OMNamespace ns,
OMContainer parent)
This is the basic constructor for OMElement. |
|
OMElementImpl(java.lang.String localName,
OMNamespace ns,
OMContainer parent,
OMXMLParserWrapper builder)
Constructor OMElementImpl |
Method Summary | |
OMAttribute |
addAttribute(OMAttribute attr)
This will insert attribute to this element. |
OMAttribute |
addAttribute(java.lang.String attributeName,
java.lang.String value,
OMNamespace ns)
Method addAttribute |
void |
addChild(OMNode child)
This will add child to the element. |
void |
buildNext()
This will force the parser to proceed, if parser has not yet finished with the XML input |
OMNamespace |
declareNamespace(OMNamespace namespace)
|
OMNamespace |
declareNamespace(java.lang.String uri,
java.lang.String prefix)
THis will create a namespace in the current element scope |
OMNode |
detach()
This will remove this information item and its children, from the model completely |
void |
discard()
Discard implementation |
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 docuemnt. |
java.util.Iterator |
getAllDeclaredNamespaces()
Method getAllDeclaredNamespaces |
OMAttribute |
getAttribute(javax.xml.namespace.QName qname)
Return a named attribute if present |
java.util.Iterator |
getAttributes()
This will return a List of OMAttributes |
OMXMLParserWrapper |
getBuilder()
Method getBuilder |
java.util.Iterator |
getChildElements()
Returns a filtered list of children - just the elements. |
java.util.Iterator |
getChildren()
This returns a collection of this element. |
java.util.Iterator |
getChildrenWithName(javax.xml.namespace.QName elementQName)
This will search for children with a given QName and will return an iterator to traverse through the OMNodes. |
OMAttribute |
getFirstAttribute(javax.xml.namespace.QName qname)
This will help to search for an attribute with a given QName within this Element |
OMNode |
getFirstChild()
Method getFirstChild |
OMElement |
getFirstChildWithName(javax.xml.namespace.QName elementQName)
Method getFirstChildWithName |
OMElement |
getFirstElement()
Get first element |
java.lang.String |
getLocalName()
Method getLocalName |
OMNamespace |
getNamespace()
Method getNamespace |
OMNode |
getNextSibling()
This will give the next sibling. |
javax.xml.namespace.QName |
getQName()
Method getQName |
java.lang.String |
getText()
select all the text children and concat them to a single string |
java.lang.String |
getTrimmedText()
Returns the concatanation of TRIMMED values of all OMText child nodes of this element This is incuded purely to improve usability |
int |
getType()
This is to get the type of node, as this is the super class of all the nodes |
XMLStreamReader |
getXMLStreamReader()
getXMLStreamReader |
XMLStreamReader |
getXMLStreamReaderWithoutCaching()
getXMLStreamReaderWithoutCaching |
boolean |
isComplete()
Method isComplete |
void |
removeAttribute(OMAttribute attr)
Method removeAttribute |
void |
serialize(OMOutputImpl omOutput)
This was requested during the second Axis2 summit. |
protected void |
serialize(OMOutputImpl omOutput,
boolean cache)
|
void |
serializeWithCache(OMOutputImpl omOutput)
Method serializeWithCache |
void |
setBuilder(OMXMLParserWrapper wrapper)
Method setBuilder |
void |
setFirstChild(OMNode firstChild)
Method setFirstChild |
void |
setLocalName(java.lang.String localName)
Method setLocalName |
void |
setNamespace(OMNamespace namespace)
Method setNamespace |
void |
setText(java.lang.String text)
Sets the text of the given element. |
Methods inherited from class org.apache.axis2.om.impl.llom.OMNodeImpl |
build, getParent, getPreviousSibling, insertSiblingAfter, insertSiblingBefore, serialize, serializeWithCache, setComplete, setNextSibling, setParent, setPreviousSibling, setType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.axis2.om.OMNode |
build, getParent, getPreviousSibling, insertSiblingAfter, insertSiblingBefore, serialize, serializeWithCache |
Methods inherited from interface org.apache.axis2.om.impl.OMContainerEx |
setComplete |
Field Detail |
protected OMNamespace ns
protected java.lang.String localName
protected OMNode firstChild
protected java.util.HashMap namespaces
protected java.util.HashMap attributes
protected int noPrefixNamespaceCounter
Constructor Detail |
public OMElementImpl(java.lang.String localName, OMNamespace ns, OMContainer parent, OMXMLParserWrapper builder)
public OMElementImpl(java.lang.String localName, OMNamespace ns)
public OMElementImpl(java.lang.String localName, OMNamespace ns, OMContainer parent)
localName
- - this MUST always be not nullns
- - can be nullparent
- - this should be an OMContainerpublic OMElementImpl(javax.xml.namespace.QName qname, OMContainer parent) throws OMException
qname
- - this should be valid qname according to javax.xml.namespace.QName
OMException
Method Detail |
public void addChild(OMNode child)
addChild
in interface OMElement
child
- public java.util.Iterator getChildrenWithName(javax.xml.namespace.QName elementQName) throws OMException
getChildrenWithName
in interface OMElement
elementQName
-
OMException
OMException
public OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName) throws OMException
getFirstChildWithName
in interface OMElement
elementQName
-
OMException
public OMNode getNextSibling() throws OMException
getNextSibling
in interface OMNode
getNextSibling
in class OMNodeImpl
OMException
OMException
public java.util.Iterator getChildren()
getChildren
in interface OMElement
public java.util.Iterator getChildElements()
getChildElements
in interface OMElement
public OMNamespace declareNamespace(java.lang.String uri, java.lang.String prefix)
declareNamespace
in interface OMElement
uri
- prefix
-
public OMNamespace declareNamespace(OMNamespace namespace)
declareNamespace
in interface OMElement
namespace
-
public OMNamespace findNamespace(java.lang.String uri, java.lang.String prefix) throws OMException
findNamespace
in interface OMElement
uri
- prefix
-
OMException
OMException
public java.util.Iterator getAllDeclaredNamespaces()
getAllDeclaredNamespaces
in interface OMElement
public OMAttribute getFirstAttribute(javax.xml.namespace.QName qname) throws OMException
getFirstAttribute
in interface OMElement
qname
-
OMException
OMException
public java.util.Iterator getAttributes()
getAttributes
in interface OMElement
public OMAttribute getAttribute(javax.xml.namespace.QName qname)
getAttribute
in interface OMElement
qname
- the qualified name to search for
public OMAttribute addAttribute(OMAttribute attr)
addAttribute
in interface OMElement
attr
-
public void removeAttribute(OMAttribute attr)
removeAttribute
in interface OMElement
attr
- public OMAttribute addAttribute(java.lang.String attributeName, java.lang.String value, OMNamespace ns)
addAttribute
in interface OMElement
attributeName
- value
- 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 setBuilder(OMXMLParserWrapper wrapper)
setBuilder
in interface OMElement
wrapper
- public OMXMLParserWrapper getBuilder()
getBuilder
in interface OMElement
public void buildNext()
buildNext
in interface OMContainer
public OMNode getFirstChild()
getFirstChild
in interface OMElement
public void setFirstChild(OMNode firstChild)
setFirstChild
in interface OMElement
firstChild
- public OMNode detach() throws OMException
detach
in interface OMNode
detach
in class OMNodeImpl
OMException
OMException
public boolean isComplete()
isComplete
in interface OMNode
isComplete
in class OMNodeImpl
public int getType() throws OMException
getType
in interface OMNode
getType
in class OMNodeImpl
OMException
OMException
public XMLStreamReader getXMLStreamReader()
getXMLStreamReader
in interface OMElement
OMElement.getXMLStreamReader()
public XMLStreamReader getXMLStreamReaderWithoutCaching()
getXMLStreamReaderWithoutCaching
in interface OMElement
OMElement.getXMLStreamReaderWithoutCaching()
public void setText(java.lang.String text)
setText
in interface OMElement
text
- public java.lang.String getText()
getText
in interface OMElement
public java.lang.String getTrimmedText()
public void serializeWithCache(OMOutputImpl omOutput) throws XMLStreamException
serializeWithCache
in class OMNodeImpl
omOutput
-
XMLStreamException
#serializeWithCache(org.apache.axis2.om.impl.OMOutputImpl)
protected void serialize(OMOutputImpl omOutput, boolean cache) throws XMLStreamException
XMLStreamException
public void serialize(OMOutputImpl omOutput) throws XMLStreamException
serialize
in class OMNodeImpl
omOutput
-
XMLStreamException
#serialize(org.apache.axis2.om.impl.OMOutputImpl)
public OMElement getFirstElement()
getFirstElement
in interface OMElement
public java.lang.String getLocalName()
getLocalName
in interface OMElement
public void setLocalName(java.lang.String localName)
setLocalName
in interface OMElement
localName
- public OMNamespace getNamespace() throws OMException
getNamespace
in interface OMElement
OMException
public void setNamespace(OMNamespace namespace)
setNamespace
in interface OMElement
namespace
- public javax.xml.namespace.QName getQName()
getQName
in interface OMElement
public void discard() throws OMException
discard
in interface OMNode
OMException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |