org.apache.axis2.om.impl.dom
Class TextImpl

java.lang.Object
  extended byorg.apache.axis2.om.impl.dom.NodeImpl
      extended byorg.apache.axis2.om.impl.dom.ChildNode
          extended byorg.apache.axis2.om.impl.dom.CharacterImpl
              extended byorg.apache.axis2.om.impl.dom.TextImpl
All Implemented Interfaces:
CharacterData, Cloneable, Node, NodeList, OMNode, OMNodeEx, OMText, Text

public class TextImpl
extends CharacterImpl
implements Text, OMText


Field Summary
protected  OMAttribute attribute
          Field attribute is used when serializing Binary stuff as MTOM optimized.
protected  String localName
          Field localName is used when serializing Binary stuff as MTOM optimized.
protected  OMNamespace ns
          Field nameSpace is used when serializing Binary stuff as MTOM optimized.
 
Fields inherited from class org.apache.axis2.om.impl.dom.CharacterImpl
textValue
 
Fields inherited from class org.apache.axis2.om.impl.dom.ChildNode
nextSibling, parentNode, previousSibling
 
Fields inherited from class org.apache.axis2.om.impl.dom.NodeImpl
builder, done, FIRSTCHILD, flags, nodeType, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
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
 
Constructor Summary
TextImpl(DocumentImpl ownerNode)
           
TextImpl(DocumentImpl ownerNode, String value)
           
TextImpl(DocumentImpl ownerNode, String value, String mimeType, boolean optimize)
           
TextImpl(Object dataHandler, boolean optimize)
           
TextImpl(String text)
          Creates a text node with the given text required by the OMDOMFactory.
TextImpl(String contentID, OMElement parent, OMXMLParserWrapper builder)
           
TextImpl(String text, String mimeType, boolean optimize)
           
TextImpl(String text, String mimeType, boolean optimize, boolean isBinary)
           
 
Method Summary
 Node cloneNode(boolean deep)
           
 void discard()
          Discards a node.
 String getContentID()
          Gets the content id.
 Object getDataHandler()
          Gets the datahandler.
 InputStream getInputStream()
           
 String getNodeName()
           
 short getNodeType()
           
 String getNodeValue()
           
 String getText()
          Returns the text value of this node.
 int getType()
          Returns the type of node.
 String getWholeText()
           
 boolean isElementContentWhitespace()
           
 boolean isOptimized()
           
 Text replaceWholeText(String arg0)
           
 void serialize(OMOutputImpl omOutput)
          Serializes the node with caching.
 void serializeAndConsume(OMOutputImpl omOutput)
          Serializes the node without caching.
 void setOptimize(boolean value)
          Sets the optimize flag.
 void setType(int nodeType)
           
 Text splitText(int offset)
          Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings.
 String toString()
           
 
Methods inherited from class org.apache.axis2.om.impl.dom.CharacterImpl
appendData, deleteData, getData, getLength, insertData, replaceData, setData, substringData
 
Methods inherited from class org.apache.axis2.om.impl.dom.ChildNode
detach, getNextOMSibling, getNextSibling, getParent, getParentNode, getPreviousOMSibling, getPreviousSibling, insertSiblingAfter, insertSiblingBefore, setNextOMSibling, setParent, setPreviousOMSibling
 
Methods inherited from class org.apache.axis2.om.impl.dom.NodeImpl
appendChild, build, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getOwnerDocument, getPrefix, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isComplete, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeWithCache, 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, getData, getLength, insertData, replaceData, setData, substringData
 
Methods inherited from interface org.w3c.dom.Node
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 
Methods inherited from interface org.apache.axis2.om.OMNode
build, detach, getNextOMSibling, getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore, isComplete, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume
 

Field Detail

ns

protected OMNamespace ns
Field nameSpace is used when serializing Binary stuff as MTOM optimized.


localName

protected String localName
Field localName is used when serializing Binary stuff as MTOM optimized.


attribute

protected OMAttribute attribute
Field attribute is used when serializing Binary stuff as MTOM optimized.

Constructor Detail

TextImpl

public TextImpl(String text)
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 -

TextImpl

public TextImpl(String contentID,
                OMElement parent,
                OMXMLParserWrapper builder)
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

