Class StAXEventFactory


  • public class StAXEventFactory
    extends javax.xml.stream.XMLEventFactory
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) javax.xml.stream.Location location  
    • Constructor Summary

      Constructors 
      Constructor Description
      StAXEventFactory()
      Creates a new instance of StAXEventFactory
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.Attribute createAttribute​(javax.xml.namespace.QName name, java.lang.String value)  
      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()  
      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.EndElement createEndElement​(javax.xml.namespace.QName name, java.util.Iterator namespaces)
      Create a new EndElement
      javax.xml.stream.events.EntityReference createEntityReference​(java.lang.String name, javax.xml.stream.events.EntityDeclaration entityDeclaration)
      Creates a new instance of a EntityReference event
      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​(java.lang.String prefix, java.lang.String namespaceUri, java.lang.String localName)  
      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.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.events.StartElement createStartElement​(javax.xml.namespace.QName name, java.util.Iterator attributes, java.util.Iterator namespaces)
      Create a new StartElement.
      void setLocation​(javax.xml.stream.Location location)
      This method allows setting of the Location on each event that is created by this factory.
      • Methods inherited from class javax.xml.stream.XMLEventFactory

        newDefaultFactory, newFactory, newFactory, newInstance, newInstance
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • location

        javax.xml.stream.Location location
    • Constructor Detail

      • StAXEventFactory

        public StAXEventFactory()
        Creates a new instance of StAXEventFactory
    • Method Detail

      • setLocation

        public void setLocation​(javax.xml.stream.Location location)
        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 javax.xml.stream.XMLEventFactory
        Parameters:
        location - the location to set on each event created
      • createAttribute

        public 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
        Specified by:
        createAttribute in class javax.xml.stream.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
      • createAttribute

        public javax.xml.stream.events.Attribute createAttribute​(java.lang.String localName,
                                                                 java.lang.String value)
        Create a new Attribute
        Specified by:
        createAttribute in class javax.xml.stream.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 javax.xml.stream.events.Attribute createAttribute​(javax.xml.namespace.QName name,
                                                                 java.lang.String value)
        Specified by:
        createAttribute in class javax.xml.stream.XMLEventFactory
      • createNamespace

        public javax.xml.stream.events.Namespace createNamespace​(java.lang.String namespaceURI)
        Create a new default Namespace
        Specified by:
        createNamespace in class javax.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)
        Create a new Namespace
        Specified by:
        createNamespace in class javax.xml.stream.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 javax.xml.stream.events.StartElement createStartElement​(javax.xml.namespace.QName name,
                                                                       java.util.Iterator attributes,
                                                                       java.util.Iterator namespaces)
        Create a new StartElement.
        Specified by:
        createStartElement in class javax.xml.stream.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 javax.xml.stream.events.StartElement createStartElement​(java.lang.String prefix,
                                                                       java.lang.String namespaceUri,
                                                                       java.lang.String localName)
        Specified by:
        createStartElement in class javax.xml.stream.XMLEventFactory
      • 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)
        Specified by:
        createStartElement in class javax.xml.stream.XMLEventFactory
      • 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)
        Specified by:
        createStartElement in class javax.xml.stream.XMLEventFactory
      • createEndElement

        public javax.xml.stream.events.EndElement createEndElement​(javax.xml.namespace.QName name,
                                                                   java.util.Iterator namespaces)
        Create a new EndElement
        Specified by:
        createEndElement in class javax.xml.stream.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 javax.xml.stream.events.EndElement createEndElement​(java.lang.String prefix,
                                                                   java.lang.String namespaceUri,
                                                                   java.lang.String localName)
        Create a new EndElement
        Specified by:
        createEndElement in class javax.xml.stream.XMLEventFactory
        Parameters:
        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
        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)
        Create a new EndElement
        Specified by:
        createEndElement in class javax.xml.stream.XMLEventFactory
        Parameters:
        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
        Returns:
        an instance of the requested EndElement
      • createCharacters

        public 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. To create a space event use #createSpace(String)
        Specified by:
        createCharacters in class javax.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)
        Create a Characters event with the CData flag set to true
        Specified by:
        createCData in class javax.xml.stream.XMLEventFactory
        Parameters:
        content - the string to create
        Returns:
        a Characters event
      • createSpace

        public javax.xml.stream.events.Characters createSpace​(java.lang.String content)
        Create a Characters event with the isSpace flag set to true
        Specified by:
        createSpace in class javax.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)
        Create an ignorable space
        Specified by:
        createIgnorableSpace in class javax.xml.stream.XMLEventFactory
        Parameters:
        content - the space to create
        Returns:
        a Characters event
      • createStartDocument

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

        public javax.xml.stream.events.StartDocument createStartDocument​(java.lang.String encoding)
        Creates a new instance of a StartDocument event
        Specified by:
        createStartDocument in class javax.xml.stream.XMLEventFactory
        Parameters:
        encoding - the encoding style
        Returns:
        a StartDocument event
      • createStartDocument

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

        public javax.xml.stream.events.StartDocument createStartDocument​(java.lang.String encoding,
                                                                         java.lang.String version,
                                                                         boolean standalone)
        Creates a new instance of a StartDocument event
        Specified by:
        createStartDocument in class javax.xml.stream.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
      • createEndDocument

        public javax.xml.stream.events.EndDocument createEndDocument()
        Specified by:
        createEndDocument in class javax.xml.stream.XMLEventFactory
      • createEntityReference

        public javax.xml.stream.events.EntityReference createEntityReference​(java.lang.String name,
                                                                             javax.xml.stream.events.EntityDeclaration entityDeclaration)
        Creates a new instance of a EntityReference event
        Specified by:
        createEntityReference in class javax.xml.stream.XMLEventFactory
        Parameters:
        name - The name of the reference
        entityDeclaration - the declaration for the event
        Returns:
        an EntityReference event
      • createComment

        public javax.xml.stream.events.Comment createComment​(java.lang.String text)
        Create a comment
        Specified by:
        createComment in class javax.xml.stream.XMLEventFactory
        Parameters:
        text - The text of the comment a Comment event
      • createDTD

        public 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
        Specified by:
        createDTD in class javax.xml.stream.XMLEventFactory
        Parameters:
        dtd - the text of the document type definition
        Returns:
        a DTD event
      • createProcessingInstruction

        public javax.xml.stream.events.ProcessingInstruction createProcessingInstruction​(java.lang.String target,
                                                                                         java.lang.String data)
        Create a processing instruction
        Specified by:
        createProcessingInstruction in class javax.xml.stream.XMLEventFactory
        Parameters:
        target - The target of the processing instruction
        data - The text of the processing instruction
        Returns:
        a ProcessingInstruction event