|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDataProvider
Objects that implement this interface manage access to data source objects.
Before the provider can be used, a client must call setSource(URL)
(or call the appropriate constructor) followed by IHasLifecycle.open()
. Otherwise,
the provider will throw an exception.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface edu.mit.jwi.data.IHasLifecycle |
---|
IHasLifecycle.LifecycleState, IHasLifecycle.ObjectClosedException, IHasLifecycle.ObjectOpenException |
Method Summary | ||
---|---|---|
java.net.URL |
getSource()
Returns the URL that points to the resource location; should
never return null . |
|
|
getSource(IContentType<T> type)
Returns a data source object for the specified content type, if one is available; otherwise returns null . |
|
java.util.Set<? extends IContentType<?>> |
getTypes()
Returns a set containing all the content types this provider looks for at the resource location. |
|
|
resolveContentType(IDataType<T> dt,
POS pos)
Returns the first content type, if any, that matches the specified data type and pos object. |
|
void |
setCharset(java.nio.charset.Charset charset)
Sets the character set associated with this dictionary. |
|
void |
setSource(java.net.URL url)
This method is used to set the source URL from which the provider accesses the data from which it instantiates data sources. |
Methods inherited from interface edu.mit.jwi.item.IHasVersion |
---|
getVersion |
Methods inherited from interface edu.mit.jwi.data.IHasLifecycle |
---|
isOpen, open |
Methods inherited from interface edu.mit.jwi.data.IClosable |
---|
close |
Methods inherited from interface edu.mit.jwi.data.IHasCharset |
---|
getCharset |
Method Detail |
---|
void setSource(java.net.URL url)
IllegalStateException
.
url
- the location of the data, may not be null
java.lang.IllegalStateException
- if the provider is currently open
java.lang.NullPointerException
- if the specified URL
is null
.java.net.URL getSource()
URL
that points to the resource location; should
never return null
.
URL
that points to the resource location; must
not be null
void setCharset(java.nio.charset.Charset charset)
null
.
charset
- the possibly null
character set to use when
decoding files.
java.lang.IllegalStateException
- if the provider is currently openjava.util.Set<? extends IContentType<?>> getTypes()
null
, non-empty set of content types for this
provider<T> IContentType<T> resolveContentType(IDataType<T> dt, POS pos)
null
.
dt
- the data type, possibly null
, of the desired
content typepos
- the part of speech, possibly null
, of the desired
content type
<T> IDataSource<T> getSource(IContentType<T> type)
null
.
T
- the content type of the data sourcetype
- the content type of the data source to be retrieved
null
if this provider has no such data source
java.lang.NullPointerException
- if the type is null
ObjectClosedException
- if the provider is not open when this call is made
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |