public class EventFactory
extends javax.xml.stream.XMLEventFactory
The default factory for creating events.
| Constructor and Description |
|---|
EventFactory() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
checkPrefix(java.lang.String prefix) |
javax.xml.stream.events.Attribute |
createAttribute(javax.xml.namespace.QName name,
java.lang.String value)
Create a new Attribute
|
javax.xml.stream.events.Attribute |
createAttribute(java.lang.String localName,
java.lang.String value)
Create a new Attribute
|
javax.xml.stream.events.Attribute |
createAttribute(java.lang.String prefix,
java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String value)
Create a new Attribute
|
javax.xml.stream.events.Characters |
createCData(java.lang.String content)
Create a Characters event with the CData flag set to true
|
javax.xml.stream.events.Characters |
createCharacters(java.lang.String content)
Create a Characters event, this method does not check if the content
is all whitespace.
|
javax.xml.stream.events.Comment |
createComment(java.lang.String text)
Create a comment
|
javax.xml.stream.events.DTD |
createDTD(java.lang.String dtd)
Create a document type definition event
This string contains the entire document type declaration that matches
the doctypedecl in the XML 1.0 specification
|
javax.xml.stream.events.EndDocument |
createEndDocument()
Creates a new instance of an EndDocument event
|
javax.xml.stream.events.EndElement |
createEndElement(javax.xml.namespace.QName name,
java.util.Iterator namespaces)
Create a new EndElement
|
javax.xml.stream.events.EndElement |
createEndElement(java.lang.String prefix,
java.lang.String namespaceUri,
java.lang.String localName)
Create a new EndElement
|
javax.xml.stream.events.EndElement |
createEndElement(java.lang.String prefix,
java.lang.String namespaceUri,
java.lang.String localName,
java.util.Iterator namespaces)
Create a new EndElement
|
javax.xml.stream.events.EntityReference |
createEntityReference(java.lang.String name,
javax.xml.stream.events.EntityDeclaration declaration)
public AttributeIterator createAttributeIterator(Iterator iterator){
return new AttributeIteratorImpl(iterator);
}
public NamespaceIterator createNamespaceIterator(Iterator iterator){
return new NamespaceIteratorImpl(iterator);
}
|
javax.xml.stream.events.Characters |
createIgnorableSpace(java.lang.String content)
Create an ignorable space
|
javax.xml.stream.events.Namespace |
createNamespace(java.lang.String namespaceURI)
Create a new default Namespace
|
javax.xml.stream.events.Namespace |
createNamespace(java.lang.String prefix,
java.lang.String namespaceUri)
Create a new Namespace
|
javax.xml.stream.events.ProcessingInstruction |
createProcessingInstruction(java.lang.String target,
java.lang.String data)
Create a processing instruction
|
javax.xml.stream.events.Characters |
createSpace(java.lang.String content)
Create a Characters event with the isSpace flag set to true
|
javax.xml.stream.events.StartDocument |
createStartDocument()
Creates a new instance of a StartDocument event
|
javax.xml.stream.events.StartDocument |
createStartDocument(java.lang.String encoding)
Creates a new instance of a StartDocument event
|
javax.xml.stream.events.StartDocument |
createStartDocument(java.lang.String encoding,
java.lang.String version)
Creates a new instance of a StartDocument event
|
javax.xml.stream.events.StartDocument |
createStartDocument(java.lang.String encoding,
java.lang.String version,
boolean standalone)
Creates a new instance of a StartDocument event
|
javax.xml.stream.events.StartElement |
createStartElement(javax.xml.namespace.QName name,
java.util.Iterator attributes,
java.util.Iterator namespaces)
Create a new StartElement.
|
javax.xml.stream.events.StartElement |
createStartElement(java.lang.String prefix,
java.lang.String namespaceUri,
java.lang.String localName)
Create a new StartElement.
|
javax.xml.stream.events.StartElement |
createStartElement(java.lang.String prefix,
java.lang.String namespaceUri,
java.lang.String localName,
java.util.Iterator attributes,
java.util.Iterator namespaces)
Create a new StartElement.
|
javax.xml.stream.events.StartElement |
createStartElement(java.lang.String prefix,
java.lang.String namespaceUri,
java.lang.String localName,
java.util.Iterator attributes,
java.util.Iterator namespaces,
javax.xml.namespace.NamespaceContext context)
Create a new StartElement.
|
void |
setLocation(javax.xml.stream.Location l)
This method allows setting of the Location on each event that
is created by this factory.
|
public void setLocation(javax.xml.stream.Location l)
javax.xml.stream.XMLEventFactorysetLocation in class javax.xml.stream.XMLEventFactoryl - the location to set on each event createdpublic javax.xml.stream.events.Attribute createAttribute(javax.xml.namespace.QName name,
java.lang.String value)
javax.xml.stream.XMLEventFactorycreateAttribute in class javax.xml.stream.XMLEventFactoryname - the qualified name of the attribute, may not be nullvalue - the attribute value to set, may not be nullpublic javax.xml.stream.events.Attribute createAttribute(java.lang.String localName,
java.lang.String value)
javax.xml.stream.XMLEventFactorycreateAttribute in class javax.xml.stream.XMLEventFactorylocalName - the local name of the XML name of the attribute, localName cannot be nullvalue - the attribute value to set, may not be nullpublic javax.xml.stream.events.Attribute createAttribute(java.lang.String prefix,
java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String value)
javax.xml.stream.XMLEventFactorycreateAttribute in class javax.xml.stream.XMLEventFactoryprefix - the prefix of this attribute, may not be nullnamespaceURI - the attribute value is set to this value, may not be nulllocalName - the local name of the XML name of the attribute, localName cannot be nullvalue - the attribute value to set, may not be nullpublic javax.xml.stream.events.Namespace createNamespace(java.lang.String namespaceURI)
javax.xml.stream.XMLEventFactorycreateNamespace in class javax.xml.stream.XMLEventFactorynamespaceURI - the default namespace uripublic javax.xml.stream.events.Namespace createNamespace(java.lang.String prefix,
java.lang.String namespaceUri)
javax.xml.stream.XMLEventFactorycreateNamespace in class javax.xml.stream.XMLEventFactoryprefix - the prefix of this namespace, may not be nullnamespaceUri - the attribute value is set to this value, may not be nullpublic javax.xml.stream.events.StartElement createStartElement(javax.xml.namespace.QName name,
java.util.Iterator attributes,
java.util.Iterator namespaces)
javax.xml.stream.XMLEventFactorycreateStartElement in class javax.xml.stream.XMLEventFactoryname - the qualified name of the attribute, may not be nullattributes - an optional unordered set of objects that
implement Attribute to add to the new StartElement, may be nullnamespaces - an optional unordered set of objects that
implement Namespace to add to the new StartElement, may be nullpublic javax.xml.stream.events.StartElement createStartElement(java.lang.String prefix,
java.lang.String namespaceUri,
java.lang.String localName)
javax.xml.stream.XMLEventFactorycreateStartElement in class javax.xml.stream.XMLEventFactoryprefix - the prefix of the QName of the new StartElementnamespaceUri - the uri of the QName of the new StartElementlocalName - the local name of the QName of the new StartElementpublic static java.lang.String checkPrefix(java.lang.String prefix)
public javax.xml.stream.events.StartElement createStartElement(java.lang.String prefix,
java.lang.String namespaceUri,
java.lang.String localName,
java.util.Iterator attributes,
java.util.Iterator namespaces)
javax.xml.stream.XMLEventFactorycreateStartElement in class javax.xml.stream.XMLEventFactoryprefix - the prefix of the QName of the new StartElementnamespaceUri - the uri of the QName of the new StartElementlocalName - the local name of the QName of the new StartElementattributes - an unordered set of objects that implement
Attribute to add to the new StartElementnamespaces - an unordered set of objects that implement
Namespace to add to the new StartElementpublic javax.xml.stream.events.StartElement createStartElement(java.lang.String prefix,
java.lang.String namespaceUri,
java.lang.String localName,
java.util.Iterator attributes,
java.util.Iterator namespaces,
javax.xml.namespace.NamespaceContext context)
javax.xml.stream.XMLEventFactorycreateStartElement in class javax.xml.stream.XMLEventFactoryprefix - the prefix of the QName of the new StartElementnamespaceUri - the uri of the QName of the new StartElementlocalName - the local name of the QName of the new StartElementattributes - an unordered set of objects that implement
Attribute to add to the new StartElement, may be nullnamespaces - an unordered set of objects that implement
Namespace to add to the new StartElement, may be nullcontext - the namespace context of this elementpublic javax.xml.stream.events.EndElement createEndElement(javax.xml.namespace.QName name,
java.util.Iterator namespaces)
javax.xml.stream.XMLEventFactorycreateEndElement in class javax.xml.stream.XMLEventFactoryname - the qualified name of the EndElementnamespaces - an optional unordered set of objects that
implement Namespace that have gone out of scope, may be nullpublic javax.xml.stream.events.EndElement createEndElement(java.lang.String prefix,
java.lang.String namespaceUri,
java.lang.String localName)
javax.xml.stream.XMLEventFactorycreateEndElement in class javax.xml.stream.XMLEventFactoryprefix - the prefix of the QName of the new StartElementnamespaceUri - the uri of the QName of the new EndElementlocalName - the local name of the QName of the new StartElementpublic javax.xml.stream.events.EndElement createEndElement(java.lang.String prefix,
java.lang.String namespaceUri,
java.lang.String localName,
java.util.Iterator namespaces)
javax.xml.stream.XMLEventFactorycreateEndElement in class javax.xml.stream.XMLEventFactoryprefix - the prefix of the QName of the new StartElementnamespaceUri - the uri of the QName of the new EndElementlocalName - the local name of the QName of the new StartElementnamespaces - an unordered set of objects that implement
Namespace that have gone out of scope, may be nullpublic javax.xml.stream.events.Characters createCharacters(java.lang.String content)
javax.xml.stream.XMLEventFactorycreateCharacters in class javax.xml.stream.XMLEventFactorycontent - the string to createpublic javax.xml.stream.events.Characters createCData(java.lang.String content)
javax.xml.stream.XMLEventFactorycreateCData in class javax.xml.stream.XMLEventFactorycontent - the string to createpublic javax.xml.stream.events.StartDocument createStartDocument()
javax.xml.stream.XMLEventFactorycreateStartDocument in class javax.xml.stream.XMLEventFactorypublic javax.xml.stream.events.StartDocument createStartDocument(java.lang.String encoding,
java.lang.String version,
boolean standalone)
javax.xml.stream.XMLEventFactorycreateStartDocument in class javax.xml.stream.XMLEventFactoryencoding - the encoding styleversion - the XML versionstandalone - the status of standalone may be set to "true" or "false"public javax.xml.stream.events.StartDocument createStartDocument(java.lang.String encoding,
java.lang.String version)
javax.xml.stream.XMLEventFactorycreateStartDocument in class javax.xml.stream.XMLEventFactoryencoding - the encoding styleversion - the XML versionpublic javax.xml.stream.events.StartDocument createStartDocument(java.lang.String encoding)
javax.xml.stream.XMLEventFactorycreateStartDocument in class javax.xml.stream.XMLEventFactoryencoding - the encoding stylepublic javax.xml.stream.events.EndDocument createEndDocument()
javax.xml.stream.XMLEventFactorycreateEndDocument in class javax.xml.stream.XMLEventFactorypublic javax.xml.stream.events.EntityReference createEntityReference(java.lang.String name,
javax.xml.stream.events.EntityDeclaration declaration)
createEntityReference in class javax.xml.stream.XMLEventFactoryname - The name of the referencedeclaration - the declaration for the eventpublic javax.xml.stream.events.Characters createSpace(java.lang.String content)
javax.xml.stream.XMLEventFactorycreateSpace in class javax.xml.stream.XMLEventFactorycontent - the content of the space to createpublic javax.xml.stream.events.Characters createIgnorableSpace(java.lang.String content)
javax.xml.stream.XMLEventFactorycreateIgnorableSpace in class javax.xml.stream.XMLEventFactorycontent - the space to createpublic javax.xml.stream.events.Comment createComment(java.lang.String text)
javax.xml.stream.XMLEventFactorycreateComment in class javax.xml.stream.XMLEventFactorytext - The text of the comment
a Comment eventpublic javax.xml.stream.events.ProcessingInstruction createProcessingInstruction(java.lang.String target,
java.lang.String data)
javax.xml.stream.XMLEventFactorycreateProcessingInstruction in class javax.xml.stream.XMLEventFactorytarget - The target of the processing instructiondata - The text of the processing instructionpublic javax.xml.stream.events.DTD createDTD(java.lang.String dtd)
javax.xml.stream.XMLEventFactorycreateDTD in class javax.xml.stream.XMLEventFactorydtd - the text of the document type definition