Class 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 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 - OMTextImpl
        factory -
      • 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 Binary
        mimeType - 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 Binary
        mimeType - 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:
        getText in interface org.apache.axiom.om.OMText
        Throws:
        org.apache.axiom.om.OMException
      • getTextCharacters

        public char[] getTextCharacters()
        Specified by:
        getTextCharacters in interface org.apache.axiom.om.OMText
      • isCharacters

        public boolean isCharacters()
        Specified by:
        isCharacters in interface org.apache.axiom.om.OMText
      • getTextAsQName

        public QName getTextAsQName()
                             throws org.apache.axiom.om.OMException
        Returns the value.
        Specified by:
        getTextAsQName in interface org.apache.axiom.om.OMText
        Throws:
        org.apache.axiom.om.OMException
      • getNamespace

        public org.apache.axiom.om.OMNamespace getNamespace()
        Specified by:
        getNamespace in interface org.apache.axiom.om.OMText
      • isOptimized

        public boolean isOptimized()
        Specified by:
        isOptimized in interface org.apache.axiom.om.OMText
      • setOptimize

        public void setOptimize​(boolean value)
        Specified by:
        setOptimize in interface org.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:
        setBinary in interface org.apache.axiom.om.OMText
      • isBinary

        public boolean isBinary()
        Specified by:
        isBinary in interface org.apache.axiom.om.OMText
      • getDataHandler

        public Object getDataHandler()
        Gets the datahandler.
        Specified by:
        getDataHandler in interface org.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:
        getContentID in interface org.apache.axiom.om.OMText
      • discard

        public void discard()
                     throws org.apache.axiom.om.OMException
        A slightly different implementation of the discard method.
        Specified by:
        discard in interface org.apache.axiom.om.OMNode
        Throws:
        org.apache.axiom.om.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 org.apache.axiom.om.OMNode
        Overrides:
        buildWithAttachments in class OMNodeImpl
      • setContentID

        public void setContentID​(String cid)
        Specified by:
        setContentID in interface org.apache.axiom.om.OMText