org.apache.axiom.om.impl.util
Class OMSerializerUtil

java.lang.Object
  extended by org.apache.axiom.om.impl.util.OMSerializerUtil

public class OMSerializerUtil
extends Object


Constructor Summary
OMSerializerUtil()
           
 
Method Summary
static String generateSetPrefix(String prefix, String namespace, XMLStreamWriter writer, boolean attr)
          Generate setPrefix/setDefaultNamespace if the prefix is not associated
static String getNextNSPrefix()
          Get the next prefix name
static String getNextNSPrefix(XMLStreamWriter writer)
           
static boolean isAssociated(String prefix, String namespace, XMLStreamWriter writer)
           
static boolean isSetPrefixBeforeStartElement(XMLStreamWriter writer)
          Deprecated. This method was used to work around a StAX conformance issue in early versions of the XL XP-J parser. This is now handled by StAXDialect, and this method always returns false.
static void serializeAttribute(OMAttribute attr, XMLStreamWriter writer)
          Deprecated. use serializeStartpart instead
static void serializeAttributes(OMElement element, XMLStreamWriter writer)
          Deprecated. Consider using serializeStartpart instead
static void serializeByPullStream(OMElement element, XMLStreamWriter writer)
           
static void serializeByPullStream(OMElement element, XMLStreamWriter writer, boolean cache)
           
static void serializeChildren(OMContainer container, XMLStreamWriter writer, boolean cache)
           
static void serializeEndpart(XMLStreamWriter writer)
          Method serializeEndpart.
static void serializeNamespace(OMNamespace namespace, XMLStreamWriter writer)
          Deprecated. Use serializeStartpart instead
static void serializeNamespaces(OMElement element, XMLStreamWriter writer)
          Deprecated. Use serializeStartpart instead
static void serializeNormal(OMElement element, XMLStreamWriter writer, boolean cache)
          Method serializeNormal.
static void serializeStartpart(OMElement element, String localName, XMLStreamWriter writer)
          Method serializeStartpart.
static void serializeStartpart(OMElement element, XMLStreamWriter writer)
          Method serializeStartpart.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OMSerializerUtil

public OMSerializerUtil()
Method Detail

serializeEndpart

public static void serializeEndpart(XMLStreamWriter writer)
                             throws XMLStreamException
Method serializeEndpart.

Parameters:
writer -
Throws:
XMLStreamException

serializeAttribute

public static void serializeAttribute(OMAttribute attr,
                                      XMLStreamWriter writer)
                               throws XMLStreamException
Deprecated. use serializeStartpart instead

Method serializeAttribute.

Parameters:
attr -
writer -
Throws:
XMLStreamException

serializeNamespace

public static void serializeNamespace(OMNamespace namespace,
                                      XMLStreamWriter writer)
                               throws XMLStreamException
Deprecated. Use serializeStartpart instead

Method serializeNamespace.

Parameters:
namespace -
writer -
Throws:
XMLStreamException

isSetPrefixBeforeStartElement

public static boolean isSetPrefixBeforeStartElement(XMLStreamWriter writer)
Deprecated. This method was used to work around a StAX conformance issue in early versions of the XL XP-J parser. This is now handled by StAXDialect, and this method always returns false.


serializeStartpart

public static void serializeStartpart(OMElement element,
                                      XMLStreamWriter writer)
                               throws XMLStreamException
Method serializeStartpart. Serialize the start tag of an element.

Parameters:
element -
writer -
Throws:
XMLStreamException

serializeStartpart

public static void serializeStartpart(OMElement element,
                                      String localName,
                                      XMLStreamWriter writer)
                               throws XMLStreamException
Method serializeStartpart. Serialize the start tag of an element.

Parameters:
element -
localName - (in some cases, the caller wants to force a different localName)
writer -
Throws:
XMLStreamException

serializeNamespaces

public static void serializeNamespaces(OMElement element,
                                       XMLStreamWriter writer)
                                throws XMLStreamException
Deprecated. Use serializeStartpart instead

serializeNamespaces

Parameters:
element -
writer -
Throws:
XMLStreamException

serializeAttributes

public static void serializeAttributes(OMElement element,
                                       XMLStreamWriter writer)
                                throws XMLStreamException
Deprecated. Consider using serializeStartpart instead

Serialize attributes

Parameters:
element -
writer -
Throws:
XMLStreamException

serializeNormal

public static void serializeNormal(OMElement element,
                                   XMLStreamWriter writer,
                                   boolean cache)
                            throws XMLStreamException
Method serializeNormal.

Parameters:
writer -
cache -
Throws:
XMLStreamException

serializeByPullStream

public static void serializeByPullStream(OMElement element,
                                         XMLStreamWriter writer)
                                  throws XMLStreamException
Throws:
XMLStreamException

serializeByPullStream

public static void serializeByPullStream(OMElement element,
                                         XMLStreamWriter writer,
                                         boolean cache)
                                  throws XMLStreamException
Throws:
XMLStreamException

serializeChildren

public static void serializeChildren(OMContainer container,
                                     XMLStreamWriter writer,
                                     boolean cache)
                              throws XMLStreamException
Throws:
XMLStreamException

getNextNSPrefix

public static String getNextNSPrefix()
Get the next prefix name

Returns:
next prefix name

getNextNSPrefix

public static String getNextNSPrefix(XMLStreamWriter writer)

generateSetPrefix

public static String generateSetPrefix(String prefix,
                                       String namespace,
                                       XMLStreamWriter writer,
                                       boolean attr)
                                throws XMLStreamException
Generate setPrefix/setDefaultNamespace if the prefix is not associated

Parameters:
prefix -
namespace -
writer -
attr -
Returns:
prefix name if a setPrefix/setDefaultNamespace is performed
Throws:
XMLStreamException

isAssociated

public static boolean isAssociated(String prefix,
                                   String namespace,
                                   XMLStreamWriter writer)
                            throws XMLStreamException
Parameters:
prefix -
namespace -
writer -
Returns:
true if the prefix is associated with the namespace in the current context
Throws:
XMLStreamException


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