Class EventFactory
java.lang.Object
javax.xml.stream.XMLEventFactory
com.bea.xml.stream.EventFactory
The default factory for creating events.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcheckPrefix(String prefix) createAttribute(String localName, String value) Create a new AttributecreateAttribute(String prefix, String namespaceURI, String localName, String value) Create a new AttributecreateAttribute(QName name, String value) Create a new AttributecreateCData(String content) Create a Characters event with the CData flag set to truecreateCharacters(String content) Create a Characters event, this method does not check if the content is all whitespace.createComment(String text) Create a commentCreate a document type definition event This string contains the entire document type declaration that matches the doctypedecl in the XML 1.0 specificationCreates a new instance of an EndDocument eventcreateEndElement(String prefix, String namespaceUri, String localName) Create a new EndElementcreateEndElement(String prefix, String namespaceUri, String localName, Iterator namespaces) Create a new EndElementcreateEndElement(QName name, Iterator namespaces) Create a new EndElementcreateEntityReference(String name, EntityDeclaration declaration) public AttributeIterator createAttributeIterator(Iterator iterator){ return new AttributeIteratorImpl(iterator); } public NamespaceIterator createNamespaceIterator(Iterator iterator){ return new NamespaceIteratorImpl(iterator); }createIgnorableSpace(String content) Create an ignorable spacecreateNamespace(String namespaceURI) Create a new default NamespacecreateNamespace(String prefix, String namespaceUri) Create a new NamespacecreateProcessingInstruction(String target, String data) Create a processing instructioncreateSpace(String content) Create a Characters event with the isSpace flag set to trueCreates a new instance of a StartDocument eventcreateStartDocument(String encoding) Creates a new instance of a StartDocument eventcreateStartDocument(String encoding, String version) Creates a new instance of a StartDocument eventcreateStartDocument(String encoding, String version, boolean standalone) Creates a new instance of a StartDocument eventcreateStartElement(String prefix, String namespaceUri, String localName) Create a new StartElement.createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces) Create a new StartElement.createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces, NamespaceContext context) Create a new StartElement.createStartElement(QName name, Iterator attributes, Iterator namespaces) Create a new StartElement.voidThis method allows setting of the Location on each event that is created by this factory.Methods inherited from class XMLEventFactory
newInstance, newInstance
-
Constructor Details
-
EventFactory
public EventFactory()
-
-
Method Details
-
setLocation
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 classXMLEventFactory- Parameters:
l- the location to set on each event created
-
createAttribute
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new Attribute- Specified by:
createAttributein classXMLEventFactory- 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
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new Attribute- Specified by:
createAttributein classXMLEventFactory- 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 Attribute createAttribute(String prefix, String namespaceURI, String localName, String value) Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new Attribute- Specified by:
createAttributein classXMLEventFactory- 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
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new default Namespace- Specified by:
createNamespacein classXMLEventFactory- Parameters:
namespaceURI- the default namespace uri- Returns:
- the Namespace with the specified value
-
createNamespace
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new Namespace- Specified by:
createNamespacein classXMLEventFactory- 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
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 classXMLEventFactory- 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
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 classXMLEventFactory- 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
-
createStartElement
public StartElement createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, 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 classXMLEventFactory- 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 StartElement createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces, 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 classXMLEventFactory- 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
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new EndElement- Specified by:
createEndElementin classXMLEventFactory- 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
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new EndElement- Specified by:
createEndElementin classXMLEventFactory- 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 EndElement createEndElement(String prefix, String namespaceUri, String localName, Iterator namespaces) Description copied from class:javax.xml.stream.XMLEventFactoryCreate a new EndElement- Specified by:
createEndElementin classXMLEventFactory- 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
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 classXMLEventFactory- Parameters:
content- the string to create- Returns:
- a Characters event
-
createCData
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a Characters event with the CData flag set to true- Specified by:
createCDatain classXMLEventFactory- Parameters:
content- the string to create- Returns:
- a Characters event
-
createStartDocument
Description copied from class:javax.xml.stream.XMLEventFactoryCreates a new instance of a StartDocument event- Specified by:
createStartDocumentin classXMLEventFactory- Returns:
- a StartDocument event
-
createStartDocument
Description copied from class:javax.xml.stream.XMLEventFactoryCreates a new instance of a StartDocument event- Specified by:
createStartDocumentin classXMLEventFactory- Parameters:
encoding- the encoding styleversion- the XML versionstandalone- the status of standalone may be set to "true" or "false"- Returns:
- a StartDocument event
-
createStartDocument
Description copied from class:javax.xml.stream.XMLEventFactoryCreates a new instance of a StartDocument event- Specified by:
createStartDocumentin classXMLEventFactory- Parameters:
encoding- the encoding styleversion- the XML version- Returns:
- a StartDocument event
-
createStartDocument
Description copied from class:javax.xml.stream.XMLEventFactoryCreates a new instance of a StartDocument event- Specified by:
createStartDocumentin classXMLEventFactory- Parameters:
encoding- the encoding style- Returns:
- a StartDocument event
-
createEndDocument
Description copied from class:javax.xml.stream.XMLEventFactoryCreates a new instance of an EndDocument event- Specified by:
createEndDocumentin classXMLEventFactory- Returns:
- an EndDocument event
-
createEntityReference
public AttributeIterator createAttributeIterator(Iterator iterator){ return new AttributeIteratorImpl(iterator); } public NamespaceIterator createNamespaceIterator(Iterator iterator){ return new NamespaceIteratorImpl(iterator); }- Specified by:
createEntityReferencein classXMLEventFactory- Parameters:
name- The name of the referencedeclaration- the declaration for the event- Returns:
- an EntityReference event
-
createSpace
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a Characters event with the isSpace flag set to true- Specified by:
createSpacein classXMLEventFactory- Parameters:
content- the content of the space to create- Returns:
- a Characters event
-
createIgnorableSpace
Description copied from class:javax.xml.stream.XMLEventFactoryCreate an ignorable space- Specified by:
createIgnorableSpacein classXMLEventFactory- Parameters:
content- the space to create- Returns:
- a Characters event
-
createComment
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a comment- Specified by:
createCommentin classXMLEventFactory- Parameters:
text- The text of the comment a Comment event
-
createProcessingInstruction
Description copied from class:javax.xml.stream.XMLEventFactoryCreate a processing instruction- Specified by:
createProcessingInstructionin classXMLEventFactory- Parameters:
target- The target of the processing instructiondata- The text of the processing instruction- Returns:
- a ProcessingInstruction event
-
createDTD
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 classXMLEventFactory- Parameters:
dtd- the text of the document type definition- Returns:
- a DTD event
-