java.lang.Object
de.grogra.pf.io.FilterBase
de.grogra.pf.io.SAXFilterBase
de.grogra.pf.io.StreamAdapter
- All Implemented Interfaces:
DOMSource,FileWriterSource,Filter,FilterSource,InputStreamSource,OutputStreamSource,ReaderSource,SAXSource,VirtualFileWriterSource,WriterSource,RegistryContext,Map,XMLReader
public class StreamAdapter
extends SAXFilterBase
implements InputStreamSource, OutputStreamSource, ReaderSource, WriterSource, FileWriterSource, DOMSource, VirtualFileWriterSource
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.grogra.pf.io.FilterSource
FilterSource.MetaDataKey<V> -
Field Summary
Fields inherited from class de.grogra.pf.io.SAXFilterBase
LEX_HANDLERFields inherited from class de.grogra.pf.io.FilterBase
item, sourceFields inherited from interface de.grogra.pf.io.FilterSource
AUTO_PROGRESS, DESTINATION_FILE, DESTINATION_URLFields inherited from interface de.grogra.util.Map
DEFAULT_VALUE, EMPTY_MAPFields inherited from interface de.grogra.pf.io.SAXSource
NAMESPACE_PREFIXES, NAMESPACES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the data as a DOM document.booleangetFeature(String name) Returns a stream to obtain the data as a stream of bytes.Returns a reader to obtain the data as a stream of characters.longlength()Returns the total number of bytes of this stream.voidparse(ContentHandler ch, ErrorHandler eh, LexicalHandler lh, DTDHandler dh, EntityResolver er) voidsetFeature(String name, boolean value) static voidwrite(OutputStreamSource src, File out) static voidwrite(WriterSource src, File out) voidwrite(FileSystem fs, Object out) This method writes the data toout.voidThis method writes the data toout.voidwrite(OutputStream out) This method writes the data toout.voidThis method writes the data toout.Methods inherited from class de.grogra.pf.io.SAXFilterBase
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getProperty, parse, parse, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setPropertyMethods inherited from class de.grogra.pf.io.FilterBase
get, getFilter, getFlavor, getImpl, getMetaData, getRegistry, getSource, getSystemId, initProgressMonitor, setFlavor, setMetaData, setMetaData, setProgress, setSystemId, toString, toURLMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface de.grogra.pf.io.FilterSource
getFilter, getFlavor, getMetaData, getSystemId, initProgressMonitor, setMetaData, setProgressMethods inherited from interface de.grogra.pf.registry.RegistryContext
getRegistry
-
Constructor Details
-
StreamAdapter
-
-
Method Details
-
getInputStream
Description copied from interface:InputStreamSourceReturns a stream to obtain the data as a stream of bytes.- Specified by:
getInputStreamin interfaceInputStreamSource- Returns:
- an input stream for the data
- Throws:
IOException
-
length
public long length()Description copied from interface:InputStreamSourceReturns the total number of bytes of this stream. A negative values indicates that this number is unknown.- Specified by:
lengthin interfaceInputStreamSource- Returns:
- number of bytes
-
write
Description copied from interface:OutputStreamSourceThis method writes the data toout.- Specified by:
writein interfaceOutputStreamSource- Parameters:
out- the stream to which data is written- Throws:
IOException
-
getReader
Description copied from interface:ReaderSourceReturns a reader to obtain the data as a stream of characters.- Specified by:
getReaderin interfaceReaderSource- Returns:
- a reader for the data
- Throws:
IOException
-
write
Description copied from interface:WriterSourceThis method writes the data toout.- Specified by:
writein interfaceWriterSource- Parameters:
out- the writer to which data is written- Throws:
IOException
-
parse
public void parse(ContentHandler ch, ErrorHandler eh, LexicalHandler lh, DTDHandler dh, EntityResolver er) throws IOException, SAXException - Specified by:
parsein interfaceSAXSource- Throws:
IOExceptionSAXException
-
getFeature
- Specified by:
getFeaturein interfaceSAXSource- Specified by:
getFeaturein interfaceXMLReader- Overrides:
getFeaturein classSAXFilterBase- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
setFeature
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException - Specified by:
setFeaturein interfaceSAXSource- Specified by:
setFeaturein interfaceXMLReader- Overrides:
setFeaturein classSAXFilterBase- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
write
Description copied from interface:FileWriterSourceThis method writes the data toout.- Specified by:
writein interfaceFileWriterSource- Parameters:
out- the file to which data is written- Throws:
IOException
-
write
Description copied from interface:VirtualFileWriterSourceThis method writes the data toout.- Specified by:
writein interfaceVirtualFileWriterSource- Parameters:
fs- the file system to which data is writtenout- the file to which data is written- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
getDocument
Description copied from interface:DOMSourceReturns the data as a DOM document.- Specified by:
getDocumentin interfaceDOMSource- Returns:
- the data
- Throws:
IOExceptionDOMException
-