Interface X4OReader<T>
- All Superinterfaces:
X4OConnection
- All Known Subinterfaces:
X4OReaderSession<T>
- All Known Implementing Classes:
AbstractX4OReader
,AbstractX4OReaderSession
,DefaultX4OReader
X4OReader can read different input formats.
- Version:
- 1.0 Apr 6, 2013
- Author:
- Willem Cazander
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addELBeanInstance
(String name, Object bean) Adds an bean instance to the el context.read
(InputStream input, String systemId, URL basePath) Method to parse the xml data.Reads the file and parses it as an InputStream.Reads the file fileName and parses it as an InputStream.readResource
(String resourceName) Parses an resource locaction.readString
(String xmlString) Converts a String to a InputStream to is can me parsed by SAX.Fetched the data direct from remote url to a InputStream to is can me parsed by SAX.Methods inherited from interface org.x4o.xml.io.X4OConnection
addPhaseSkip, getProperty, getPropertyKeys, setPhaseStop, setProperty
-
Method Details
-
addELBeanInstance
-
read
T read(InputStream input, String systemId, URL basePath) throws X4OConnectionException, SAXException, IOException Method to parse the xml data.- 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
T readFile(String fileName) throws X4OConnectionException, SAXException, IOException, FileNotFoundException Reads the file fileName and parses it as an InputStream.- Parameters:
fileName
- The file name to parse.- 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
T readFile(File file) throws X4OConnectionException, SAXException, IOException, FileNotFoundException Reads the file and parses it as an InputStream.- Parameters:
file
- The file to parse.- 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
Parses an resource locaction.- Parameters:
resourceName
- The resource to parser.- 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 parsed by SAX.- Parameters:
xmlString
- The xml as String to parse.- 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 parsed by SAX.- Parameters:
url
- The url to parse.- Throws:
X4OConnectionException
- Is thrown after x4o exception.SAXException
- Is thrown after sax xml exception.IOException
- Is thrown after io exception.- See Also:
-