org.apache.axiom.om.impl.dom
Class TextNodeImpl
java.lang.Object
org.apache.axiom.om.impl.dom.NodeImpl
org.apache.axiom.om.impl.dom.ChildNode
org.apache.axiom.om.impl.dom.CharacterImpl
org.apache.axiom.om.impl.dom.TextNodeImpl
- All Implemented Interfaces:
- java.lang.Cloneable, OMNodeEx, OMNode, OMSerializable, OMText, org.w3c.dom.CharacterData, org.w3c.dom.Node, org.w3c.dom.NodeList, org.w3c.dom.Text
- Direct Known Subclasses:
- CDATASectionImpl, TextImpl
public abstract class TextNodeImpl
- extends CharacterImpl
- implements org.w3c.dom.Text, OMText
| Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
|
Constructor Summary |
TextNodeImpl(DocumentImpl ownerNode,
char[] value,
OMFactory factory)
|
TextNodeImpl(DocumentImpl ownerNode,
java.lang.Object dataHandler,
boolean optimize,
OMFactory factory)
|
TextNodeImpl(DocumentImpl ownerNode,
OMFactory factory)
|
TextNodeImpl(DocumentImpl ownerNode,
java.lang.String contentID,
DataHandlerProvider dataHandlerProvider,
boolean optimize,
OMFactory factory)
Constructor. |
TextNodeImpl(DocumentImpl ownerNode,
java.lang.String value,
OMFactory factory)
|
TextNodeImpl(DocumentImpl ownerNode,
java.lang.String value,
java.lang.String mimeType,
boolean optimize,
OMFactory factory)
|
TextNodeImpl(OMContainer parent,
javax.xml.namespace.QName text,
int nodeType,
OMFactory factory)
|
TextNodeImpl(OMContainer parent,
javax.xml.namespace.QName text,
OMFactory factory)
|
TextNodeImpl(OMContainer parent,
TextNodeImpl source,
OMFactory factory)
Construct TextImpl that is a copy of the source OMTextImpl |
TextNodeImpl(java.lang.String contentID,
OMContainer parent,
OMXMLParserWrapper builder,
OMFactory factory)
|
TextNodeImpl(java.lang.String text,
OMFactory factory)
Creates a text node with the given text required by the OMDOMFactory. |
TextNodeImpl(java.lang.String text,
java.lang.String mimeType,
boolean optimize,
boolean isBinary,
OMFactory factory)
|
TextNodeImpl(java.lang.String text,
java.lang.String mimeType,
boolean optimize,
OMFactory factory)
|
| Methods inherited from class org.apache.axiom.om.impl.dom.ChildNode |
cloneNode, detach, getNextOMSibling, getNextOMSiblingIfAvailable, getNextSibling, getParent, getParentNode, getPreviousOMSibling, getPreviousSibling, insertSiblingAfter, insertSiblingBefore, setNextOMSibling, setParent, setPreviousOMSibling |
| Methods inherited from class org.apache.axiom.om.impl.dom.NodeImpl |
appendChild, build, close, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getOMFactory, getOwnerDocument, getPrefix, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, internalSerialize, internalSerializeAndConsume, isComplete, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, serialize, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete, setNodeValue, setOwnerDocument, setPrefix, setTextContent, setUserData |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.w3c.dom.CharacterData |
appendData, deleteData, getLength, insertData, replaceData, setData, substringData |
| Methods inherited from interface org.w3c.dom.Node |
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
| Methods inherited from interface org.apache.axiom.om.OMNode |
detach, getNextOMSibling, getParent, getPreviousOMSibling, getType, insertSiblingAfter, insertSiblingBefore, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume |
textNS
protected OMNamespace textNS
charArray
protected char[] charArray
TextNodeImpl
public TextNodeImpl(java.lang.String text,
OMFactory factory)
- Creates a text node with the given text required by the OMDOMFactory. The owner document
should be set properly when appending this to a DOM tree.
- Parameters:
text -
TextNodeImpl
public TextNodeImpl(java.lang.String contentID,
OMContainer parent,
OMXMLParserWrapper builder,
OMFactory factory)
- Parameters:
contentID - parent - builder - Used when the builder is encountered with a XOP:Include tag Stores a
reference to the builder and the content-id. Supports deffered parsing of
MIME messages
TextNodeImpl
public TextNodeImpl(OMContainer parent,
TextNodeImpl source,
OMFactory factory)
- Construct TextImpl that is a copy of the source OMTextImpl
- Parameters:
parent - source - TextImplfactory -
TextNodeImpl
public TextNodeImpl(java.lang.String text,
java.lang.String mimeType,
boolean optimize,
OMFactory factory)
TextNodeImpl
public TextNodeImpl(java.lang.String text,
java.lang.String mimeType,
boolean optimize,
boolean isBinary,
OMFactory factory)
TextNodeImpl
public TextNodeImpl(DocumentImpl ownerNode,
java.lang.Object dataHandler,
boolean optimize,
OMFactory factory)
- Parameters:
dataHandler - optimize - To send binary content. Created progrmatically.
TextNodeImpl
public TextNodeImpl(DocumentImpl ownerNode,
java.lang.String contentID,
DataHandlerProvider dataHandlerProvider,
boolean optimize,
OMFactory factory)
- Constructor.
- Parameters:
contentID - dataHandlerProvider - optimize - factory -
TextNodeImpl
public TextNodeImpl(DocumentImpl ownerNode,
OMFactory factory)
- Parameters:
ownerNode -
TextNodeImpl
public TextNodeImpl(DocumentImpl ownerNode,
java.lang.String value,
OMFactory factory)
- Parameters:
ownerNode - value -
TextNodeImpl
public TextNodeImpl(DocumentImpl ownerNode,
char[] value,
OMFactory factory)
TextNodeImpl
public TextNodeImpl(DocumentImpl ownerNode,
java.lang.String value,
java.lang.String mimeType,
boolean optimize,
OMFactory factory)
- Parameters:
ownerNode - value -
TextNodeImpl
public TextNodeImpl(OMContainer parent,
javax.xml.namespace.QName text,
OMFactory factory)
TextNodeImpl
public TextNodeImpl(OMContainer parent,
javax.xml.namespace.QName text,
int nodeType,
OMFactory factory)
splitText
public org.w3c.dom.Text splitText(int offset)
throws org.w3c.dom.DOMException
- Breaks this node into two nodes at the specified offset, keeping both in the tree as
siblings. After being split, this node will contain all the content up to the offset point. A
new node of the same type, which contains all the content at and after the offset point, is
returned. If the original node had a parent node, the new node is inserted as the next
sibling of the original node. When the offset is equal to the length of this node, the new
node has no data.
- Specified by:
splitText in interface org.w3c.dom.Text
- Throws:
org.w3c.dom.DOMException
getNodeName
public java.lang.String getNodeName()
- Specified by:
getNodeName in interface org.w3c.dom.Node
getNodeType
public short getNodeType()
- Specified by:
getNodeType in interface org.w3c.dom.Node
isOptimized
public boolean isOptimized()
- Specified by:
isOptimized in interface OMText
setOptimize
public void setOptimize(boolean value)
- Specified by:
setOptimize in interface OMText
discard
public void discard()
throws OMException
- Specified by:
discard in interface OMNode- Overrides:
discard in class ChildNode
- Throws:
OMException
getText
public java.lang.String getText()
- Specified by:
getText in interface OMText
getData
public java.lang.String getData()
throws org.w3c.dom.DOMException
- Description copied from class:
CharacterImpl
- Returns the value of the data.
- Specified by:
getData in interface org.w3c.dom.CharacterData- Overrides:
getData in class CharacterImpl
- Throws:
org.w3c.dom.DOMException
getTextCharacters
public char[] getTextCharacters()
- Specified by:
getTextCharacters in interface OMText
isCharacters
public boolean isCharacters()
- Specified by:
isCharacters in interface OMText
getTextAsQName
public javax.xml.namespace.QName getTextAsQName()
- Specified by:
getTextAsQName in interface OMText
getNodeValue
public java.lang.String getNodeValue()
throws org.w3c.dom.DOMException
- Specified by:
getNodeValue in interface org.w3c.dom.Node- Overrides:
getNodeValue in class NodeImpl
- Throws:
org.w3c.dom.DOMException
getContentID
public java.lang.String getContentID()
- Specified by:
getContentID in interface OMText
getDataHandler
public java.lang.Object getDataHandler()
- Specified by:
getDataHandler in interface OMText
getInputStream
public java.io.InputStream getInputStream()
throws OMException
- Throws:
OMException
internalSerialize
public void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
boolean cache)
throws javax.xml.stream.XMLStreamException
- Specified by:
internalSerialize in interface OMNodeEx
- Throws:
javax.xml.stream.XMLStreamException
getWholeText
public java.lang.String getWholeText()
- Specified by:
getWholeText in interface org.w3c.dom.Text
isElementContentWhitespace
public boolean isElementContentWhitespace()
- Specified by:
isElementContentWhitespace in interface org.w3c.dom.Text
replaceWholeText
public org.w3c.dom.Text replaceWholeText(java.lang.String arg0)
throws org.w3c.dom.DOMException
- Specified by:
replaceWholeText in interface org.w3c.dom.Text
- Throws:
org.w3c.dom.DOMException
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
buildWithAttachments
public void buildWithAttachments()
- Description copied from class:
NodeImpl
- 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:
buildWithAttachments in interface OMNode- Overrides:
buildWithAttachments in class NodeImpl
isBinary
public boolean isBinary()
- Specified by:
isBinary in interface OMText
setBinary
public void setBinary(boolean value)
- Receiving binary can happen as either MTOM attachments or as Base64 Text In the case of Base64
user has to explicitly specify that the content is binary, before calling getDataHandler(),
getInputStream()....
- Specified by:
setBinary in interface OMText
getNamespace
public OMNamespace getNamespace()
- Specified by:
getNamespace in interface OMText
setContentID
public void setContentID(java.lang.String cid)
- Specified by:
setContentID in interface OMText
Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.