javax.xml.stream
Class XMLEventFactory

java.lang.Object
  extended by javax.xml.stream.XMLEventFactory

public abstract class XMLEventFactory
extends Object

Factory for XML events.


Constructor Summary
protected XMLEventFactory()
           
 
Method Summary
abstract  Attribute createAttribute(QName name, String value)
          Create an attribute event.
abstract  Attribute createAttribute(String localName, String value)
          Create an attribute event.
abstract  Attribute createAttribute(String prefix, String namespaceURI, String localName, String value)
          Create an attribute event.
abstract  Characters createCData(String content)
          Create a text event of type CDATA section.
abstract  Characters createCharacters(String content)
          Create a text event.
abstract  Comment createComment(String text)
          Create a comment event.
abstract  DTD createDTD(String dtd)
          Create a DOCTYPE declaration event.
abstract  EndDocument createEndDocument()
          Create an end-document event.
abstract  EndElement createEndElement(QName name, Iterator namespaces)
          Create an end-element event.
abstract  EndElement createEndElement(String prefix, String namespaceUri, String localName)
          Create an end-element event.
abstract  EndElement createEndElement(String prefix, String namespaceUri, String localName, Iterator namespaces)
          Create an end-element event.
abstract  EntityReference createEntityReference(String name, EntityDeclaration declaration)
          Create an entity reference event.
abstract  Characters createIgnorableSpace(String content)
          Create a text event of type ignorable whitespace.
abstract  Namespace createNamespace(String namespaceURI)
          Create a namespace declaration event.
abstract  Namespace createNamespace(String prefix, String namespaceUri)
          Create a namespace declaration event.
abstract  ProcessingInstruction createProcessingInstruction(String target, String data)
          Create a processing instruction event.
abstract  Characters createSpace(String content)
          Create a text event of type whitespace.
abstract  StartDocument createStartDocument()
          Create a start-document event.
abstract  StartDocument createStartDocument(String encoding)
          Create a start-document event.
abstract  StartDocument createStartDocument(String encoding, String version)
          Create a start-document event.
abstract  StartDocument createStartDocument(String encoding, String version, boolean standalone)
          Create a start-document event.
abstract  StartElement createStartElement(QName name, Iterator attributes, Iterator namespaces)
          Create a start-element event.
abstract  StartElement createStartElement(String prefix, String namespaceUri, String localName)
          Create a start-element event.
abstract  StartElement createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces)
          Create a start-element event.
abstract  StartElement createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces, NamespaceContext context)
          Create a start-element event.
static XMLEventFactory newInstance()
          Create a new factory instance.
static XMLEventFactory newInstance(String factoryId, ClassLoader classLoader)
          Create a new factory instance.
abstract  void setLocation(Location location)
          Sets the location for each event created by this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLEventFactory

protected XMLEventFactory()
Method Detail

newInstance

public static XMLEventFactory newInstance()
                                   throws FactoryConfigurationError
Create a new factory instance.

Throws:
FactoryConfigurationError
See Also:
newInstance(String,ClassLoader)

newInstance

public static XMLEventFactory newInstance(String factoryId,
                                          ClassLoader classLoader)
                                   throws FactoryConfigurationError
Create a new factory instance. The implementation class to load is the first found in the following locations:
  1. the javax.xml.stream.XMLEventFactory system property
  2. the above named property value in the $JAVA_HOME/lib/stax.properties file
  3. the class name specified in the META-INF/services/javax.xml.stream.XMLEventFactory system resource
  4. the default factory class

Parameters:
factoryId - name of the factory to find, same as a property name
classLoader - the class loader to use
Returns:
the factory implementation
Throws:
FactoryConfigurationError - if an instance of this factory cannot be loaded

setLocation

public abstract void setLocation(Location location)
Sets the location for each event created by this factory.


createAttribute

public abstract Attribute createAttribute(String prefix,
                                          String namespaceURI,
                                          String localName,
                                          String value)
Create an attribute event.


createAttribute

public abstract Attribute createAttribute(String localName,
                                          String value)
Create an attribute event.


createAttribute

public abstract Attribute createAttribute(QName name,
                                          String value)
Create an attribute event.


createNamespace

public abstract Namespace createNamespace(String namespaceURI)
Create a namespace declaration event.


createNamespace

public abstract Namespace createNamespace(String prefix,
                                          String namespaceUri)
Create a namespace declaration event.


createStartElement

public abstract StartElement createStartElement(QName name,
                                                Iterator attributes,
                                                Iterator namespaces)
Create a start-element event.


createStartElement

public abstract StartElement createStartElement(String prefix,
                                                String namespaceUri,
                                                String localName)
Create a start-element event.


createStartElement

public abstract StartElement createStartElement(String prefix,
                                                String namespaceUri,
                                                String localName,
                                                Iterator attributes,
                                                Iterator namespaces)
Create a start-element event.


createStartElement

public abstract StartElement createStartElement(String prefix,
                                                String namespaceUri,
                                                String localName,
                                                Iterator attributes,
                                                Iterator namespaces,
                                                NamespaceContext context)
Create a start-element event.


createEndElement

public abstract EndElement createEndElement(QName name,
                                            Iterator namespaces)
Create an end-element event.


createEndElement

public abstract EndElement createEndElement(String prefix,
                                            String namespaceUri,
                                            String localName)
Create an end-element event.


createEndElement

public abstract EndElement createEndElement(String prefix,
                                            String namespaceUri,
                                            String localName,
                                            Iterator namespaces)
Create an end-element event.


createCharacters

public abstract Characters createCharacters(String content)
Create a text event.


createCData

public abstract Characters createCData(String content)
Create a text event of type CDATA section.


createSpace

public abstract Characters createSpace(String content)
Create a text event of type whitespace.


createIgnorableSpace

public abstract Characters createIgnorableSpace(String content)
Create a text event of type ignorable whitespace.


createStartDocument

public abstract StartDocument createStartDocument()
Create a start-document event.


createStartDocument

public abstract StartDocument createStartDocument(String encoding,
                                                  String version,
                                                  boolean standalone)
Create a start-document event.


createStartDocument

public abstract StartDocument createStartDocument(String encoding,
                                                  String version)
Create a start-document event.


createStartDocument

public abstract StartDocument createStartDocument(String encoding)
Create a start-document event.


createEndDocument

public abstract EndDocument createEndDocument()
Create an end-document event.


createEntityReference

public abstract EntityReference createEntityReference(String name,
                                                      EntityDeclaration declaration)
Create an entity reference event.


createComment

public abstract Comment createComment(String text)
Create a comment event.


createProcessingInstruction

public abstract ProcessingInstruction createProcessingInstruction(String target,
                                                                  String data)
Create a processing instruction event.


createDTD

public abstract DTD createDTD(String dtd)
Create a DOCTYPE declaration event.