TextImpl

public TextImpl(String text,
                String mimeType,
                boolean optimize)

TextImpl

public TextImpl(String text,
                String mimeType,
                boolean optimize,
                boolean isBinary)

TextImpl

public TextImpl(Object dataHandler,
                boolean optimize)
Parameters:
dataHandler -
optimize - To send binary content. Created progrmatically.

TextImpl

public TextImpl(DocumentImpl ownerNode)
Parameters:
ownerNode -

TextImpl

public TextImpl(DocumentImpl ownerNode,
                String value)
Parameters:
ownerNode -
value -

TextImpl

public TextImpl(DocumentImpl ownerNode,
                String value,
                String mimeType,
                boolean optimize)
Parameters:
ownerNode -
value -
Method Detail

splitText

public Text splitText(int offset)
               throws 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 Text
Throws:
DOMException

getNodeName

public String getNodeName()
Specified by:
getNodeName in interface Node

getNodeType

public short getNodeType()
Specified by:
getNodeType in interface Node

getType

public int getType()
            throws OMException
Description copied from interface: OMNode
Returns the type of node.

Specified by:
getType in interface OMNode
Returns:
Returns one of OMNode.ELEMENT_NODE, OMNode.TEXT_NODE, OMNode.CDATA_SECTION_NODE, OMNode.COMMENT_NODE, OMNode.DTD_NODE, OMNode.PI_NODE, OMNode.ENTITY_REFERENCE_NODE, OMNode.SPACE_NODE, or OMNode.TEXT_NODE.
Throws:
OMException

setType

public void setType(int nodeType)
             throws OMException
Specified by:
setType in interface OMNodeEx
Throws:
OMException

serialize

public void serialize(OMOutputImpl omOutput)
               throws XMLStreamException
Description copied from interface: OMNodeEx
Serializes the node with caching.

Specified by:
serialize in interface OMNodeEx
Parameters:
omOutput -
Throws:
XMLStreamException
See Also:
OMNodeEx.serialize(org.apache.axis2.om.impl.OMOutputImpl)

serializeAndConsume

public void serializeAndConsume(OMOutputImpl omOutput)
                         throws XMLStreamException
Description copied from interface: OMNodeEx
Serializes the node without caching.

Specified by:
serializeAndConsume in interface OMNodeEx
Parameters:
omOutput -
Throws:
XMLStreamException

isOptimized

public boolean isOptimized()
Specified by:
isOptimized in interface OMText
Returns:
Returns boolean flag saying whether the node contains an optimized text or not.

setOptimize

public void setOptimize(boolean value)
Description copied from interface: OMText
Sets the optimize flag.

Specified by:
setOptimize in interface OMText
Parameters:
value -

discard

public void discard()
             throws OMException
Description copied from interface: OMNode
Discards a node.

Discard goes to the parser level and if the element is not completely built, then it will be completely skipped at the parser level.

Specified by:
discard in interface OMNode
Overrides:
discard in class ChildNode
Throws:
OMException

getText

public String getText()
Description copied from interface: OMText
Returns the text value of this node.

Specified by:
getText in interface OMText
Returns:
Returns String.

getNodeValue

public String getNodeValue()
                    throws DOMException
Specified by:
getNodeValue in interface Node
Overrides:
getNodeValue in class NodeImpl
Throws:
DOMException

getContentID

public String getContentID()
Description copied from interface: OMText
Gets the content id.

Specified by:
getContentID in interface OMText
Returns:
Returns String.

getDataHandler

public Object getDataHandler()
Description copied from interface: OMText
Gets the datahandler.

Specified by:
getDataHandler in interface OMText
Returns:
Returns datahandler.

getInputStream

public InputStream getInputStream()
                           throws OMException
Throws:
OMException

cloneNode

public Node cloneNode(boolean deep)
Specified by:
cloneNode in interface Node
Overrides:
cloneNode in class ChildNode

getWholeText

public String getWholeText()

isElementContentWhitespace

public boolean isElementContentWhitespace()

replaceWholeText

public Text replaceWholeText(String arg0)
                      throws DOMException
Throws:
DOMException

toString

public String toString()