org.apache.axiom.om.util
Class StAXUtils

java.lang.Object
  extended by org.apache.axiom.om.util.StAXUtils

public class StAXUtils
extends java.lang.Object


Constructor Summary
StAXUtils()
           
 
Method Summary
static javax.xml.stream.XMLStreamReader createNetworkDetachedXMLStreamReader(java.io.InputStream in)
          Create an XMLStreamReader that will operate when detached from a network.
static javax.xml.stream.XMLStreamReader createNetworkDetachedXMLStreamReader(java.io.InputStream in, java.lang.String encoding)
          Create an XMLStreamReader that will operate when detached from a network.
static javax.xml.stream.XMLStreamReader createNetworkDetachedXMLStreamReader(java.io.Reader in)
          Create an XMLStreamReader that will operate when detached from a network.
static javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.InputStream in)
           
static javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.InputStream in, java.lang.String encoding)
           
static javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.Reader in)
           
static javax.xml.stream.XMLStreamWriter createXMLStreamWriter(java.io.OutputStream out)
           
static javax.xml.stream.XMLStreamWriter createXMLStreamWriter(java.io.OutputStream out, java.lang.String encoding)
           
static javax.xml.stream.XMLStreamWriter createXMLStreamWriter(java.io.Writer out)
           
static javax.xml.stream.XMLInputFactory getNetworkDetachedXMLInputFactory()
          Gets an XMLInputFactory instance from pool.
static javax.xml.stream.XMLInputFactory getXMLInputFactory()
          Gets an XMLInputFactory instance from pool.
static javax.xml.stream.XMLInputFactory getXMLInputFactory(boolean factoryPerClassLoaderPolicy)
          Get XMLInputFactory
static javax.xml.stream.XMLOutputFactory getXMLOutputFactory_perClassLoader()
           
static javax.xml.stream.XMLOutputFactory getXMLOutputFactory_singleton()
           
static javax.xml.stream.XMLOutputFactory getXMLOutputFactory()
          Gets an XMLOutputFactory instance from pool.
static javax.xml.stream.XMLOutputFactory getXMLOutputFactory(boolean factoryPerClassLoaderPolicy)
          Get XMLOutputFactory
static void releaseXMLInputFactory(javax.xml.stream.XMLInputFactory factory)
          Deprecated. Returns an XMLInputFactory instance for reuse.
static void releaseXMLOutputFactory(javax.xml.stream.XMLOutputFactory factory)
          Deprecated. Returns an XMLOutputFactory instance for reuse.
static void reset()
          Deprecated.  
static void setFactoryPerClassLoader(boolean value)
          Set the policy for how to maintain the XMLInputFactory and XMLOutputFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StAXUtils

public StAXUtils()
Method Detail

getXMLInputFactory

public static javax.xml.stream.XMLInputFactory getXMLInputFactory()
Gets an XMLInputFactory instance from pool.

Returns:
an XMLInputFactory instance.

getXMLInputFactory

public static javax.xml.stream.XMLInputFactory getXMLInputFactory(boolean factoryPerClassLoaderPolicy)
Get XMLInputFactory

Parameters:
factoryPerClassLoaderPolicy - (if true, then factory using current classloader. if false, then factory using the classloader that loaded StAXUtils)
Returns:
XMLInputFactory

releaseXMLInputFactory

public static void releaseXMLInputFactory(javax.xml.stream.XMLInputFactory factory)
Deprecated. Returns an XMLInputFactory instance for reuse.

Parameters:
factory - An XMLInputFactory instance that is available for reuse

createXMLStreamReader

public static javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.InputStream in,
                                                                     java.lang.String encoding)
                                                              throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

createXMLStreamReader

public static javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.InputStream in)
                                                              throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

createXMLStreamReader

public static javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.Reader in)
                                                              throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

getXMLOutputFactory

public static javax.xml.stream.XMLOutputFactory getXMLOutputFactory()
Gets an XMLOutputFactory instance from pool.

Returns:
an XMLOutputFactory instance.

getXMLOutputFactory

public static javax.xml.stream.XMLOutputFactory getXMLOutputFactory(boolean factoryPerClassLoaderPolicy)
Get XMLOutputFactory

Parameters:
factoryPerClassLoaderPolicy - (if true, then factory using current classloader. if false, then factory using the classloader that loaded StAXUtils)
Returns:
XMLInputFactory

setFactoryPerClassLoader

public static void setFactoryPerClassLoader(boolean value)
Set the policy for how to maintain the XMLInputFactory and XMLOutputFactory

Parameters:
value - (if false, then one singleton...if true...then singleton per class loader (default is true)

releaseXMLOutputFactory

public static void releaseXMLOutputFactory(javax.xml.stream.XMLOutputFactory factory)
Deprecated. Returns an XMLOutputFactory instance for reuse.

Parameters:
factory - An XMLOutputFactory instance that is available for reuse.

createXMLStreamWriter

public static javax.xml.stream.XMLStreamWriter createXMLStreamWriter(java.io.OutputStream out)
                                                              throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

createXMLStreamWriter

public static javax.xml.stream.XMLStreamWriter createXMLStreamWriter(java.io.OutputStream out,
                                                                     java.lang.String encoding)
                                                              throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

createXMLStreamWriter

public static javax.xml.stream.XMLStreamWriter createXMLStreamWriter(java.io.Writer out)
                                                              throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

reset

public static void reset()
Deprecated. 


getXMLOutputFactory_perClassLoader

public static javax.xml.stream.XMLOutputFactory getXMLOutputFactory_perClassLoader()
Returns:
XMLOutputFactory for the current classloader

getXMLOutputFactory_singleton

public static javax.xml.stream.XMLOutputFactory getXMLOutputFactory_singleton()
Returns:
XMLOutputFactory singleton loaded with the StAXUtils classloader

createNetworkDetachedXMLStreamReader

public static javax.xml.stream.XMLStreamReader createNetworkDetachedXMLStreamReader(java.io.InputStream in,
                                                                                    java.lang.String encoding)
                                                                             throws javax.xml.stream.XMLStreamException
Create an XMLStreamReader that will operate when detached from a network. The XMLStreamReader is created from a OMInputFactory that has external entities disabled. This kind of XMLStreamReader is useful for reading deployment information.

Parameters:
in -
encoding -
Returns:
Throws:
javax.xml.stream.XMLStreamException

getNetworkDetachedXMLInputFactory

public static javax.xml.stream.XMLInputFactory getNetworkDetachedXMLInputFactory()
Gets an XMLInputFactory instance from pool.

Returns:
an XMLInputFactory instance.

createNetworkDetachedXMLStreamReader

public static javax.xml.stream.XMLStreamReader createNetworkDetachedXMLStreamReader(java.io.InputStream in)
                                                                             throws javax.xml.stream.XMLStreamException
Create an XMLStreamReader that will operate when detached from a network. The XMLStreamReader is created from a OMInputFactory that has external entities disabled. This kind of XMLStreamReader is useful for reading deployment information.

Parameters:
in -
Returns:
Throws:
javax.xml.stream.XMLStreamException

createNetworkDetachedXMLStreamReader

public static javax.xml.stream.XMLStreamReader createNetworkDetachedXMLStreamReader(java.io.Reader in)
                                                                             throws javax.xml.stream.XMLStreamException
Create an XMLStreamReader that will operate when detached from a network. The XMLStreamReader is created from a OMInputFactory that has external entities disabled. This kind of XMLStreamReader is useful for reading deployment information.

Parameters:
in -
Returns:
Throws:
javax.xml.stream.XMLStreamException


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