org.freecompany.infoset.dom
Class DomInfosetFactory
java.lang.Object
org.freecompany.infoset.dom.DomInfosetFactory
- All Implemented Interfaces:
- InfosetFactory<org.w3c.dom.Document>
public class DomInfosetFactory
- extends java.lang.Object
- implements InfosetFactory<org.w3c.dom.Document>
|
Field Summary |
protected javax.xml.parsers.DocumentBuilderFactory |
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.w3c.dom.Document> infoset)
Converts an instance of the provided Infoset type to the native type for this factory. |
Infoset<org.w3c.dom.Document> |
create(java.io.InputStream input)
Creates an infoset that will, when accessed, parse the content from the provided
URL. |
Infoset<org.w3c.dom.Document> |
create(java.nio.channels.ReadableByteChannel channel)
Creates an infoset that will, when accessed, parse the content from the provided
URL. |
Infoset<org.w3c.dom.Document> |
create(java.net.URL url)
Creates an infoset that will, when accessed, parse the content from the provided
InputStream. |
static DomInfosetFactory |
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.DocumentBuilderFactory factory
DomInfosetFactory
protected DomInfosetFactory()
newInstance
public static DomInfosetFactory newInstance()
create
public Infoset<org.w3c.dom.Document> create(java.net.URL url)
throws java.io.IOException
- Description copied from interface:
InfosetFactory
- 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.w3c.dom.Document>
- Throws:
java.io.IOException
create
public Infoset<org.w3c.dom.Document> create(java.nio.channels.ReadableByteChannel channel)
throws java.io.IOException
- Description copied from interface:
InfosetFactory
- 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.w3c.dom.Document>
- Throws:
java.io.IOException
create
public Infoset<org.w3c.dom.Document> create(java.io.InputStream input)
- Description copied from interface:
InfosetFactory
- 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.w3c.dom.Document>
adaptTo
public <V> Infoset<V> adaptTo(java.lang.Class<V> clazz,
Infoset<org.w3c.dom.Document> 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.w3c.dom.Document>
adaptFrom
public <V> Infoset<org.w3c.dom.Document> 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.w3c.dom.Document>