Package com.bea.xml.stream
Class EventFactory
- java.lang.Object
-
- javax.xml.stream.XMLEventFactory
-
- com.bea.xml.stream.EventFactory
-
public class EventFactory extends javax.xml.stream.XMLEventFactoryThe default factory for creating events.
-
-
Constructor Summary
Constructors Constructor Description EventFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcheckPrefix(java.lang.String prefix)javax.xml.stream.events.AttributecreateAttribute(java.lang.String localName, java.lang.String value)Create a new Attributejavax.xml.stream.events.AttributecreateAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, java.lang.String value)Create a new Attributejavax.xml.stream.events.AttributecreateAttribute(javax.xml.namespace.QName name, java.lang.String value)Create a new Attributejavax.xml.stream.events.CharacterscreateCData(java.lang.String content)Create a Characters event with the CData flag set to truejavax.xml.stream.events.CharacterscreateCharacters(java.lang.String content)Create a Characters event, this method does not check if the content is all whitespace.javax.xml.stream.events.CommentcreateComment(java.lang.String text)Create a commentjavax.xml.stream.events.DTDcreateDTD(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 specificationjavax.xml.stream.events.EndDocumentcreateEndDocument()Creates a new instance of an EndDocument eventjavax.xml.stream.events.EndElementcreateEndElement(java.lang.String prefix, java.lang.String namespaceUri, java.lang.String localName)Create a new EndElementjavax.xml.stream.events.EndElementcreateEndElement(java.lang.String prefix, java.lang.String namespaceUri, java.lang.String localName, java.util.Iterator namespaces)Create a new EndElementjavax.xml.stream.events.EndElementcreateEndElement(javax.xml.namespace.QName name, java.util.Iterator namespaces)Create a new EndElementjavax.xml.stream.events.EntityReferencecreateEntityReference(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.CharacterscreateIgnorableSpace(java.lang.String content)Create an ignorable spacejavax.xml.stream.events.NamespacecreateNamespace(java.lang.String namespaceURI)Create a new default Namespacejavax.xml.stream.events.NamespacecreateNamespace(java.lang.String prefix, java.lang.String namespaceUri)Create a new Namespacejavax.xml.stream.events.ProcessingInstructioncreateProcessingInstruction(java.lang.String target, java.lang.String data)Create a processing instructionjavax.xml.stream.events.CharacterscreateSpace(java.lang.String content)Create a Characters event with the isSpace flag set to truejavax.xml.stream.events.StartDocumentcreateStartDocument()Creates a new instance of a StartDocument eventjavax.xml.stream.events.StartDocumentcreateStartDocument(java.lang.String encoding)Creates a new instance of a StartDocument eventjavax.xml.stream.events.StartDocumentcreateStartDocument(java.lang.String encoding, java.lang.String version)Creates a new instance of a StartDocument eventjavax.xml.stream.events.StartDocumentcreateStartDocument(java.lang.String encoding, java.lang.String version, boolean standalone)Creates a new instance of a StartDocument eventjavax.xml.stream.events.StartElementcreateStartElement(java.lang.String prefix, java.lang.String namespaceUri, java.lang.String localName)Create a new StartElement.javax.xml.stream.events.StartElementcreateStartElement(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.StartElementcreateStartElement(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.javax.xml.stream.events.StartElementcreateStartElement(javax.xml.namespace.QName name, java.util.Iterator attributes, java.util.Iterator namespaces)Create a new StartElement.voidsetLocation(javax.xml.stream.Location l)This method allows setting of the Location on each event that is created by this factory.
-
-
-
Method Detail
-
setLocation
public void setLocation(javax.xml.stream.Location l)
Description copied from class:javax.xml.stream.XMLEventFactoryThis method allows setting of the Location on each event that is created by this factory. The values are copied by value into the events created by this factory. To reset the location information set the location to null.- Specified by:
setLocationin classjavax.xml.stream.XMLEventFactory- Parameters:
l- the location to set on each event created
-
createAttribute
public javax.xml.stream.events.Attribute createAttribute(javax.xml.namespace.QName name, java.lang.String value)Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new Attribute- Specified by:
createAttributein classjavax.xml.stream.XMLEventFactory- Parameters:
name- the qualified name of the attribute, may not be nullvalue- the attribute value to set, may not be null- Returns:
- the Attribute with specified values
-
createAttribute
public javax.xml.stream.events.Attribute createAttribute(java.lang.String localName, java.lang.String value)Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new Attribute- Specified by:
createAttributein classjavax.xml.stream.XMLEventFactory- Parameters:
localName- the local name of the XML name of the attribute, localName cannot be nullvalue- the attribute value to set, may not be null- Returns:
- the Attribute with specified values
-
createAttribute
public javax.xml.stream.events.Attribute createAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, java.lang.String value)Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new Attribute- Specified by:
createAttributein classjavax.xml.stream.XMLEventFactory- Parameters:
prefix- 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 null- Returns:
- the Attribute with specified values
-
createNamespace
public javax.xml.stream.events.Namespace createNamespace(java.lang.String namespaceURI)
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new default Namespace- Specified by:
createNamespacein classjavax.xml.stream.XMLEventFactory- Parameters:
namespaceURI- the default namespace uri- Returns:
- the Namespace with the specified value
-
createNamespace
public javax.xml.stream.events.Namespace createNamespace(java.lang.String prefix, java.lang.String namespaceUri)Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new Namespace- Specified by:
createNamespacein classjavax.xml.stream.XMLEventFactory- Parameters:
prefix- the prefix of this namespace, may not be nullnamespaceUri- the attribute value is set to this value, may not be null- Returns:
- the Namespace with the specified values
-
createStartElement
public javax.xml.stream.events.StartElement createStartElement(javax.xml.namespace.QName name, java.util.Iterator attributes, java.util.Iterator namespaces)Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new StartElement. Namespaces can be added to this StartElement by passing in an Iterator that walks over a set of Namespace interfaces. Attributes can be added to this StartElement by passing an iterator that walks over a set of Attribute interfaces.- Specified by:
createStartElementin classjavax.xml.stream.XMLEventFactory- Parameters:
name- 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 null- Returns:
- an instance of the requested StartElement
-
createStartElement
public javax.xml.stream.events.StartElement createStartElement(java.lang.String prefix, java.lang.String namespaceUri, java.lang.String localName)Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new StartElement. This defaults the NamespaceContext to an empty NamespaceContext. Querying this event for its namespaces or attributes will result in an empty iterator being returned.- Specified by:
createStartElementin classjavax.xml.stream.XMLEventFactory- Parameters:
prefix- 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 StartElement- Returns:
- an instance of the requested StartElement
-
checkPrefix
public static java.lang.String checkPrefix(java.lang.String prefix)
-
createStartElement
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)Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new StartElement. Namespaces can be added to this StartElement by passing in an Iterator that walks over a set of Namespace interfaces. Attributes can be added to this StartElement by passing an iterator that walks over a set of Attribute interfaces.- Specified by:
createStartElementin classjavax.xml.stream.XMLEventFactory- Parameters:
prefix- 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 StartElement- Returns:
- an instance of the requested StartElement
-
createStartElement
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.namespace.NamespaceContext context)Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new StartElement. Namespaces can be added to this StartElement by passing in an Iterator that walks over a set of Namespace interfaces. Attributes can be added to this StartElement by passing an iterator that walks over a set of Attribute interfaces.- Specified by:
createStartElementin classjavax.xml.stream.XMLEventFactory- Parameters:
prefix- 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 element- Returns:
- an instance of the requested StartElement
-
createEndElement
public javax.xml.stream.events.EndElement createEndElement(javax.xml.namespace.QName name, java.util.Iterator namespaces)Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new EndElement- Specified by:
createEndElementin classjavax.xml.stream.XMLEventFactory- Parameters:
name- the qualified name of the EndElementnamespaces- an optional unordered set of objects that implement Namespace that have gone out of scope, may be null- Returns:
- an instance of the requested EndElement
-
createEndElement
public javax.xml.stream.events.EndElement createEndElement(java.lang.String prefix, java.lang.String namespaceUri, java.lang.String localName)Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new EndElement- Specified by:
createEndElementin classjavax.xml.stream.XMLEventFactory- Parameters:
prefix- 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 StartElement- Returns:
- an instance of the requested EndElement
-
createEndElement
public javax.xml.stream.events.EndElement createEndElement(java.lang.String prefix, java.lang.String namespaceUri, java.lang.String localName, java.util.Iterator namespaces)Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new EndElement- Specified by:
createEndElementin classjavax.xml.stream.XMLEventFactory- Parameters:
prefix- 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 null- Returns:
- an instance of the requested EndElement
-
createCharacters
public javax.xml.stream.events.Characters createCharacters(java.lang.String content)
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a Characters event, this method does not check if the content is all whitespace. To create a space event use #createSpace(String)- Specified by:
createCharactersin classjavax.xml.stream.XMLEventFactory- Parameters:
content- the string to create- Returns:
- a Characters event
-
createCData
public javax.xml.stream.events.Characters createCData(java.lang.String content)
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a Characters event with the CData flag set to true- Specified by:
createCDatain classjavax.xml.stream.XMLEventFactory- Parameters:
content- the string to create- Returns:
- a Characters event
-
createStartDocument
public javax.xml.stream.events.StartDocument createStartDocument()
Description copied from class:javax.xml.stream.XMLEventFactoryCreates a new instance of a StartDocument event- Specified by:
createStartDocumentin classjavax.xml.stream.XMLEventFactory- Returns:
- a StartDocument event
-
createStartDocument
public javax.xml.stream.events.StartDocument createStartDocument(java.lang.String encoding, java.lang.String version, boolean standalone)Description copied from class:javax.xml.stream.XMLEventFactoryCreates a new instance of a StartDocument event- Specified by:
createStartDocumentin classjavax.xml.stream.XMLEventFactory- Parameters:
encoding- the encoding styleversion- the XML versionstandalone- the status of standalone may be set to "true" or "false"- Returns:
- a StartDocument event
-
createStartDocument
public javax.xml.stream.events.StartDocument createStartDocument(java.lang.String encoding, java.lang.String version)Description copied from class:javax.xml.stream.XMLEventFactoryCreates a new instance of a StartDocument event- Specified by:
createStartDocumentin classjavax.xml.stream.XMLEventFactory- Parameters:
encoding- the encoding styleversion- the XML version- Returns:
- a StartDocument event
-
createStartDocument
public javax.xml.stream.events.StartDocument createStartDocument(java.lang.String encoding)
Description copied from class:javax.xml.stream.XMLEventFactoryCreates a new instance of a StartDocument event- Specified by:
createStartDocumentin classjavax.xml.stream.XMLEventFactory- Parameters:
encoding- the encoding style- Returns:
- a StartDocument event
-
createEndDocument
public javax.xml.stream.events.EndDocument createEndDocument()
Description copied from class:javax.xml.stream.XMLEventFactoryCreates a new instance of an EndDocument event- Specified by:
createEndDocumentin classjavax.xml.stream.XMLEventFactory- Returns:
- an EndDocument event
-
createEntityReference
public 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); }- Specified by:
createEntityReferencein classjavax.xml.stream.XMLEventFactory- Parameters:
name- The name of the referencedeclaration- the declaration for the event- Returns:
- an EntityReference event
-
createSpace
public javax.xml.stream.events.Characters createSpace(java.lang.String content)
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a Characters event with the isSpace flag set to true- Specified by:
createSpacein classjavax.xml.stream.XMLEventFactory- Parameters:
content- the content of the space to create- Returns:
- a Characters event
-
createIgnorableSpace
public javax.xml.stream.events.Characters createIgnorableSpace(java.lang.String content)
Description copied from class:javax.xml.stream.XMLEventFactoryCreate an ignorable space- Specified by:
createIgnorableSpacein classjavax.xml.stream.XMLEventFactory- Parameters:
content- the space to create- Returns:
- a Characters event
-
createComment
public javax.xml.stream.events.Comment createComment(java.lang.String text)
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a comment- Specified by:
createCommentin classjavax.xml.stream.XMLEventFactory- Parameters:
text- The text of the comment a Comment event
-
createProcessingInstruction
public javax.xml.stream.events.ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data)Description copied from class:javax.xml.stream.XMLEventFactoryCreate a processing instruction- Specified by:
createProcessingInstructionin classjavax.xml.stream.XMLEventFactory- Parameters:
target- The target of the processing instructiondata- The text of the processing instruction- Returns:
- a ProcessingInstruction event
-
createDTD
public javax.xml.stream.events.DTD createDTD(java.lang.String dtd)
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a document type definition event This string contains the entire document type declaration that matches the doctypedecl in the XML 1.0 specification- Specified by:
createDTDin classjavax.xml.stream.XMLEventFactory- Parameters:
dtd- the text of the document type definition- Returns:
- a DTD event
-
-