Package org.apache.axiom.om.impl.llom
Class OMTextImpl
- java.lang.Object
-
- org.apache.axiom.om.impl.llom.OMSerializableImpl
-
- org.apache.axiom.om.impl.llom.OMNodeImpl
-
- org.apache.axiom.om.impl.llom.OMTextImpl
-
- All Implemented Interfaces:
org.apache.axiom.om.impl.OMNodeEx,org.apache.axiom.om.OMConstants,org.apache.axiom.om.OMNode,org.apache.axiom.om.OMSerializable,org.apache.axiom.om.OMText
public class OMTextImpl extends OMNodeImpl implements org.apache.axiom.om.OMText, org.apache.axiom.om.OMConstants
-
-
Field Summary
Fields Modifier and Type Field Description protected char[]charArrayprotected booleanisBinaryprotected StringmimeTypeprotected booleanoptimizeprotected org.apache.axiom.om.OMNamespacetextNSprotected Stringvaluestatic org.apache.axiom.om.OMNamespaceXOP_NSField nameSpace used when serializing Binary stuff as MTOM optimized.-
Fields inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
nextSibling, nodeType, parent, previousSibling
-
Fields inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
builder, done, factory
-
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
Constructors Constructor Description OMTextImpl(Object dataHandler, boolean optimize, org.apache.axiom.om.OMFactory factory)OMTextImpl(Object dataHandler, org.apache.axiom.om.OMFactory factory)OMTextImpl(String s, int nodeType, org.apache.axiom.om.OMFactory factory)OMTextImpl(String s, String mimeType, boolean optimize, org.apache.axiom.om.OMFactory factory)OMTextImpl(String contentID, org.apache.axiom.ext.stax.datahandler.DataHandlerProvider dataHandlerProvider, boolean optimize, org.apache.axiom.om.OMFactory factory)Constructor.OMTextImpl(String contentID, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMXMLParserWrapper builder, org.apache.axiom.om.OMFactory factory)OMTextImpl(String s, org.apache.axiom.om.OMFactory factory)Constructor OMTextImpl.OMTextImpl(org.apache.axiom.om.OMContainer parent, char[] charArray, int nodeType, org.apache.axiom.om.OMFactory factory)OMTextImpl(org.apache.axiom.om.OMContainer parent, String text, int nodeType, org.apache.axiom.om.OMFactory factory)OMTextImpl(org.apache.axiom.om.OMContainer parent, String s, String mimeType, boolean optimize, org.apache.axiom.om.OMFactory factory)OMTextImpl(org.apache.axiom.om.OMContainer parent, String text, org.apache.axiom.om.OMFactory factory)Constructor OMTextImpl.OMTextImpl(org.apache.axiom.om.OMContainer parent, QName text, int nodeType, org.apache.axiom.om.OMFactory factory)OMTextImpl(org.apache.axiom.om.OMContainer parent, QName text, org.apache.axiom.om.OMFactory factory)OMTextImpl(org.apache.axiom.om.OMContainer parent, OMTextImpl source, org.apache.axiom.om.OMFactory factory)Construct OMTextImpl that is a copy of the source OMTextImpl
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildWithAttachments()Parses this node and builds the object structure in memory.voiddiscard()A slightly different implementation of the discard method.StringgetContentID()ObjectgetDataHandler()Gets the datahandler.InputStreamgetInputStream()org.apache.axiom.om.OMNamespacegetNamespace()StringgetText()Returns the value.QNamegetTextAsQName()Returns the value.char[]getTextCharacters()voidinternalSerialize(XMLStreamWriter writer, boolean cache)Serializes the node.booleanisBinary()booleanisCharacters()booleanisOptimized()voidsetBinary(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()....voidsetContentID(String cid)voidsetOptimize(boolean value)-
Methods inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
detach, getNextOMSibling, getNextOMSiblingIfAvailable, getParent, getPreviousOMSibling, getType, importNode, insertSiblingAfter, insertSiblingBefore, internalSerialize, internalSerializeAndConsume, setComplete, setNextOMSibling, setParent, setPreviousOMSibling, setType
-
Methods inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
build, close, getOMFactory, isComplete, 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
-
-
-
-
Field Detail
-
XOP_NS
public static final org.apache.axiom.om.OMNamespace XOP_NS
Field nameSpace used when serializing Binary stuff as MTOM optimized.
-
value
protected String value
-
charArray
protected char[] charArray
-
textNS
protected org.apache.axiom.om.OMNamespace textNS
-
mimeType
protected String mimeType
-
optimize
protected boolean optimize
-
isBinary
protected boolean isBinary
-
-
Constructor Detail
-
OMTextImpl
public OMTextImpl(String s, org.apache.axiom.om.OMFactory factory)
Constructor OMTextImpl.- Parameters:
s-
-
OMTextImpl
public OMTextImpl(String s, int nodeType, org.apache.axiom.om.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(org.apache.axiom.om.OMContainer parent, String text, org.apache.axiom.om.OMFactory factory)Constructor OMTextImpl.- Parameters:
parent-text-
-
OMTextImpl
public OMTextImpl(org.apache.axiom.om.OMContainer parent, OMTextImpl source, org.apache.axiom.om.OMFactory factory)Construct OMTextImpl that is a copy of the source OMTextImpl- Parameters:
parent-source- OMTextImplfactory-
-
OMTextImpl
public OMTextImpl(org.apache.axiom.om.OMContainer parent, String text, int nodeType, org.apache.axiom.om.OMFactory factory)
-
OMTextImpl
public OMTextImpl(org.apache.axiom.om.OMContainer parent, char[] charArray, int nodeType, org.apache.axiom.om.OMFactory factory)
-
OMTextImpl
public OMTextImpl(org.apache.axiom.om.OMContainer parent, QName text, org.apache.axiom.om.OMFactory factory)
-
OMTextImpl
public OMTextImpl(org.apache.axiom.om.OMContainer parent, QName text, int nodeType, org.apache.axiom.om.OMFactory factory)
-
OMTextImpl
public OMTextImpl(String s, String mimeType, boolean optimize, org.apache.axiom.om.OMFactory factory)
- Parameters:
s- - base64 encoded String representation of BinarymimeType- of the Binary
-
OMTextImpl
public OMTextImpl(org.apache.axiom.om.OMContainer parent, String s, String mimeType, boolean optimize, org.apache.axiom.om.OMFactory factory)- Parameters:
parent-s- - base64 encoded String representation of BinarymimeType- of the Binary
-
OMTextImpl
public OMTextImpl(Object dataHandler, org.apache.axiom.om.OMFactory factory)
- Parameters:
dataHandler- To send binary optimised content Created programatically.
-
OMTextImpl
public OMTextImpl(Object dataHandler, boolean optimize, org.apache.axiom.om.OMFactory factory)
- Parameters:
dataHandler-optimize- To send binary content. Created progrmatically.
-
OMTextImpl
public OMTextImpl(String contentID, org.apache.axiom.ext.stax.datahandler.DataHandlerProvider dataHandlerProvider, boolean optimize, org.apache.axiom.om.OMFactory factory)
Constructor.- Parameters:
dataHandlerProvider-optimize-factory-
-
OMTextImpl
public OMTextImpl(String contentID, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMXMLParserWrapper builder, org.apache.axiom.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 deferred parsing of MIME messages.
-
-
Method Detail
-
getText
public String getText() throws org.apache.axiom.om.OMException
Returns the value.- Specified by:
getTextin interfaceorg.apache.axiom.om.OMText- Throws:
org.apache.axiom.om.OMException
-
getTextCharacters
public char[] getTextCharacters()
- Specified by:
getTextCharactersin interfaceorg.apache.axiom.om.OMText
-
isCharacters
public boolean isCharacters()
- Specified by:
isCharactersin interfaceorg.apache.axiom.om.OMText
-
getTextAsQName
public QName getTextAsQName() throws org.apache.axiom.om.OMException
Returns the value.- Specified by:
getTextAsQNamein interfaceorg.apache.axiom.om.OMText- Throws:
org.apache.axiom.om.OMException
-
getNamespace
public org.apache.axiom.om.OMNamespace getNamespace()
- Specified by:
getNamespacein interfaceorg.apache.axiom.om.OMText
-
isOptimized
public boolean isOptimized()
- Specified by:
isOptimizedin interfaceorg.apache.axiom.om.OMText
-
setOptimize
public void setOptimize(boolean value)
- Specified by:
setOptimizein interfaceorg.apache.axiom.om.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:
setBinaryin interfaceorg.apache.axiom.om.OMText
-
isBinary
public boolean isBinary()
- Specified by:
isBinaryin interfaceorg.apache.axiom.om.OMText
-
getDataHandler
public Object getDataHandler()
Gets the datahandler.- Specified by:
getDataHandlerin interfaceorg.apache.axiom.om.OMText- Returns:
- Returns javax.activation.DataHandler
-
getInputStream
public InputStream getInputStream() throws org.apache.axiom.om.OMException
- Throws:
org.apache.axiom.om.OMException
-
getContentID
public String getContentID()
- Specified by:
getContentIDin interfaceorg.apache.axiom.om.OMText
-
internalSerialize
public void internalSerialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException
Description copied from class:OMSerializableImplSerializes the node.- Specified by:
internalSerializein interfaceorg.apache.axiom.om.impl.OMNodeEx- Specified by:
internalSerializein classOMSerializableImpl- Throws:
XMLStreamException
-
discard
public void discard() throws org.apache.axiom.om.OMExceptionA slightly different implementation of the discard method.- Specified by:
discardin interfaceorg.apache.axiom.om.OMNode- Throws:
org.apache.axiom.om.OMException
-
buildWithAttachments
public void buildWithAttachments()
Description copied from class:OMNodeImplParses 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:
buildWithAttachmentsin interfaceorg.apache.axiom.om.OMNode- Overrides:
buildWithAttachmentsin classOMNodeImpl
-
setContentID
public void setContentID(String cid)
- Specified by:
setContentIDin interfaceorg.apache.axiom.om.OMText
-
-