de.grogra.pf.io
Class NullSource

java.lang.Object
  extended by de.grogra.pf.io.FilterSourceBase
      extended by de.grogra.pf.io.NullSource
All Implemented Interfaces:
DOMSource, FileReaderSource, FileWriterSource, FilterSource, InputStreamSource, ObjectSource, OutputStreamSource, ReaderSource, SAXSource, VirtualFileReaderSource, VirtualFileWriterSource, WriterSource, RegistryContext

public final class NullSource
extends FilterSourceBase
implements SAXSource, InputStreamSource, OutputStreamSource, ReaderSource, WriterSource, ObjectSource, DOMSource, FileReaderSource, FileWriterSource, VirtualFileReaderSource, VirtualFileWriterSource


Nested Class Summary
 
Nested classes/interfaces inherited from interface de.grogra.pf.io.FilterSource
FilterSource.MetaDataKey<V>
 
Field Summary
 
Fields inherited from interface de.grogra.pf.io.SAXSource
NAMESPACE_PREFIXES, NAMESPACES
 
Fields inherited from interface de.grogra.pf.io.FilterSource
AUTO_PROGRESS, DESTINATION_FILE, DESTINATION_URL
 
Constructor Summary
NullSource(IOFlavor flavor, Registry r, ModifiableMap metaData)
           
 
Method Summary
 org.w3c.dom.Document getDocument()
          Returns the data as a DOM document.
 boolean getFeature(java.lang.String name)
           
 java.lang.Object getFile()
          Returns the file from which the data can be obtained.
 FileSystem getFileSystem()
          Returns the file system in which the file is contained.
 java.io.File getInputFile()
          Returns the file from which the data can be obtained.
 java.io.InputStream getInputStream()
          Returns a stream to obtain the data as a stream of bytes.
 java.lang.Object getObject()
          Returns the data as an object of a class which is compatible which the flavor.
 java.io.Reader getReader()
          Returns a reader to obtain the data as a stream of characters.
 java.lang.String getSystemId()
          Returns a system id which identifies this source.
 long length()
          Returns the total number of bytes of this stream.
 void parse(org.xml.sax.ContentHandler ch, org.xml.sax.ErrorHandler eh, org.xml.sax.ext.LexicalHandler lh, org.xml.sax.DTDHandler dh, org.xml.sax.EntityResolver er)
           
 void setFeature(java.lang.String name, boolean value)
           
 void write(java.io.File out)
          This method writes the data to out.
 void write(FileSystem fs, java.lang.Object out)
          This method writes the data to out.
 void write(java.io.OutputStream out)
          This method writes the data to out.
 void write(java.io.Writer out)
          This method writes the data to out.
 
Methods inherited from class de.grogra.pf.io.FilterSourceBase
getFilter, getFlavor, getMetaData, getRegistry, initProgressMonitor, setMetaData, setProgress, setProgress0, setProgressImpl, toString, useAutoProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.grogra.pf.io.FilterSource
getFilter, getFlavor, getMetaData, initProgressMonitor, setMetaData, setProgress
 
Methods inherited from interface de.grogra.pf.registry.RegistryContext
getRegistry
 

Constructor Detail

NullSource

public NullSource(IOFlavor flavor,
                  Registry r,
                  ModifiableMap metaData)
Method Detail

getDocument

public org.w3c.dom.Document getDocument()
                                 throws java.io.IOException,
                                        org.w3c.dom.DOMException
Description copied from interface: DOMSource
Returns the data as a DOM document.

Specified by:
getDocument in interface DOMSource
Returns:
the data
Throws:
java.io.IOException
org.w3c.dom.DOMException

getFeature

public boolean getFeature(java.lang.String name)
                   throws org.xml.sax.SAXNotRecognizedException,
                          org.xml.sax.SAXNotSupportedException
Specified by:
getFeature in interface SAXSource
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

getFile

public java.lang.Object getFile()
Description copied from interface: VirtualFileReaderSource
Returns the file from which the data can be obtained.

Specified by:
getFile in interface VirtualFileReaderSource
Returns:
file representing the data

getFileSystem

public FileSystem getFileSystem()
Description copied from interface: VirtualFileReaderSource
Returns the file system in which the file is contained.

Specified by:
getFileSystem in interface VirtualFileReaderSource
Returns:
file system

getInputFile

public java.io.File getInputFile()
Description copied from interface: FileReaderSource
Returns the file from which the data can be obtained.

Specified by:
getInputFile in interface FileReaderSource
Returns:
file representing the data

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Description copied from interface: InputStreamSource
Returns a stream to obtain the data as a stream of bytes.

Specified by:
getInputStream in interface InputStreamSource
Returns:
an input stream for the data
Throws:
java.io.IOException

getObject

public java.lang.Object getObject()
                           throws java.io.IOException
Description copied from interface: ObjectSource
Returns the data as an object of a class which is compatible which the flavor.

Specified by:
getObject in interface ObjectSource
Returns:
the data
Throws:
java.io.IOException

getReader

public java.io.Reader getReader()
                         throws java.io.IOException
Description copied from interface: ReaderSource
Returns a reader to obtain the data as a stream of characters.

Specified by:
getReader in interface ReaderSource
Returns:
a reader for the data
Throws:
java.io.IOException

getSystemId

public java.lang.String getSystemId()
Description copied from interface: FilterSource
Returns a system id which identifies this source.

Specified by:
getSystemId in interface FilterSource
Returns:
system id

length

public long length()
Description copied from interface: InputStreamSource
Returns the total number of bytes of this stream. A negative values indicates that this number is unknown.

Specified by:
length in interface InputStreamSource
Returns:
number of bytes

parse

public void parse(org.xml.sax.ContentHandler ch,
                  org.xml.sax.ErrorHandler eh,
                  org.xml.sax.ext.LexicalHandler lh,
                  org.xml.sax.DTDHandler dh,
                  org.xml.sax.EntityResolver er)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Specified by:
parse in interface SAXSource
Throws:
java.io.IOException
org.xml.sax.SAXException

setFeature

public void setFeature(java.lang.String name,
                       boolean value)
                throws org.xml.sax.SAXNotRecognizedException,
                       org.xml.sax.SAXNotSupportedException
Specified by:
setFeature in interface SAXSource
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

write

public void write(java.io.File out)
           throws java.io.IOException
Description copied from interface: FileWriterSource
This method writes the data to out.

Specified by:
write in interface FileWriterSource
Parameters:
out - the file to which data is written
Throws:
java.io.IOException

write

public void write(FileSystem fs,
                  java.lang.Object out)
Description copied from interface: VirtualFileWriterSource
This method writes the data to out.

Specified by:
write in interface VirtualFileWriterSource
Parameters:
fs - the file system to which data is written
out - the file to which data is written

write

public void write(java.io.OutputStream out)
           throws java.io.IOException
Description copied from interface: OutputStreamSource
This method writes the data to out.

Specified by:
write in interface OutputStreamSource
Parameters:
out - the stream to which data is written
Throws:
java.io.IOException

write

public void write(java.io.Writer out)
           throws java.io.IOException
Description copied from interface: WriterSource
This method writes the data to out.

Specified by:
write in interface WriterSource
Parameters:
out - the writer to which data is written
Throws:
java.io.IOException