Class EventFactory

java.lang.Object
javax.xml.stream.XMLEventFactory
com.bea.xml.stream.EventFactory

public class EventFactory extends XMLEventFactory

The default factory for creating events.

  • Constructor Details

    • EventFactory

      public EventFactory()
  • Method Details

    • setLocation

      public void setLocation(Location l)
      Description copied from class: javax.xml.stream.XMLEventFactory
      This 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:
      setLocation in class XMLEventFactory
      Parameters:
      l - the location to set on each event created
    • createAttribute

      public Attribute createAttribute(QName name, String value)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create a new Attribute
      Specified by:
      createAttribute in class XMLEventFactory
      Parameters:
      name - the qualified name of the attribute, may not be null
      value - the attribute value to set, may not be null
      Returns:
      the Attribute with specified values
    • createAttribute

      public Attribute createAttribute(String localName, String value)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create a new Attribute
      Specified by:
      createAttribute in class XMLEventFactory
      Parameters:
      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
      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.XMLEventFactory
      Create a new Attribute
      Specified by:
      createAttribute in class XMLEventFactory
      Parameters:
      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
      Returns:
      the Attribute with specified values
    • createNamespace

      public Namespace createNamespace(String namespaceURI)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create a new default Namespace
      Specified by:
      createNamespace in class XMLEventFactory
      Parameters:
      namespaceURI - the default namespace uri
      Returns:
      the Namespace with the specified value
    • createNamespace

      public Namespace createNamespace(String prefix, String namespaceUri)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create a new Namespace
      Specified by:
      createNamespace in class XMLEventFactory
      Parameters:
      prefix - the prefix of this namespace, may not be null
      namespaceUri - the attribute value is set to this value, may not be null
      Returns:
      the Namespace with the specified values
    • createStartElement

      public StartElement createStartElement(QName name, Iterator attributes, Iterator namespaces)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create 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:
      createStartElement in class XMLEventFactory
      Parameters:
      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
      Returns:
      an instance of the requested StartElement
    • createStartElement

      public StartElement createStartElement(String prefix, String namespaceUri, String localName)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create 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:
      createStartElement in class XMLEventFactory
      Parameters:
      prefix - the prefix of the QName of the new StartElement
      namespaceUri - the uri of the QName of the new StartElement
      localName - the local name of the QName of the new StartElement
      Returns:
      an instance of the requested StartElement
    • checkPrefix

      public static String checkPrefix(String prefix)
    • createStartElement

      public StartElement createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create 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:
      createStartElement in class XMLEventFactory
      Parameters:
      prefix - the prefix of the QName of the new StartElement
      namespaceUri - the uri of the QName of the new StartElement
      localName - the local name 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
      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.XMLEventFactory
      Create 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:
      createStartElement in class XMLEventFactory
      Parameters:
      prefix - the prefix of the QName of the new StartElement
      namespaceUri - the uri of the QName of the new StartElement
      localName - the local name 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
      Returns:
      an instance of the requested StartElement
    • createEndElement

      public EndElement createEndElement(QName name, Iterator namespaces)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create a new EndElement
      Specified by:
      createEndElement in class XMLEventFactory
      Parameters:
      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
      Returns:
      an instance of the requested EndElement
    • createEndElement

      public EndElement createEndElement(String prefix, String namespaceUri, String localName)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create a new EndElement
      Specified by:
      createEndElement in class XMLEventFactory
      Parameters:
      prefix - the prefix of the QName of the new StartElement
      namespaceUri - the uri of the QName of the new EndElement
      localName - 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.XMLEventFactory
      Create a new EndElement
      Specified by:
      createEndElement in class XMLEventFactory
      Parameters:
      prefix - the prefix of the QName of the new StartElement
      namespaceUri - the uri of the QName of the new EndElement
      localName - the local name 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
      Returns:
      an instance of the requested EndElement
    • createCharacters

      public Characters createCharacters(String content)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create a Characters event, this method does not check if the content is all whitespace. To create a space event use #createSpace(String)
      Specified by:
      createCharacters in class XMLEventFactory
      Parameters:
      content - the string to create
      Returns:
      a Characters event
    • createCData

      public Characters createCData(String content)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create a Characters event with the CData flag set to true
      Specified by:
      createCData in class XMLEventFactory
      Parameters:
      content - the string to create
      Returns:
      a Characters event
    • createStartDocument

      public StartDocument createStartDocument()
      Description copied from class: javax.xml.stream.XMLEventFactory
      Creates a new instance of a StartDocument event
      Specified by:
      createStartDocument in class XMLEventFactory
      Returns:
      a StartDocument event
    • createStartDocument

      public StartDocument createStartDocument(String encoding, String version, boolean standalone)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Creates a new instance of a StartDocument event
      Specified by:
      createStartDocument in class XMLEventFactory
      Parameters:
      encoding - the encoding style
      version - the XML version
      standalone - the status of standalone may be set to "true" or "false"
      Returns:
      a StartDocument event
    • createStartDocument

      public StartDocument createStartDocument(String encoding, String version)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Creates a new instance of a StartDocument event
      Specified by:
      createStartDocument in class XMLEventFactory
      Parameters:
      encoding - the encoding style
      version - the XML version
      Returns:
      a StartDocument event
    • createStartDocument

      public StartDocument createStartDocument(String encoding)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Creates a new instance of a StartDocument event
      Specified by:
      createStartDocument in class XMLEventFactory
      Parameters:
      encoding - the encoding style
      Returns:
      a StartDocument event
    • createEndDocument

      public EndDocument createEndDocument()
      Description copied from class: javax.xml.stream.XMLEventFactory
      Creates a new instance of an EndDocument event
      Specified by:
      createEndDocument in class XMLEventFactory
      Returns:
      an EndDocument event
    • createEntityReference

      public EntityReference createEntityReference(String name, EntityDeclaration declaration)
      public AttributeIterator createAttributeIterator(Iterator iterator){ return new AttributeIteratorImpl(iterator); } public NamespaceIterator createNamespaceIterator(Iterator iterator){ return new NamespaceIteratorImpl(iterator); }
      Specified by:
      createEntityReference in class XMLEventFactory
      Parameters:
      name - The name of the reference
      declaration - the declaration for the event
      Returns:
      an EntityReference event
    • createSpace

      public Characters createSpace(String content)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create a Characters event with the isSpace flag set to true
      Specified by:
      createSpace in class XMLEventFactory
      Parameters:
      content - the content of the space to create
      Returns:
      a Characters event
    • createIgnorableSpace

      public Characters createIgnorableSpace(String content)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create an ignorable space
      Specified by:
      createIgnorableSpace in class XMLEventFactory
      Parameters:
      content - the space to create
      Returns:
      a Characters event
    • createComment

      public Comment createComment(String text)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create a comment
      Specified by:
      createComment in class XMLEventFactory
      Parameters:
      text - The text of the comment a Comment event
    • createProcessingInstruction

      public ProcessingInstruction createProcessingInstruction(String target, String data)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create a processing instruction
      Specified by:
      createProcessingInstruction in class XMLEventFactory
      Parameters:
      target - The target of the processing instruction
      data - The text of the processing instruction
      Returns:
      a ProcessingInstruction event
    • createDTD

      public DTD createDTD(String dtd)
      Description copied from class: javax.xml.stream.XMLEventFactory
      Create 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:
      createDTD in class XMLEventFactory
      Parameters:
      dtd - the text of the document type definition
      Returns:
      a DTD event