org.apache.axiom.om
Interface OMSerializable

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

public interface OMSerializable
extends OMInformationItem

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:


Method Summary
 void build()
          Builds itself.
 void close(boolean build)
          If a builder and parser is associated with the node, it is closed.
 boolean isComplete()
          Indicates whether parser has parsed this information item completely or not.
 void serialize(XMLStreamWriter xmlWriter)
          Serializes the information item with caching.
 void serialize(XMLStreamWriter xmlWriter, boolean cache)
          Serializes the information item to the given XMLStreamWriter.
 void serializeAndConsume(XMLStreamWriter xmlWriter)
          Serializes the information item without caching.
 
Methods inherited from interface org.apache.axiom.om.OMInformationItem
clone, getOMFactory
 

Method Detail

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 to the given XMLStreamWriter.

The implementation of this method must satisfy the following requirements:

On the other hand, the caller of this method must ensure that the following requirements are satisfied:

Parameters:
xmlWriter -
cache - indicates if caching should be enabled
Throws:
XMLStreamException


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