Interface OMSerializable

All Known Subinterfaces:
OMComment, OMContainer, OMContainerEx, OMDocType, OMDocument, OMElement, OMNode, OMNodeEx, OMProcessingInstruction, OMSourcedElement, OMText, SOAPBody, SOAPEnvelope, SOAPFault, SOAPFaultClassifier, SOAPFaultCode, SOAPFaultDetail, SOAPFaultNode, SOAPFaultReason, SOAPFaultRole, SOAPFaultSubCode, SOAPFaultText, SOAPFaultValue, SOAPHeader, SOAPHeaderBlock, SOAPMessage

public interface OMSerializable
Information item that can be serialized (written to an XML stream writer) and deserialized (retrieved from an XML parser) as a unit. This is the common super-interface for OMDocument and OMNode. Note that OMAttribute and OMNamespace are information items that don't match the definition of this interface because they can only be read from the parser as part of a larger unit, namely an element.

In accordance with the definition given above, this interface declares two sets of methods:

  • Methods allowing to control whether the information item has been completely built, i.e. whether all events corresponding to the information item have been retrieved from the parser.
  • Methods to write the StAX events corresponding to the information item to an XMLStreamWriter.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Builds itself.
    void
    close(boolean build)
    If a builder and parser is associated with the node, it is closed.
    Returns the OMFactory that created this object
    boolean
    Indicates whether parser has parsed this information item completely or not.
    void
    Serializes the information item with caching.
    void
    serialize(XMLStreamWriter xmlWriter, boolean cache)
    Serializes the information item.
    void
    Serializes the information item without caching.
  • Method Details

    • getOMFactory

      OMFactory getOMFactory()
      Returns the OMFactory that created this object
    • isComplete

      boolean isComplete()
      Indicates whether parser has parsed this information item completely or not. If some info are not available in the item, one has to check this attribute to make sure that, this item has been parsed completely or not.
      Returns:
      Returns boolean.
    • build

      void build()
      Builds itself.
    • close

      void close(boolean build)
      If a builder and parser is associated with the node, it is closed.
      Parameters:
      build - if true, the object is built first before closing the builder/parser
    • serialize

      void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException
      Serializes the information item with caching. This method has the same effect as serialize(XMLStreamWriter, boolean) with cache set to true.
      Parameters:
      xmlWriter -
      Throws:
      XMLStreamException
    • serializeAndConsume

      void serializeAndConsume(XMLStreamWriter xmlWriter) throws XMLStreamException
      Serializes the information item without caching. This method has the same effect as serialize(XMLStreamWriter, boolean) with cache set to false.
      Parameters:
      xmlWriter -
      Throws:
      XMLStreamException
    • serialize

      void serialize(XMLStreamWriter xmlWriter, boolean cache) throws XMLStreamException
      Serializes the information item.
      Parameters:
      xmlWriter -
      cache - indicates if caching should be enabled
      Throws:
      XMLStreamException