public interface IDataProvider extends IHasVersion, IHasLifecycle, IHasCharset
setSource(URL)
(or call the appropriate constructor) followed by IHasLifecycle.open(). Otherwise,
the provider will throw an exception.IHasLifecycle.LifecycleState, IHasLifecycle.ObjectClosedException, IHasLifecycle.ObjectOpenException| Modifier and Type | Method and Description |
|---|---|
URL |
getSource()
Returns the
URL that points to the resource location; should
never return null. |
<T> IDataSource<T> |
getSource(IContentType<T> type)
Returns a data source object for the specified content type, if one is
available; otherwise returns
null. |
Set<? extends IContentType<?>> |
getTypes()
Returns a set containing all the content types this provider looks for at
the resource location.
|
<T> IContentType<T> |
resolveContentType(IDataType<T> dt,
POS pos)
Returns the first content type, if any, that matches the specified data
type and pos object.
|
void |
setCharset(Charset charset)
Sets the character set associated with this dictionary.
|
void |
setSource(URL url)
This method is used to set the source URL from which the provider
accesses the data from which it instantiates data sources.
|
getVersionisOpen, opengetCharsetvoid setSource(URL url)
IllegalStateException.url - the location of the data, may not be nullIllegalStateException - if the provider is currently openNullPointerException - if the specified URL is null.URL getSource()
URL that points to the resource location; should
never return null.URL that points to the resource location; must
not be nullvoid setCharset(Charset charset)
null.charset - the possibly null character set to use when
decoding files.IllegalStateException - if the provider is currently openSet<? 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 retrievednull if this provider has no such data sourceNullPointerException - if the type is nullObjectClosedException - if the provider is not open when this call is madeCopyright © 2018. All rights reserved.