org.freecompany.infoset.sax
Class SaxInfosetFactory
java.lang.Object
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>
|
Field Summary |
protected javax.xml.parsers.SAXParserFactory |
factory
|
|
Method Summary |
|
adaptFrom(Infoset<V> infoset)
Converts an instance of the provided Infoset type to the native type for this factory. |
|
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 |
factory
protected final javax.xml.parsers.SAXParserFactory factory
SaxInfosetFactory
protected SaxInfosetFactory()
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>