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

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

public class OMTextImpl
extends OMNodeImpl
implements OMText, OMConstants


Field Summary
protected  OMAttribute attribute
          Field attributes used when serializing Binary stuff as MTOM optimized.
protected  char[] charArray
           
protected  boolean isBinary
           
protected  String localName
          Field localName used when serializing Binary stuff as MTOM optimized.
protected  String mimeType
           
protected  boolean optimize
           
protected  OMNamespace textNS
           
protected  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
builder, done, factory, nextSibling, nodeType, parent, previousSibling
 
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(Object dataHandler, boolean optimize, OMFactory factory)
           
OMTextImpl(Object dataHandler, OMFactory factory)
           
OMTextImpl(OMContainer parent, char[] charArray, int nodeType, OMFactory factory)
           
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, String text, int nodeType, OMFactory factory)
           
OMTextImpl(OMContainer parent, String text, OMFactory factory)
          Constructor OMTextImpl.
OMTextImpl(OMContainer parent, String s, String mimeType, boolean optimize, OMFactory factory)
           
OMTextImpl(String s, int nodeType, OMFactory factory)
           
OMTextImpl(String contentID, OMContainer parent, OMXMLParserWrapper builder, OMFactory factory)
           
OMTextImpl(String s, OMFactory factory)
          Constructor OMTextImpl.
OMTextImpl(String s, String mimeType, boolean optimize, OMFactory factory)
           
 
Method Summary
 void buildWithAttachments()
          Parses this node and builds the object structure in memory.
 void discard()
          A slightly different implementation of the discard method.
 String getContentID()
          Gets the content id.
 Object getDataHandler()
          Gets the datahandler.
 InputStream getInputStream()
           
 String getLocalName()
           
 OMNamespace getNamespace()
          Returns the Namespace if this contains a QName Return null otherwise
 String getText()
          Returns the value.
 javax.xml.namespace.QName getTextAsQName()
          Returns the value.
 char[] getTextCharacters()
           
 void internalSerialize(javax.xml.stream.XMLStreamWriter writer)
          Serializes the node with caching.
 void internalSerializeAndConsume(javax.xml.stream.XMLStreamWriter writer)
          Serializes the node without caching.
 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(String cid)
          Set a specific content id
 void setOptimize(boolean value)
          Sets the optimize flag.
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
build, close, detach, getNextOMSibling, getOMFactory, getParent, getPreviousOMSibling, getType, importNode, insertSiblingAfter, insertSiblingBefore, isComplete, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete, setNextOMSibling, setParent, setPreviousOMSibling, setType
 
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
build, close, detach, getNextOMSibling, getOMFactory, getParent, getPreviousOMSibling, getType, insertSiblingAfter, insertSiblingBefore, isComplete, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume
 

Field Detail

XOP_NS

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


value

protected String value

charArray

protected char[] charArray

textNS

protected OMNamespace textNS

mimeType

protected String mimeType

optimize

protected boolean optimize

isBinary

protected boolean isBinary

localName

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


attribute

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

Constructor Detail

OMTextImpl

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

Parameters:
s -

OMTextImpl

public OMTextImpl(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,
                  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,
                  String text,
                  int nodeType,
                  OMFactory factory)

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(String s,
                  String mimeType,
                  boolean optimize,
                  OMFactory factory)
Parameters:
s - - base64 encoded String representation of Binary
mimeType - of the Binary

OMTextImpl

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

OMTextImpl

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

OMTextImpl

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

OMTextImpl

public OMTextImpl(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 deferred parsing of MIME messages.
Method Detail

internalSerialize

public void internalSerialize(javax.xml.stream.XMLStreamWriter writer)
                       throws javax.xml.stream.XMLStreamException
Description copied from class: OMNodeImpl
Serializes the node with caching.

Specified by:
internalSerialize in interface OMNodeEx
Overrides:
internalSerialize in class OMNodeImpl
Parameters:
writer -
Throws:
javax.xml.stream.XMLStreamException

getText

public String getText()
               throws OMException
Returns the value.

Specified by:
getText in interface OMText
Returns:
Returns String.
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()
Description copied from interface: OMText
Returns the Namespace if this contains a QName Return null otherwise

Specified by:
getNamespace in interface OMText
Returns:
OMNamespace

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 - true to optimize binary content (usually w/MTOM)

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
Parameters:
value - true if the content is binary

isBinary

public boolean isBinary()
Specified by:
isBinary in interface OMText
Returns:
Returns boolean flag saying whether the node contains binary or not.

getDataHandler

public Object getDataHandler()
Gets the datahandler.

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

getLocalName

public String getLocalName()

getInputStream

public InputStream getInputStream()
                           throws OMException
Throws:
OMException

getContentID

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

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

internalSerializeAndConsume

public void internalSerializeAndConsume(javax.xml.stream.XMLStreamWriter writer)
                                 throws javax.xml.stream.XMLStreamException
Description copied from class: OMNodeImpl
Serializes the node without caching.

Specified by:
internalSerializeAndConsume in interface OMNodeEx
Overrides:
internalSerializeAndConsume in class OMNodeImpl
Throws:
javax.xml.stream.XMLStreamException

discard

public void discard()
             throws OMException
A slightly different implementation of the discard method.

Specified by:
discard in interface OMNode
Throws:
OMException

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(String cid)
Description copied from interface: OMText
Set a specific content id

Specified by:
setContentID in interface OMText


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