public abstract class XMLEventFactory extends Object
StartElement,
EndElement,
ProcessingInstruction,
Comment,
Characters,
StartDocument,
EndDocument,
DTD
| Modifier | Constructor and Description |
|---|---|
protected |
XMLEventFactory()
|
| Modifier and Type | Method and Description |
|---|---|
abstract Attribute |
createAttribute(QName
Create a new Attribute
|
abstract Attribute |
createAttribute(String
Create a new Attribute
|
abstract Attribute |
createAttribute(String
Create a new Attribute
|
abstract Characters |
createCData(String
Create a Characters event with the CData flag set to true
|
abstract Characters |
createCharacters(String
Create a Characters event, this method does not check if the content is all whitespace.
|
abstract Comment |
createComment(String
Create a comment
|
abstract DTD |
createDTD(String
Create a document type definition event This string contains the entire document type declaration that matches the doctypedecl in the XML 1.0 specification
|
abstract EndDocument |
createEndDocument()
Creates a new instance of an EndDocument event
|
abstract EndElement |
createEndElement(QName
Create a new EndElement
|
abstract EndElement |
createEndElement(String
Create a new EndElement
|
abstract EndElement |
createEndElement(String
Create a new EndElement
|
abstract EntityReference |
createEntityReference(String
Creates a new instance of a EntityReference event
|
abstract Characters |
createIgnorableSpace(String
Create an ignorable space
|
abstract Namespace |
createNamespace(String
Create a new default Namespace
|
abstract Namespace |
createNamespace(String
Create a new Namespace
|
abstract ProcessingInstruction |
createProcessingInstruction(String
Create a processing instruction
|
abstract Characters |
createSpace(String
Create a Characters event with the isSpace flag set to true
|
abstract StartDocument |
createStartDocument()
Creates a new instance of a StartDocument event
|
abstract StartDocument |
createStartDocument(String
Creates a new instance of a StartDocument event
|
abstract StartDocument |
createStartDocument(String
Creates a new instance of a StartDocument event
|
abstract StartDocument |
createStartDocument(String
Creates a new instance of a StartDocument event
|
abstract StartElement |
createStartElement(QName
Create a new StartElement.
|
abstract StartElement |
createStartElement(String
Create a new StartElement.
|
abstract StartElement |
createStartElement(String
Create a new StartElement.
|
abstract StartElement |
createStartElement(String
Create a new StartElement.
|
static XMLEventFactory |
newFactory()
Create a new instance of the factory.
|
static XMLEventFactory |
newFactory(String
Create a new instance of the factory.
|
static XMLEventFactory |
newInstance()
Creates a new instance of the factory in exactly the same manner as the
newFactory() method.
|
static XMLEventFactory |
newInstance(String
Deprecated.
This method has been deprecated to maintain API consistency. All newInstance methods have been replaced with corresponding newFactory methods. The replacement
newFactory(java.lang.String, java.lang.ClassLoader) method defines no changes in behavior.
|
abstract void |
setLocation(Location
This method allows setting of the Location on each event that is created by this factory.
|
public static XMLEventFactorynewInstance() throws FactoryConfigurationError
newFactory() method.
FactoryConfigurationError - if an instance of this factory cannot be loaded
public static XMLEventFactorynewFactory() throws FactoryConfigurationError
This static method creates a new factory instance. This method uses the following ordered lookup procedure to determine the XMLEventFactory implementation class to load:
ServiceLoader class, to attempt to locate and load an implementation of the service using the default loading mechanism: the service-provider loading facility will use the current thread's context class loader to attempt to load the service. If the context class loader is null, the system class loader will be used. Once an application has obtained a reference to a XMLEventFactory it can use the factory to configure and obtain stream instances.
Note that this is a new method that replaces the deprecated newInstance() method. No changes in behavior are defined by this replacement method relative to the deprecated method.
FactoryConfigurationError - in case of
service configuration error or if the implementation is not available or cannot be instantiated.
public static XMLEventFactorynewInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError
newFactory(java.lang.String, java.lang.ClassLoader) method defines no changes in behavior.
factoryId - Name of the factory to find, same as a property name
classLoader - classLoader to use
FactoryConfigurationError - if an instance of this factory cannot be loaded
public static XMLEventFactorynewFactory(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError
This method uses the following ordered lookup procedure to determine the XMLEventFactory implementation class to load:
factoryId. factoryId. factoryId is "javax.xml.stream.XMLEventFactory", use the service-provider loading facilities, defined by the ServiceLoader class, to attempt to locate and load an implementation of the service using the specified ClassLoader. If classLoader is null, the default loading mechanism will apply: That is, the service-provider loading facility will use the current thread's context class loader to attempt to load the service. If the context class loader is null, the system class loader will be used. FactoryConfigurationError. Note that this is a new method that replaces the deprecated newInstance(String factoryId, ClassLoader classLoader) method. No changes in behavior are defined by this replacement method relative to the deprecated method.
factoryId - Name of the factory to find, same as a property name
classLoader - classLoader to use
FactoryConfigurationError - in case of
service configuration error or if the implementation is not available or cannot be instantiated.
public abstract void setLocation(Locationlocation)
location - the location to set on each event created
public abstract AttributecreateAttribute(String prefix, String namespaceURI, String localName, String value)
prefix - the prefix of this attribute, may not be null
namespaceURI - the attribute value is set to this value, may not be null
localName - the local name of the XML name of the attribute, localName cannot be null
value - the attribute value to set, may not be null
public abstract AttributecreateAttribute(String localName, String value)
localName - the local name of the XML name of the attribute, localName cannot be null
value - the attribute value to set, may not be null
public abstract AttributecreateAttribute(QName name, String value)
name - the qualified name of the attribute, may not be null
value - the attribute value to set, may not be null
public abstract NamespacecreateNamespace(String namespaceURI)
namespaceURI - the default namespace uri
public abstract NamespacecreateNamespace(String prefix, String namespaceUri)
prefix - the prefix of this namespace, may not be null
namespaceUri - the attribute value is set to this value, may not be null
public abstract StartElementcreateStartElement(QName name, Iterator attributes, Iterator namespaces)
name - the qualified name of the attribute, may not be null
attributes - an optional unordered set of objects that implement Attribute to add to the new StartElement, may be null
namespaces - an optional unordered set of objects that implement Namespace to add to the new StartElement, may be null
public abstract StartElementcreateStartElement(String prefix, String namespaceUri, String localName)
namespaceUri - the uri of the QName of the new StartElement
localName - the local name of the QName of the new StartElement
prefix - the prefix of the QName of the new StartElement
public abstract StartElementcreateStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces)
namespaceUri - the uri of the QName of the new StartElement
localName - the local name of the QName of the new StartElement
prefix - the prefix of the QName of the new StartElement
attributes - an unordered set of objects that implement Attribute to add to the new StartElement
namespaces - an unordered set of objects that implement Namespace to add to the new StartElement
public abstract StartElementcreateStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces, NamespaceContext context)
namespaceUri - the uri of the QName of the new StartElement
localName - the local name of the QName of the new StartElement
prefix - the prefix of the QName of the new StartElement
attributes - an unordered set of objects that implement Attribute to add to the new StartElement, may be null
namespaces - an unordered set of objects that implement Namespace to add to the new StartElement, may be null
context - the namespace context of this element
public abstract EndElementcreateEndElement(QName name, Iterator namespaces)
name - the qualified name of the EndElement
namespaces - an optional unordered set of objects that implement Namespace that have gone out of scope, may be null
public abstract EndElementcreateEndElement(String prefix, String namespaceUri, String localName)
namespaceUri - the uri of the QName of the new StartElement
localName - the local name of the QName of the new StartElement
prefix - the prefix of the QName of the new StartElement
public abstract EndElementcreateEndElement(String prefix, String namespaceUri, String localName, Iterator namespaces)
namespaceUri - the uri of the QName of the new StartElement
localName - the local name of the QName of the new StartElement
prefix - the prefix of the QName of the new StartElement
namespaces - an unordered set of objects that implement Namespace that have gone out of scope, may be null
public abstract CharacterscreateCharacters(String content)
content - the string to create
public abstract CharacterscreateCData(String content)
content - the string to create
public abstract CharacterscreateSpace(String content)
content - the content of the space to create
public abstract CharacterscreateIgnorableSpace(String content)
content - the space to create
public abstract StartDocumentcreateStartDocument()
public abstract StartDocumentcreateStartDocument(String encoding, String version, boolean standalone)
encoding - the encoding style
version - the XML version
standalone - the status of standalone may be set to "true" or "false"
public abstract StartDocumentcreateStartDocument(String encoding, String version)
encoding - the encoding style
version - the XML version
public abstract StartDocumentcreateStartDocument(String encoding)
encoding - the encoding style
public abstract EndDocumentcreateEndDocument()
public abstract EntityReferencecreateEntityReference(String name, EntityDeclaration declaration)
name - The name of the reference
declaration - the declaration for the event
public abstract CommentcreateComment(String text)
text - The text of the comment a Comment event
public abstract ProcessingInstructioncreateProcessingInstruction(String target, String data)
target - The target of the processing instruction
data - The text of the processing instruction