Class Stax2ReferentialSource

  • All Implemented Interfaces:
    javax.xml.transform.Source
    Direct Known Subclasses:
    Stax2FileSource, Stax2URLSource

    public abstract class Stax2ReferentialSource
    extends Stax2Source
    This is the mid-level abstract base class for Stax2Sources that refer to a resource in such a way, that an efficient InputStream or Reader can be constructed. Additionally, referenced sources also provide the base URI that allows for resolving relative references from within content read from such resources. Typical examples of references are URL and File: both for which a default implementations exist in this package
    See Also:
    Stax2FileSource, Stax2URLSource
    • Constructor Detail

      • Stax2ReferentialSource

        protected Stax2ReferentialSource()
    • Method Detail

      • getReference

        public abstract java.net.URL getReference()
        Specified by:
        getReference in class Stax2Source
        Returns:
        URL that can be used to resolve references originating from the content read via this source; may be null if not known (which is the case for most non-referential sources)
      • constructReader

        public abstract java.io.Reader constructReader()
                                                throws java.io.IOException
        Description copied from class: Stax2Source
        This method creates a Reader via which underlying input source can be accessed. Note that caller is responsible for closing that Reader when it is done reading it.
        Specified by:
        constructReader in class Stax2Source
        Throws:
        java.io.IOException
      • constructInputStream

        public abstract java.io.InputStream constructInputStream()
                                                          throws java.io.IOException
        Description copied from class: Stax2Source
        This method creates an InputStream via which underlying input source can be accessed. Note that caller is responsible for closing that InputSource when it is done reading it
        Specified by:
        constructInputStream in class Stax2Source
        Throws:
        java.io.IOException
      • getSystemId

        public java.lang.String getSystemId()
        Since we can determine a system id from the base URL
        Specified by:
        getSystemId in interface javax.xml.transform.Source
        Overrides:
        getSystemId in class Stax2Source