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, org.apache.ws.commons.om.OMNode, org.apache.ws.commons.om.impl.OMNodeEx, org.apache.ws.commons.om.OMText, Text

public class TextImpl
extends CharacterImpl
implements Text, org.apache.ws.commons.om.OMText


Field Summary
protected  org.apache.ws.commons.om.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  org.apache.ws.commons.om.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, factory, 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.ws.commons.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, org.apache.ws.commons.om.OMFactory factory)
           
TextImpl(DocumentImpl ownerNode, String value, org.apache.ws.commons.om.OMFactory factory)
           
TextImpl(DocumentImpl ownerNode, String value, String mimeType, boolean optimize, org.apache.ws.commons.om.OMFactory factory)
           
TextImpl(Object dataHandler, boolean optimize, org.apache.ws.commons.om.OMFactory factory)
           
TextImpl(String contentID, org.apache.ws.commons.om.OMElement parent, org.apache.ws.commons.om.OMXMLParserWrapper builder, org.apache.ws.commons.om.OMFactory factory)
           
TextImpl(String text, org.apache.ws.commons.om.OMFactory factory)
          Creates a text node with the given text required by the OMDOMFactory.
TextImpl(String text, String mimeType, boolean optimize, boolean isBinary, org.apache.ws.commons.om.OMFactory factory)
           
TextImpl(String text, String mimeType, boolean optimize, org.apache.ws.commons.om.OMFactory factory)
           
 
Method Summary
 Node cloneNode(boolean deep)
           
 void discard()
           
 String getContentID()
           
 Object getDataHandler()
           
 InputStream getInputStream()
           
 String getNodeName()
           
 short getNodeType()
           
 String getNodeValue()
           
 String getText()
           
 int getType()
           
 String getWholeText()
           
 boolean isElementContentWhitespace()
           
 boolean isOptimized()
           
 Text replaceWholeText(String arg0)
           
 void serialize(org.apache.ws.commons.om.impl.OMOutputImpl omOutput)
           
 void serializeAndConsume(org.apache.ws.commons.om.impl.OMOutputImpl omOutput)
           
 void setOptimize(boolean value)
           
 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, getOMFactory, 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.ws.commons.om.OMNode
build, detach, getNextOMSibling, getOMFactory, getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore, isComplete, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume
 

Field Detail

ns

protected org.apache.ws.commons.om.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 org.apache.ws.commons.om.OMAttribute attribute
Field attribute is used when serializing Binary stuff as MTOM optimized.

Constructor Detail

TextImpl

public TextImpl(String text,
                org.apache.ws.commons.om.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 -

TextImpl

public TextImpl(String contentID,
                org.apache.ws.commons.om.OMElement parent,
                org.apache.ws.commons.om.OMXMLParserWrapper builder,
                org.apache.ws.commons.om.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

TextImpl

public TextImpl(String text,
                String mimeType,
                boolean optimize,
                org.apache.ws.commons.om.OMFactory factory)

TextImpl

public TextImpl(String text,
                String mimeType,
                boolean optimize,
                boolean isBinary,
                org.apache.ws.commons.om.OMFactory factory)

TextImpl

public TextImpl(Object dataHandler,
                boolean optimize,
                org.apache.ws.commons.om.OMFactory factory)
Parameters:
dataHandler -
optimize - To send binary content. Created progrmatically.

TextImpl

public TextImpl(DocumentImpl ownerNode,
                org.apache.ws.commons.om.OMFactory factory)
Parameters:
ownerNode -

TextImpl

public TextImpl(DocumentImpl ownerNode,
                String value,
                org.apache.ws.commons.om.OMFactory factory)
Parameters:
ownerNode -
value -

TextImpl

public TextImpl(DocumentImpl ownerNode,
                String value,
                String mimeType,
                boolean optimize,
                org.apache.ws.commons.om.OMFactory factory)
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 org.apache.ws.commons.om.OMException
Specified by:
getType in interface org.apache.ws.commons.om.OMNode
Throws:
org.apache.ws.commons.om.OMException

setType

public void setType(int nodeType)
             throws org.apache.ws.commons.om.OMException
Specified by:
setType in interface org.apache.ws.commons.om.impl.OMNodeEx
Throws:
org.apache.ws.commons.om.OMException

serialize

public void serialize(org.apache.ws.commons.om.impl.OMOutputImpl omOutput)
               throws XMLStreamException
Specified by:
serialize in interface org.apache.ws.commons.om.impl.OMNodeEx
Throws:
XMLStreamException

serializeAndConsume

public void serializeAndConsume(org.apache.ws.commons.om.impl.OMOutputImpl omOutput)
                         throws XMLStreamException
Specified by:
serializeAndConsume in interface org.apache.ws.commons.om.impl.OMNodeEx
Throws:
XMLStreamException

isOptimized

public boolean isOptimized()
Specified by:
isOptimized in interface org.apache.ws.commons.om.OMText

setOptimize

public void setOptimize(boolean value)
Specified by:
setOptimize in interface org.apache.ws.commons.om.OMText

discard

public void discard()
             throws org.apache.ws.commons.om.OMException
Specified by:
discard in interface org.apache.ws.commons.om.OMNode
Overrides:
discard in class ChildNode
Throws:
org.apache.ws.commons.om.OMException

getText

public String getText()
Specified by:
getText in interface org.apache.ws.commons.om.OMText

getNodeValue

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

getContentID

public String getContentID()
Specified by:
getContentID in interface org.apache.ws.commons.om.OMText

getDataHandler

public Object getDataHandler()
Specified by:
getDataHandler in interface org.apache.ws.commons.om.OMText

getInputStream

public InputStream getInputStream()
                           throws org.apache.ws.commons.om.OMException
Throws:
org.apache.ws.commons.om.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()