org.freecompany.infoset.sax
Class SaxInfosetFactory

java.lang.Object
  extended by org.freecompany.infoset.sax.SaxInfosetFactory
All Implemented Interfaces:
InfosetFactory<org.xml.sax.XMLReader>

public class SaxInfosetFactory
extends java.lang.Object
implements InfosetFactory<org.xml.sax.XMLReader>


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.freecompany.infoset.InfosetFactory
InfosetFactory.Registry
 
Field Summary
protected  javax.xml.parsers.SAXParserFactory factory
           
 
Constructor Summary
protected SaxInfosetFactory()
           
 
Method Summary
<V> Infoset<org.xml.sax.XMLReader>
adaptFrom(Infoset<V> infoset)
          Converts an instance of the provided Infoset type to the native type for this factory.
<V> Infoset<V>
adaptTo(java.lang.Class<V> clazz, Infoset<org.xml.sax.XMLReader> infoset)
          Converts an instance of the provided Infoset type to the native type for this factory.
 Infoset<org.xml.sax.XMLReader> create(java.io.InputStream input)
          Creates an infoset that will, when accessed, parse the content from the provided InputStream.
 Infoset<org.xml.sax.XMLReader> create(java.nio.channels.ReadableByteChannel channel)
          Creates an infoset that will, when accessed, parse the content from the provided URL.
 Infoset<org.xml.sax.XMLReader> create(java.net.URL url)
          Creates an infoset that will, when accessed, parse the content from the provided URL.
static SaxInfosetFactory newInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

protected final javax.xml.parsers.SAXParserFactory factory
Constructor Detail

SaxInfosetFactory

protected SaxInfosetFactory()
Method Detail

newInstance

public static SaxInfosetFactory newInstance()

create

public Infoset<org.xml.sax.XMLReader> create(java.net.URL url)
                                      throws java.io.IOException
Creates an infoset that will, when accessed, parse the content from the provided URL. Once parsed, the content will be cached, so anything that wishes to modify the resulting Document must clone it first.

Specified by:
create in interface InfosetFactory<org.xml.sax.XMLReader>
Throws:
java.io.IOException

create

public Infoset<org.xml.sax.XMLReader> create(java.nio.channels.ReadableByteChannel channel)
                                      throws java.io.IOException
Creates an infoset that will, when accessed, parse the content from the provided URL. Once parsed, the content will be cached, so anything that wishes to modify the resulting Document must clone it first.

Specified by:
create in interface InfosetFactory<org.xml.sax.XMLReader>
Throws:
java.io.IOException

create

public Infoset<org.xml.sax.XMLReader> create(java.io.InputStream input)
Creates an infoset that will, when accessed, parse the content from the provided InputStream. Once parsed, the content will be cached, so anything that wishes to modify the resulting Document must clone it first.

Specified by:
create in interface InfosetFactory<org.xml.sax.XMLReader>

adaptTo

public <V> Infoset<V> adaptTo(java.lang.Class<V> clazz,
                              Infoset<org.xml.sax.XMLReader> infoset)
Description copied from interface: InfosetFactory
Converts an instance of the provided Infoset type to the native type for this factory. If the factory does not support the conversion, it should return null.

Specified by:
adaptTo in interface InfosetFactory<org.xml.sax.XMLReader>

adaptFrom

public <V> Infoset<org.xml.sax.XMLReader> adaptFrom(Infoset<V> infoset)
Description copied from interface: InfosetFactory
Converts an instance of the provided Infoset type to the native type for this factory. If the factory does not support the conversion, it should return null.

Specified by:
adaptFrom in interface InfosetFactory<org.xml.sax.XMLReader>