org.freecompany.infoset

Interface InfosetFactory<T>

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 classInfosetFactory.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(Class<V> clazz, Infoset<T> infoset)
Converts an instance of the provided Infoset type to the native type for this factory.
Infoset<T>create(ReadableByteChannel channel)
Creates an infoset that will, when accessed, parse the content from the provided URL.
Infoset<T>create(InputStream input)
Creates an infoset that will, when accessed, parse the content from the provided URL.
Infoset<T>create(URL url)
Creates an infoset that will, when accessed, parse the content from the provided InputStream.

Method Detail

adaptFrom

public <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.

adaptTo

public <V> Infoset<V> adaptTo(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.

create

public Infoset<T> create(ReadableByteChannel channel)
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.

create

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

create

public Infoset<T> create(URL url)
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.