org.apache.axiom.om.impl.llom
Class OMTextImpl

java.lang.Object
  extended by org.apache.axiom.om.impl.llom.OMSerializableImpl
      extended by org.apache.axiom.om.impl.llom.OMNodeImpl
          extended by org.apache.axiom.om.impl.llom.OMLeafNode
              extended by org.apache.axiom.om.impl.llom.OMTextImpl
All Implemented Interfaces:
IChildNode, OMNodeEx, OMConstants, OMInformationItem, OMNode, OMSerializable, OMText

public class OMTextImpl
extends OMLeafNode
implements OMText, OMConstants


Field Summary
protected  char[] charArray
           
protected  boolean isBinary
           
protected  java.lang.String mimeType
           
protected  boolean optimize
           
protected  OMNamespace textNS
           
protected  java.lang.String value
           
static OMNamespace XOP_NS
          Field nameSpace used when serializing Binary stuff as MTOM optimized.
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
nextSibling, parent, previousSibling
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
factory
 
Fields inherited from interface org.apache.axiom.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.axiom.om.OMConstants
ARRAY_ITEM_LOCALNAME, ARRAY_ITEM_NS_PREFIX, ARRAY_ITEM_NSURI, ARRAY_ITEM_QNAME, DATA_HANDLER, DEFAULT_CHAR_SET_ENCODING, DEFAULT_DEFAULT_NAMESPACE, DEFAULT_XML_VERSION, IS_BINARY, IS_DATA_HANDLERS_AWARE, PULL_TYPE_BUILDER, PUSH_TYPE_BUILDER, XMLATTRTYPE_CDATA, XMLATTRTYPE_ENTITIES, XMLATTRTYPE_ENTITY, XMLATTRTYPE_ID, XMLATTRTYPE_IDREF, XMLATTRTYPE_IDREFS, XMLATTRTYPE_NMTOKEN, XMLATTRTYPE_NMTOKENS, XMLATTRTYPE_NOTATION, XMLNS_NS_PREFIX, XMLNS_NS_URI, XMLNS_PREFIX, XMLNS_URI
 
Constructor Summary
OMTextImpl(java.lang.Object dataHandler, OMFactory factory)
           
OMTextImpl(OMContainer parent, char[] charArray, int nodeType, OMFactory factory)
           
OMTextImpl(OMContainer parent, java.lang.Object dataHandler, boolean optimize, OMFactory factory, boolean fromBuilder)
           
OMTextImpl(OMContainer parent, OMTextImpl source, OMFactory factory)
          Construct OMTextImpl that is a copy of the source OMTextImpl
OMTextImpl(OMContainer parent, javax.xml.namespace.QName text, int nodeType, OMFactory factory)
           
OMTextImpl(OMContainer parent, javax.xml.namespace.QName text, OMFactory factory)
           
OMTextImpl(OMContainer parent, java.lang.String text, int nodeType, OMFactory factory, boolean fromBuilder)
           
OMTextImpl(OMContainer parent, java.lang.String text, OMFactory factory)
          Constructor OMTextImpl.
OMTextImpl(OMContainer parent, java.lang.String s, java.lang.String mimeType, boolean optimize, OMFactory factory)
           
OMTextImpl(java.lang.String contentID, DataHandlerProvider dataHandlerProvider, boolean optimize, OMFactory factory)
          Constructor.
OMTextImpl(java.lang.String s, int nodeType, OMFactory factory)
           
OMTextImpl(java.lang.String s, OMFactory factory)
          Constructor OMTextImpl.
OMTextImpl(java.lang.String s, java.lang.String mimeType, boolean optimize, OMFactory factory)
           
 
Method Summary
 void buildWithAttachments()
          Parses this node and builds the object structure in memory.
 java.lang.String getContentID()
           
 java.lang.Object getDataHandler()
          Gets the datahandler.
 OMNamespace getNamespace()
           
 java.lang.String getText()
          Returns the value.
 javax.xml.namespace.QName getTextAsQName()
          Returns the value.
 char[] getTextCharacters()
           
 int getType()
           
 void internalSerialize(javax.xml.stream.XMLStreamWriter writer, boolean cache)
          Serializes the node.
 boolean isBinary()
           
 boolean isCharacters()
           
 boolean isOptimized()
           
 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()....
 void setContentID(java.lang.String cid)
           
 void setOptimize(boolean value)
           
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMLeafNode
build, discard, getBuilder, isComplete, setComplete
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
clone, detach, getIParentNode, getNextOMSibling, getNextOMSiblingIfAvailable, getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore, internalSerialize, internalSerializeAndConsume, setNextOMSibling, setParent, setPreviousOMSibling
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
close, getOMFactory, 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
 
Methods inherited from interface org.apache.axiom.om.OMNode
detach, discard, getNextOMSibling, getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume
 
