java.lang.Object
de.grogra.pf.io.FilterBase
- All Implemented Interfaces:
Filter
,FilterSource
,RegistryContext
,Map
- Direct Known Subclasses:
CompilationFilter
,CompiledRGGFilter
,ContourFilter
,CSVWriter
,DTDFilter
,DTDSourceFile.Loader
,DTGFilter
,ExcelWriter
,FunctionReader
,GLTFLoader
,GraphObjectFilter
,GraphReader
,GSReader
,GSWriter
,GSZCWriter
,GSZReader
,GSZWriter
,GUnzipFilter
,GZipFilter
,HTMLWriter
,IESFilter
,ImageReader
,ImageWriter
,ImportFilter
,ImportFilter
,LazyFilter
,LuminanceFilter
,MSMLProjectLoader
,MSMLReader
,MSMLWriter
,MTGFilter
,MTGLoader
,MTGReader
,MTGSourceFile.Loader
,NullResourceFilter
,OptionsSource.Loader
,PDBImport
,PDFWriter
,PlainTextWriter
,PointCloudFilterBase
,QSMImporter
,RegistryReader
,RootlessXMLFilter
,SAXFilterBase
,SceneGraphExport
,SecGraphExporter
,SecGraphFilter
,SMBFilter
,SourceFile.Loader
,SPDFilter
,SurfaceFilter
,X3DImport
,XEGImportFilter
,XEGImportScene
,XFrogFilter
,XFrogProjectLoader
,XLFilter
,XMLReaderBase
,XMLWriter
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.- Author:
- Ole Kniemeyer
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.grogra.pf.io.FilterSource
FilterSource.MetaDataKey<V>
-
Field Summary
Modifier and TypeFieldDescriptionprotected final FilterItem
The definingFilterItem
for this filter.protected final FilterSource
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
ConstructorDescriptionFilterBase
(FilterItem item, FilterSource source) Creates a newFilterBase
, initializes itsitem
andsource
fields and sets the system id to the system id of thesource
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value associated withkey
.final Filter
Returns theFilter
from which this instance obtains its data.final IOFlavor
Returns theIOFlavor
of this data source.protected Object
getImpl
(FilterSource.MetaDataKey key, Object defaultValue) This method is invoked byget(Object, Object)
.<V> V
getMetaData
(FilterSource.MetaDataKey<V> key, V defaultValue) final Registry
Returns theRegistry
which is linked with this instance.final FilterSource
Returns the data source of this filter.final String
Returns a system id which identifies this source.void
initProgressMonitor
(ProgressMonitor monitor) protected final void
<V> void
setMetaData
(FilterSource.MetaDataKey<V> key, V value) protected void
setMetaData
(Map metaData) Sets the internal meta data map to the specified map.void
setProgress
(String text, float progress) protected final void
setSystemId
(String systemId) toString()
toURL()
-
Field Details
-
item
The definingFilterItem
for this filter. -
source
The data source of this filter.
-
-
Constructor Details
-
FilterBase
Creates a newFilterBase
, initializes itsitem
andsource
fields and sets the system id to the system id of thesource
.- Parameters:
item
- the definingFilterItem
source
- the data source
-
-
Method Details
-
getSource
Description copied from interface:Filter
Returns the data source of this filter. -
getFilter
Description copied from interface:FilterSource
Returns theFilter
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 returnsnull
.- Specified by:
getFilter
in interfaceFilterSource
- Returns:
- the filter from which data is obtained, or
null
-
getRegistry
Description copied from interface:RegistryContext
Returns theRegistry
which is linked with this instance.- Specified by:
getRegistry
in interfaceRegistryContext
- Returns:
- the registry linked with this instance
-
getFlavor
Description copied from interface:FilterSource
Returns theIOFlavor
of this data source. Depending on the flavor, this instance has to implement corresponding subinterfaces ofFilterSource
.- Specified by:
getFlavor
in interfaceFilterSource
- Returns:
- the flavor of the data
-
setFlavor
-
getSystemId
Description copied from interface:FilterSource
Returns a system id which identifies this source.- Specified by:
getSystemId
in interfaceFilterSource
- Returns:
- system id
-
setSystemId
-
toURL
- Throws:
MalformedURLException
-
initProgressMonitor
- Specified by:
initProgressMonitor
in interfaceFilterSource
-
setProgress
- Specified by:
setProgress
in interfaceFilterSource
-
setMetaData
Sets the internal meta data map to the specified map.- Parameters:
metaData
- a value for the internal meta data map
-
get
Description copied from interface:Map
Returns the value associated withkey
. If there is no value associated withkey
,defaultValue
is returned. -
getMetaData
- Specified by:
getMetaData
in interfaceFilterSource
-
setMetaData
- Specified by:
setMetaData
in interfaceFilterSource
-
getImpl
This method is invoked byget(Object, Object)
. This default implementation forwards to the internal meta data map (seesetMetaData(Map)
), or returnsdefaultValue
if no such internal map has been set.- Parameters:
key
- a keydefaultValue
- a default value- Returns:
- the associated value, or
defaultValue
-
toString
-