Class AbstractX4OReader<T>
java.lang.Object
org.x4o.xml.io.AbstractX4OConnectionDebug
org.x4o.xml.io.AbstractX4OConnection
org.x4o.xml.io.AbstractX4OReaderSession<T>
org.x4o.xml.io.AbstractX4OReader<T>
- Type Parameters:
T- The root element object type.
- All Implemented Interfaces:
X4OConnection, X4OReader<T>, X4OReaderSession<T>
- Direct Known Subclasses:
DefaultX4OReader
public abstract class AbstractX4OReader<T>
extends AbstractX4OReaderSession<T>
implements X4OReader<T>
AbstractX4OReader wraps method to contexted reader.
- Version:
- 1.0 Aug 11, 2005
- Author:
- Willem Cazander
-
Field Summary
Fields inherited from class AbstractX4OConnection
phaseSkip, phaseStopFields inherited from class AbstractX4OConnectionDebug
ABSTRACT_DEBUG_OUTPUT_HANDLER, ABSTRACT_DEBUG_OUTPUT_STREAM, ABSTRACT_DEBUG_OUTPUT_STREAM_CLOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionread(InputStream input, String systemId, URL basePath) Method to parse the xml data.Reads the file and reads it as an InputStream.Reads the file fileName and reads it as an InputStream.readResource(String resourceName) reads an resource locaction.readString(String xmlString) Converts a String to a InputStream to is can me readd by SAX.Fetched the data direct from remote url to a InputStream to is can me readd by SAX.Methods inherited from class AbstractX4OReaderSession
readFileSession, readFileSession, readResourceSession, readStringSession, readUrlSessionMethods inherited from class AbstractX4OConnection
addPhaseSkip, getLanguage, getProperty, getPropertyKeys, setPhaseStop, setPropertyMethods inherited from class AbstractX4OConnectionDebug
debugException, debugStart, debugStopMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface X4OConnection
addPhaseSkip, getProperty, getPropertyKeys, setPhaseStop, setPropertyMethods inherited from interface X4OReader
addELBeanInstanceMethods inherited from interface X4OReaderSession
readSession, releaseSession
-
Constructor Details
-
AbstractX4OReader
-
-
Method Details
-
read
public T read(InputStream input, String systemId, URL basePath) throws X4OConnectionException, SAXException, IOException Description copied from interface:X4OReaderMethod to parse the xml data.- Specified by:
readin interfaceX4OReader<T>- Parameters:
input- The inputStream to parse.- Throws:
X4OConnectionException- Is thrown after x4o exception.SAXException- Is thrown after sax xml exception.IOException- Is thrown after io exception.
-
readFile
public T readFile(String fileName) throws X4OConnectionException, SAXException, IOException, FileNotFoundException Reads the file fileName and reads it as an InputStream.- Specified by:
readFilein interfaceX4OReader<T>- Parameters:
fileName- The file name to read.- Throws:
FileNotFoundException- Is thrown is file is not found.X4OConnectionException- Is thrown after x4o exception.SAXException- Is thrown after sax xml exception.IOException- Is thrown after io exception.- See Also:
-
readFile
public T readFile(File file) throws X4OConnectionException, SAXException, IOException, FileNotFoundException Reads the file and reads it as an InputStream.- Specified by:
readFilein interfaceX4OReader<T>- Parameters:
file- The file to read.- Throws:
FileNotFoundException- Is thrown is file is not found.X4OConnectionException- Is thrown after x4o exception.SAXException- Is thrown after sax xml exception.IOException- Is thrown after io exception.- See Also:
-
readResource
reads an resource locaction.- Specified by:
readResourcein interfaceX4OReader<T>- Parameters:
resourceName- The resource to readr.- Throws:
X4OConnectionException- Is thrown after x4o exception.SAXException- Is thrown after sax xml exception.IOException- Is thrown after io exception.- See Also:
-
readString
Converts a String to a InputStream to is can me readd by SAX.- Specified by:
readStringin interfaceX4OReader<T>- Parameters:
xmlString- The xml as String to read.- Throws:
X4OConnectionException- Is thrown after x4o exception.SAXException- Is thrown after sax xml exception.IOException- Is thrown after io exception.- See Also:
-
readUrl
Fetched the data direct from remote url to a InputStream to is can me readd by SAX.- Specified by:
readUrlin interfaceX4OReader<T>- Parameters:
url- The url to read.- Throws:
X4OConnectionException- Is thrown after x4o exception.SAXException- Is thrown after sax xml exception.IOException- Is thrown after io exception.- See Also:
-