Methods inherited from interface org.apache.axiom.om.OMSerializable
build, close, isComplete, serialize, serialize, serializeAndConsume
 
Methods inherited from interface org.apache.axiom.om.OMInformationItem
clone, getOMFactory
 

Field Detail

XOP_NS

public static final OMNamespace XOP_NS
Field nameSpace used when serializing Binary stuff as MTOM optimized.


value

protected java.lang.String value

charArray

protected char[] charArray

textNS

protected OMNamespace textNS

mimeType

protected java.lang.String mimeType

optimize

protected boolean optimize

isBinary

protected boolean isBinary
Constructor Detail

OMTextImpl

public OMTextImpl(java.lang.String s,
                  OMFactory factory)
Constructor OMTextImpl.

Parameters:
s -

OMTextImpl

public OMTextImpl(java.lang.String s,
                  int nodeType,
                  OMFactory factory)
Parameters:
s -
nodeType - - OMText can handle CHARACTERS, SPACES, CDATA and ENTITY REFERENCES. Constants for this can be found in OMNode.

OMTextImpl

public OMTextImpl(OMContainer parent,
                  java.lang.String text,
                  OMFactory factory)
Constructor OMTextImpl.

Parameters:
parent -
text -

OMTextImpl

public OMTextImpl(OMContainer parent,
                  OMTextImpl source,
                  OMFactory factory)
Construct OMTextImpl that is a copy of the source OMTextImpl

Parameters:
parent -
source - OMTextImpl
factory -

OMTextImpl

public OMTextImpl(OMContainer parent,
                  java.lang.String text,
                  int nodeType,
                  OMFactory factory,
                  boolean fromBuilder)

OMTextImpl

public OMTextImpl(OMContainer parent,
                  char[] charArray,
                  int nodeType,
                  OMFactory factory)

OMTextImpl

public OMTextImpl(OMContainer parent,
                  javax.xml.namespace.QName text,
                  OMFactory factory)

OMTextImpl

public OMTextImpl(OMContainer parent,
                  javax.xml.namespace.QName text,
                  int nodeType,
                  OMFactory factory)

OMTextImpl

public OMTextImpl(java.lang.String s,
                  java.lang.String mimeType,
                  boolean optimize,
                  OMFactory factory)
Parameters:
s - - base64 encoded String representation of Binary
mimeType - of the Binary

OMTextImpl

public OMTextImpl(OMContainer parent,
                  java.lang.String s,
                  java.lang.String mimeType,
                  boolean optimize,
                  OMFactory factory)
Parameters:
parent -
s - - base64 encoded String representation of Binary
mimeType - of the Binary

OMTextImpl

public OMTextImpl(java.lang.Object dataHandler,
                  OMFactory factory)
Parameters:
dataHandler - To send binary optimised content Created programatically.

OMTextImpl

public OMTextImpl(OMContainer parent,
                  java.lang.Object dataHandler,
                  boolean optimize,
                  OMFactory factory,
                  boolean fromBuilder)
Parameters:
dataHandler -
optimize - To send binary content. Created progrmatically.

OMTextImpl

public OMTextImpl(java.lang.String contentID,
                  DataHandlerProvider dataHandlerProvider,
                  boolean optimize,
                  OMFactory factory)
Constructor.

Parameters:
dataHandlerProvider -
optimize -
factory -
Method Detail

getType

public final int getType()
Specified by:
getType in interface OMNode

getText

public java.lang.String getText()
                         throws OMException
Returns the value.

Specified by:
getText in interface OMText
Throws:
OMException

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()
                                         throws OMException
Returns the value.

Specified by:
getTextAsQName in interface OMText
Throws:
OMException

getNamespace

public OMNamespace getNamespace()
Specified by:
getNamespace in interface OMText

isOptimized

public boolean isOptimized()
Specified by:
isOptimized in interface OMText

setOptimize

public void setOptimize(boolean value)
Specified by:
setOptimize 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

isBinary

public boolean isBinary()
Specified by:
isBinary in interface OMText

getDataHandler

public java.lang.Object getDataHandler()
Gets the datahandler.

Specified by:
getDataHandler in interface OMText
Returns:
Returns javax.activation.DataHandler

getContentID

public java.lang.String getContentID()
Specified by:
getContentID in interface OMText

internalSerialize

public void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
                              boolean cache)
                       throws javax.xml.stream.XMLStreamException
Description copied from class: OMSerializableImpl
Serializes the node.

Specified by:
internalSerialize in interface OMNodeEx
Specified by:
internalSerialize in class OMSerializableImpl
Throws:
javax.xml.stream.XMLStreamException

buildWithAttachments

public void buildWithAttachments()
Description copied from class: OMNodeImpl
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 OMNodeImpl

setContentID

public void setContentID(java.lang.String cid)
Specified by:
setContentID in interface OMText


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.