|
|||||||||||
| 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 HashMap |
attributes
Field attributes |
protected OMNode |
firstChild
Field firstChild |
protected String |
localName
Field localName |
protected 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, XMLNS_NS_PREFIX, XMLNS_NS_URI, XMLNS_PREFIX, XMLNS_URI |
| Constructor Summary | |
OMElementImpl(QName qname,
OMContainer parent)
It is assumed that the QName passed contains, at least, the localName for this element. |
|
OMElementImpl(String localName,
OMNamespace ns)
Constructor OMElementImpl. |
|
OMElementImpl(String localName,
OMNamespace ns,
OMContainer parent)
This is the basic constructor for OMElement. |
|
OMElementImpl(String localName,
OMNamespace ns,
OMContainer parent,
OMXMLParserWrapper builder)
Constructor OMElementImpl. |
|
| Method Summary | |
OMAttribute |
addAttribute(OMAttribute attr)
Inserts an attribute to this element. |
OMAttribute |
addAttribute(String attributeName,
String value,
OMNamespace ns)
Method addAttribute. |
void |
addChild(OMNode child)
Adds child to the element. |
void |
buildNext()
Forces the parser to proceed, if parser has not yet finished with the XML input. |
OMElement |
cloneOMElement()
Clones this element. |
OMNamespace |
declareNamespace(OMNamespace namespace)
Declares a namespace with the element as its scope. |
OMNamespace |
declareNamespace(String uri,
String prefix)
Creates a namespace in the current element scope. |
OMNode |
detach()
Removes this information item and its children, from the model completely. |
void |
discard()
Method discard. |
OMNamespace |
findNamespace(String uri,
String prefix)
Finds a namespace with the given uri and prefix, in the scope of the document. |
OMNamespace |
findNamespaceURI(String prefix)
Checks for a namespace in the context of this element with the given prefix and returns the relevant namespace object, if available. |
Iterator |
getAllAttributes()
Returns a List of OMAttributes. |
Iterator |
getAllDeclaredNamespaces()
Method getAllDeclaredNamespaces. |
OMAttribute |
getAttribute(QName qname)
Returns a named attribute if present. |
String |
getAttributeValue(QName qname)
Returns a named attribute's value, if present. |
OMXMLParserWrapper |
getBuilder()
Method getBuilder. |
Iterator |
getChildElements()
Returns a filtered list of children - just the elements. |
Iterator |
getChildren()
Returns a collection of this element. |
Iterator |
getChildrenWithName(QName elementQName)
Searches for children with a given QName and returns an iterator to traverse through the OMNodes. |
OMElement |
getFirstChildWithName(QName elementQName)
Method getFirstChildWithName. |
OMElement |
getFirstElement()
Gets first element. |
OMNode |
getFirstOMChild()
Method getFirstOMChild. |
String |
getLocalName()
Method getLocalName. |
OMNamespace |
getNamespace()
Method getNamespace. |
OMNode |
getNextOMSibling()
Gets the next sibling. |
QName |
getQName()
Method getQName. |
String |
getText()
Selects all the text children and concatinates them to a single string. |
String |
getTrimmedText()
Returns the concatination string of TRIMMED values of all OMText child nodes of this element. |
int |
getType()
Gets the type of node, as this is the super class of all the nodes. |
XMLStreamReader |
getXMLStreamReader()
Method getXMLStreamReader. |
XMLStreamReader |
getXMLStreamReaderWithoutCaching()
Method getXMLStreamReaderWithoutCaching. |
boolean |
isComplete()
Method isComplete. |
void |
removeAttribute(OMAttribute attr)
Method removeAttribute. |
QName |
resolveQName(String qname)
Converts a prefix:local qname string into a proper QName, evaluating it in the OMElement context. |
void |
serialize(OMOutputImpl omOutput)
Method serialize. |
protected void |
serialize(OMOutputImpl omOutput,
boolean cache)
|
void |
serializeAndConsume(OMOutputImpl omOutput)
This method serializes and consumes without building the object structure in memory. |
void |
setBuilder(OMXMLParserWrapper wrapper)
Method setBuilder. |
void |
setFirstChild(OMNode firstChild)
Method setFirstChild. |
void |
setLocalName(String localName)
Method setLocalName. |
void |
setNamespace(OMNamespace namespace)
Method setNamespace. |
void |
setText(String text)
Sets the text of the given element. |
String |
toString()
This is a convenience method only. |
String |
toStringWithConsume()
This is a convenience method only. |
| Methods inherited from class org.apache.axis2.om.impl.llom.OMNodeImpl |
build, getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete, setNextOMSibling, setParent, setPreviousOMSibling, setType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.axis2.om.OMNode |
build, getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume |
| Methods inherited from interface org.apache.axis2.om.impl.OMContainerEx |
setComplete |
| Field Detail |
protected OMNamespace ns
protected String localName
protected OMNode firstChild
protected HashMap namespaces
protected HashMap attributes
protected int noPrefixNamespaceCounter
| Constructor Detail |
public OMElementImpl(String localName,
OMNamespace ns,
OMContainer parent,
OMXMLParserWrapper builder)
public OMElementImpl(String localName,
OMNamespace ns)
public OMElementImpl(String localName,
OMNamespace ns,
OMContainer parent)
localName - - this MUST always be not nullns - - can be nullparent - - this should be an OMContainer
public OMElementImpl(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 OMContainerchild - public Iterator getChildrenWithName(QName elementQName)
getChildrenWithName in interface OMContainerelementQName - The QName specifying namespace and local name to match.
OMElement items that match the given QName appropriately.
OMException
public OMElement getFirstChildWithName(QName elementQName)
throws OMException
getFirstChildWithName in interface OMContainerelementQName - The QName to use for matching.
OMExceptionOMContainer.getChildrenWithName(javax.xml.namespace.QName)
public OMNode getNextOMSibling()
throws OMException
getNextOMSibling in interface OMNodegetNextOMSibling in class OMNodeImplOMExceptionpublic Iterator getChildren()
getChildren in interface OMContainerOMContainer.getFirstChildWithName(javax.xml.namespace.QName),
OMContainer.getChildrenWithName(javax.xml.namespace.QName)public Iterator getChildElements()
getChildElements in interface OMElementOMContainer.getChildren(),
OMContainer.getChildrenWithName(javax.xml.namespace.QName)
public OMNamespace declareNamespace(String uri,
String prefix)
declareNamespace in interface OMElementuri - 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.
OMElement.declareNamespace(OMNamespace),
OMElement.findNamespace(String, String),
OMElement.getAllDeclaredNamespaces()public OMNamespace declareNamespace(OMNamespace namespace)
OMElement
declareNamespace in interface OMElementnamespace - The namespace to declare
OMElement.declareNamespace(String, String),
OMElement.findNamespace(String, String),
OMElement.getAllDeclaredNamespaces()
public OMNamespace findNamespace(String uri,
String prefix)
findNamespace in interface OMElementuri - 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.
OMElement.declareNamespace(String, String),
OMElement.declareNamespace(OMNamespace),
OMElement.getAllDeclaredNamespaces()public OMNamespace findNamespaceURI(String prefix)
OMElement
findNamespaceURI in interface OMElementprefix - public Iterator getAllDeclaredNamespaces()
getAllDeclaredNamespaces in interface OMElementOMElement.findNamespace(String, String),
OMElement.declareNamespace(String, String),
OMElement.declareNamespace(OMNamespace)public Iterator getAllAttributes()
getAllAttributes in interface OMElementOMElement.getAttribute(javax.xml.namespace.QName),
OMElement.addAttribute(OMAttribute),
OMElement.addAttribute(String, String, OMNamespace)public OMAttribute getAttribute(QName qname)
getAttribute in interface OMElementqname - the qualified name to search for
public String getAttributeValue(QName qname)
getAttributeValue in interface OMElementqname - the qualified name to search for
public OMAttribute addAttribute(OMAttribute attr)
addAttribute in interface OMElementattr - The attribute to add.
public void removeAttribute(OMAttribute attr)
removeAttribute in interface OMElementattr -
public OMAttribute addAttribute(String attributeName,
String value,
OMNamespace ns)
addAttribute in interface OMElementattributeName - 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 setBuilder(OMXMLParserWrapper wrapper)
setBuilder in interface OMElementwrapper - public OMXMLParserWrapper getBuilder()
getBuilder in interface OMElementpublic void buildNext()
buildNext in interface OMContainerpublic OMNode getFirstOMChild()
getFirstOMChild in interface OMContainerpublic void setFirstChild(OMNode firstChild)
setFirstChild in interface OMElementfirstChild -
public OMNode detach()
throws OMException
detach in interface OMNodedetach in class OMNodeImplOMExceptionpublic boolean isComplete()
isComplete in interface OMNodeisComplete in class OMNodeImplpublic int getType()
getType in interface OMNodegetType in class OMNodeImplOMNodeImpl.setType(int)OMNodeImpl.setType(int)public XMLStreamReader getXMLStreamReader()
getXMLStreamReader in interface OMElementOMElement.getXMLStreamReader()public XMLStreamReader getXMLStreamReaderWithoutCaching()
getXMLStreamReaderWithoutCaching in interface OMElementOMElement.getXMLStreamReaderWithoutCaching()public void setText(String text)
setText in interface OMElementtext - public String getText()
getText in interface OMElementpublic String getTrimmedText()
public void serialize(OMOutputImpl omOutput)
throws XMLStreamException
serialize in interface OMNodeExserialize in class OMNodeImplomOutput -
XMLStreamExceptionOMNodeImpl.serialize(org.apache.axis2.om.impl.OMOutputImpl)
protected void serialize(OMOutputImpl omOutput,
boolean cache)
throws XMLStreamException
XMLStreamException
public void serializeAndConsume(OMOutputImpl omOutput)
throws XMLStreamException
serializeAndConsume in interface OMNodeExserializeAndConsume in class OMNodeImplomOutput -
XMLStreamExceptionOMNodeImpl.serializeAndConsume(org.apache.axis2.om.impl.OMOutputImpl)public OMElement getFirstElement()
getFirstElement in interface OMElementpublic String getLocalName()
getLocalName in interface OMElementpublic void setLocalName(String localName)
setLocalName in interface OMElementlocalName -
public OMNamespace getNamespace()
throws OMException
getNamespace in interface OMElementOMExceptionpublic void setNamespace(OMNamespace namespace)
setNamespace in interface OMElementnamespace - public QName getQName()
getQName in interface OMElement
public String toStringWithConsume()
throws XMLStreamException
OMElement
toStringWithConsume in interface OMElementXMLStreamExceptionpublic String toString()
OMElement
toString in interface OMElement
public void discard()
throws OMException
discard in interface OMNodeOMExceptionpublic QName resolveQName(String qname)
resolveQName in interface OMElementqname - prefixed qname string to resolve
public OMElement cloneOMElement()
OMElement
cloneOMElement in interface OMElement
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||