|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.grogra.pf.io.FilterBase
public abstract class FilterBase
This is a base class for the implementation of
Filter
s. Its implementation of getMetaData
forwards to #getImpl(Object, Object)
firstly, then to
the item
which defines this filter, then to
the meta data of the source
, and returns the first value
which could be found this way.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface de.grogra.pf.io.FilterSource |
---|
FilterSource.MetaDataKey<V> |
Nested classes/interfaces inherited from interface de.grogra.util.Map |
---|
Map.Chain |
Field Summary | |
---|---|
protected FilterItem |
item
The defining FilterItem for this filter. |
protected FilterSource |
source
The data source of this filter. |
Fields inherited from interface de.grogra.pf.io.FilterSource |
---|
AUTO_PROGRESS, DESTINATION_FILE, DESTINATION_URL |
Fields inherited from interface de.grogra.util.Map |
---|
DEFAULT_VALUE, EMPTY_MAP |
Constructor Summary | |
---|---|
FilterBase(FilterItem item,
FilterSource source)
Creates a new FilterBase , initializes its
item and source fields and
sets the system id to the system id of the source . |
Method Summary | ||
---|---|---|
java.lang.Object |
get(java.lang.Object key,
java.lang.Object defaultValue)
Returns the value associated with key . |
|
Filter |
getFilter()
Returns the Filter from which this instance obtains its data. |
|
IOFlavor |
getFlavor()
Returns the IOFlavor of this data source. |
|
protected java.lang.Object |
getImpl(FilterSource.MetaDataKey key,
java.lang.Object defaultValue)
This method is invoked by get(Object, Object) . |
|
|
getMetaData(FilterSource.MetaDataKey<V> key,
V defaultValue)
|
|
Registry |
getRegistry()
Returns the Registry which is linked with this instance. |
|
FilterSource |
getSource()
Returns the data source of this filter. |
|
java.lang.String |
getSystemId()
Returns a system id which identifies this source. |
|
void |
initProgressMonitor(ProgressMonitor monitor)
|
|
protected void |
setFlavor(IOFlavor flavor)
|
|
|
setMetaData(FilterSource.MetaDataKey<V> key,
V value)
|
|
protected void |
setMetaData(Map metaData)
Sets the internal meta data map to the specified map. |
|
void |
setProgress(java.lang.String text,
float progress)
|
|
protected void |
setSystemId(java.lang.String systemId)
|
|
java.lang.String |
toString()
|
|
java.net.URL |
toURL()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final FilterItem item
FilterItem
for this filter.
protected final FilterSource source
Constructor Detail |
---|
public FilterBase(FilterItem item, FilterSource source)
FilterBase
, initializes its
item
and source
fields and
sets the system id to the system id of the source
.
item
- the defining FilterItem
source
- the data sourceMethod Detail |
---|
public java.lang.Object get(java.lang.Object key, java.lang.Object defaultValue)
Map
key
. If there is
no value associated with key
, defaultValue
is returned.
get
in interface Map
key
- a key for the mapdefaultValue
- the default value
defaultValue
public final Filter getFilter()
FilterSource
Filter
from which this instance obtains its data.
If there is no such filter, i.e., if this is the first object
in the filter pipeline, this method returns null
.
getFilter
in interface FilterSource
null
public final IOFlavor getFlavor()
FilterSource
IOFlavor
of this data source. Depending on the
flavor, this instance has to implement corresponding subinterfaces
of FilterSource
.
getFlavor
in interface FilterSource
protected java.lang.Object getImpl(FilterSource.MetaDataKey key, java.lang.Object defaultValue)
get(Object, Object)
. This default
implementation forwards to the internal meta data map
(see setMetaData(Map)
), or returns defaultValue
if no such internal map has been set.
key
- a keydefaultValue
- a default value
defaultValue
public <V> V getMetaData(FilterSource.MetaDataKey<V> key, V defaultValue)
getMetaData
in interface FilterSource
public final Registry getRegistry()
RegistryContext
Registry
which is linked with this instance.
getRegistry
in interface RegistryContext
public final FilterSource getSource()
Filter
getSource
in interface Filter
public final java.lang.String getSystemId()
FilterSource
getSystemId
in interface FilterSource
public void initProgressMonitor(ProgressMonitor monitor)
initProgressMonitor
in interface FilterSource
protected final void setFlavor(IOFlavor flavor)
public <V> void setMetaData(FilterSource.MetaDataKey<V> key, V value)
setMetaData
in interface FilterSource
protected void setMetaData(Map metaData)
metaData
- a value for the internal meta data mappublic void setProgress(java.lang.String text, float progress)
setProgress
in interface FilterSource
protected final void setSystemId(java.lang.String systemId)
public java.lang.String toString()
toString
in class java.lang.Object
public java.net.URL toURL() throws java.net.MalformedURLException
java.net.MalformedURLException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |