Package org.apache.axiom.om.impl.llom
Class OMNodeImpl
- java.lang.Object
-
- org.apache.axiom.om.impl.llom.OMSerializableImpl
-
- org.apache.axiom.om.impl.llom.OMNodeImpl
-
- All Implemented Interfaces:
org.apache.axiom.om.impl.OMNodeEx,org.apache.axiom.om.OMNode,org.apache.axiom.om.OMSerializable
- Direct Known Subclasses:
OMCommentImpl,OMDocTypeImpl,OMElementImpl,OMProcessingInstructionImpl,OMTextImpl
public abstract class OMNodeImpl extends OMSerializableImpl implements org.apache.axiom.om.OMNode, org.apache.axiom.om.impl.OMNodeEx
Class OMNodeImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected OMNodeImplnextSiblingField nextSiblingprotected intnodeTypeField nodeTypeprotected org.apache.axiom.om.impl.OMContainerExparentField parentprotected OMNodeImplpreviousSiblingField previousSibling-
Fields inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
builder, done, factory
-
-
Constructor Summary
Constructors Constructor Description OMNodeImpl(org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory, boolean done)For a node to exist there must be a parent.OMNodeImpl(org.apache.axiom.om.OMFactory factory)Constructor OMNodeImpl
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildWithAttachments()Parses this node and builds the object structure in memory.org.apache.axiom.om.OMNodedetach()Removes this information item and its children, from the model completely.org.apache.axiom.om.OMNodegetNextOMSibling()Returns the next sibling.org.apache.axiom.om.OMNodegetNextOMSiblingIfAvailable()org.apache.axiom.om.OMContainergetParent()Returns the immediate parent of the node.org.apache.axiom.om.OMNodegetPreviousOMSibling()Gets the previous sibling.intgetType()Gets the type of node, as this is the super class of all the nodes.protected org.apache.axiom.om.OMNodeimportNode(org.apache.axiom.om.OMNode child)This method is intended only to be used by Axiom intenals when merging Objects from different Axiom implementations to the LLOM implementation.voidinsertSiblingAfter(org.apache.axiom.om.OMNode sibling)Inserts a sibling just after the current information item.voidinsertSiblingBefore(org.apache.axiom.om.OMNode sibling)Inserts a sibling just before the current information item.voidinternalSerialize(XMLStreamWriter writer)voidinternalSerializeAndConsume(XMLStreamWriter writer)voidsetComplete(boolean state)Method setComplete.voidsetNextOMSibling(org.apache.axiom.om.OMNode node)Method setNextOMSibling.voidsetParent(org.apache.axiom.om.OMContainer element)Method setParent.voidsetPreviousOMSibling(org.apache.axiom.om.OMNode previousSibling)Method setPreviousOMSibling.voidsetType(int nodeType)Method setType.-
Methods inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
build, close, getOMFactory, internalSerialize, isComplete, serialize, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
parent
protected org.apache.axiom.om.impl.OMContainerEx parent
Field parent
-
nextSibling
protected OMNodeImpl nextSibling
Field nextSibling
-
previousSibling
protected OMNodeImpl previousSibling
Field previousSibling
-
nodeType
protected int nodeType
Field nodeType
-
-
Constructor Detail
-
OMNodeImpl
public OMNodeImpl(org.apache.axiom.om.OMFactory factory)
Constructor OMNodeImpl- Parameters:
factory- TheOMFactorythat created this
-
OMNodeImpl
public OMNodeImpl(org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory, boolean done)For a node to exist there must be a parent.- Parameters:
parent- ParentOMContainerof this nodefactory- TheOMFactorythat created this
-
-
Method Detail
-
getParent
public org.apache.axiom.om.OMContainer getParent()
Returns the immediate parent of the node. Parent is always an Element.- Specified by:
getParentin interfaceorg.apache.axiom.om.OMNode- Returns:
- Returns OMContainer.
- Throws:
org.apache.axiom.om.OMException
-
setParent
public void setParent(org.apache.axiom.om.OMContainer element)
Method setParent.- Specified by:
setParentin interfaceorg.apache.axiom.om.impl.OMNodeEx- Parameters:
element-
-
getNextOMSibling
public org.apache.axiom.om.OMNode getNextOMSibling() throws org.apache.axiom.om.OMExceptionReturns the next sibling. This can be an OMAttribute or OMText or OMElement for others.- Specified by:
getNextOMSiblingin interfaceorg.apache.axiom.om.OMNode- Returns:
- Returns OMNode.
- Throws:
org.apache.axiom.om.OMException
-
getNextOMSiblingIfAvailable
public org.apache.axiom.om.OMNode getNextOMSiblingIfAvailable()
- Specified by:
getNextOMSiblingIfAvailablein interfaceorg.apache.axiom.om.impl.OMNodeEx
-
setNextOMSibling
public void setNextOMSibling(org.apache.axiom.om.OMNode node)
Method setNextOMSibling.- Specified by:
setNextOMSiblingin interfaceorg.apache.axiom.om.impl.OMNodeEx- Parameters:
node-
-
setComplete
public void setComplete(boolean state)
Method setComplete.- Specified by:
setCompletein interfaceorg.apache.axiom.om.impl.OMNodeEx- Specified by:
setCompletein classOMSerializableImpl- Parameters:
state-
-
detach
public org.apache.axiom.om.OMNode detach() throws org.apache.axiom.om.OMExceptionRemoves this information item and its children, from the model completely.- Specified by:
detachin interfaceorg.apache.axiom.om.OMNode- Throws:
org.apache.axiom.om.OMException
-
insertSiblingAfter
public void insertSiblingAfter(org.apache.axiom.om.OMNode sibling) throws org.apache.axiom.om.OMExceptionInserts a sibling just after the current information item.- Specified by:
insertSiblingAfterin interfaceorg.apache.axiom.om.OMNode- Parameters:
sibling-- Throws:
org.apache.axiom.om.OMException
-
insertSiblingBefore
public void insertSiblingBefore(org.apache.axiom.om.OMNode sibling) throws org.apache.axiom.om.OMExceptionInserts a sibling just before the current information item.- Specified by:
insertSiblingBeforein interfaceorg.apache.axiom.om.OMNode- Parameters:
sibling-- Throws:
org.apache.axiom.om.OMException
-
getType
public int getType()
Gets the type of node, as this is the super class of all the nodes.- Specified by:
getTypein interfaceorg.apache.axiom.om.OMNode- Returns:
- Returns the type of node as indicated by
setType(int) - See Also:
setType(int)
-
setType
public void setType(int nodeType) throws org.apache.axiom.om.OMExceptionMethod setType.- Specified by:
setTypein interfaceorg.apache.axiom.om.impl.OMNodeEx- Parameters:
nodeType-- Throws:
org.apache.axiom.om.OMException
-
getPreviousOMSibling
public org.apache.axiom.om.OMNode getPreviousOMSibling()
Gets the previous sibling.- Specified by:
getPreviousOMSiblingin interfaceorg.apache.axiom.om.OMNode- Returns:
- boolean
-
setPreviousOMSibling
public void setPreviousOMSibling(org.apache.axiom.om.OMNode previousSibling)
Method setPreviousOMSibling.- Specified by:
setPreviousOMSiblingin interfaceorg.apache.axiom.om.impl.OMNodeEx- Parameters:
previousSibling-
-
buildWithAttachments
public void buildWithAttachments()
Parses this node and builds the object structure in memory. AXIOM supports two levels of deffered building. First is deffered building of AXIOM using StAX. Second level is the deffered building of attachments. AXIOM reads in the attachements from the stream only when user asks by calling getDataHandler(). build() method builds the OM without the attachments. buildAll() builds the OM together with attachement data. This becomes handy when user wants to free the input stream.- Specified by:
buildWithAttachmentsin interfaceorg.apache.axiom.om.OMNode
-
importNode
protected org.apache.axiom.om.OMNode importNode(org.apache.axiom.om.OMNode child)
This method is intended only to be used by Axiom intenals when merging Objects from different Axiom implementations to the LLOM implementation.- Parameters:
child-
-
internalSerialize
public void internalSerialize(XMLStreamWriter writer) throws XMLStreamException
- Specified by:
internalSerializein interfaceorg.apache.axiom.om.impl.OMNodeEx- Throws:
XMLStreamException
-
internalSerializeAndConsume
public void internalSerializeAndConsume(XMLStreamWriter writer) throws XMLStreamException
- Specified by:
internalSerializeAndConsumein interfaceorg.apache.axiom.om.impl.OMNodeEx- Throws:
XMLStreamException
-
-