org.freecompany.infoset
Interface InfosetFactory<T>

All Known Implementing Classes:
DomInfosetFactory, SaxInfosetFactory

public interface InfosetFactory<T>

Interface representing factory that builds Infoset instances. An instance of this interface must be able to construct concrete Infoset instances from data streams.


Nested Class Summary
static class InfosetFactory.Registry
           
 
Method Summary
<V> Infoset<T>
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<T> infoset)
          Converts an instance of the provided Infoset type to the native type for this factory.
 Infoset<T> create(java.io.InputStream input)
          Creates an infoset that will, when accessed, parse the content from the provided URL.
 Infoset<T> create(java.nio.channels.ReadableByteChannel channel)
          Creates an infoset that will, when accessed, parse the content from the provided URL.
 Infoset<T> create(java.net.URL url)
          Creates an infoset that will, when accessed, parse the content from the provided InputStream.
 

Method Detail

create

Infoset<T> 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.

Throws:
java.io.IOException

create

Infoset<T> create(java.io.InputStream input)
                  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.

Throws:
java.io.IOException

create

Infoset<T> create(java.net.URL url)
                  throws java.io.IOException
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.

Throws:
java.io.IOException

adaptTo

<V> Infoset<V> adaptTo(java.lang.Class<V> clazz,
                       Infoset<T> infoset)
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.


adaptFrom

<V> Infoset<T> adaptFrom(Infoset<V> infoset)
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.