tuwien.auto.calimero.xml
Interface EntityResolver

All Known Implementing Classes:
DefaultEntityResolver

public interface EntityResolver

Used to resolve entities to be read with a XMLReader or written with a XMLWriter.

An EntityResolver is used by the XMLFactory to resolve the specified identifiers in the creator methods of the factory.


Method Summary
 java.io.Reader getInputReader(java.io.InputStream is)
          Creates an Reader using the supplied input stream.
 java.io.InputStream resolveInput(java.lang.String systemID)
          Resolves the system identifier for a XML resource and wraps it into an input stream.
 java.io.OutputStream resolveOutput(java.lang.String systemID)
          Resolves the system identifier for a XML resource and wraps it into an output stream.
 

Method Detail

getInputReader

java.io.Reader getInputReader(java.io.InputStream is)
                              throws KNXMLException
Creates an Reader using the supplied input stream.

This method creates an appropriate reader based on the character encoding of the resource specified by the input stream and the XML declaration pseudo attribute, if available.
It should provide a default reader if a selection of the source encoding can't be done reliably.

Parameters:
is - input stream to use as input for the reader to create
Returns:
the Reader for the input stream
Throws:
KNXMLException - on I/O error reading the input stream

resolveInput

java.io.InputStream resolveInput(java.lang.String systemID)
                                 throws KNXMLException
Resolves the system identifier for a XML resource and wraps it into an input stream.

Parameters:
systemID - location identifier of the XML resource
Returns:
the input stream for the resource
Throws:
KNXMLException - if resolving failed

resolveOutput

java.io.OutputStream resolveOutput(java.lang.String systemID)
                                   throws KNXMLException
Resolves the system identifier for a XML resource and wraps it into an output stream.

Parameters:
systemID - location identifier of the XML resource
Returns:
the output stream for the resource
Throws:
KNXMLException - if resolving failed