public class TLcdOGCModelDecoderFactory extends java.lang.Object implements ILcdOGCModelDecoderFactory
ILcdOGCModelDecoderFactory
that retrieves ILcdModelDecoder
instances using TLcdServiceLoader
. It makes sure that new instances are returned
for every call to ILcdOGCModelDecoderFactory.createModelDecoder(String)
or
ILcdOGCModelDecoderFactory.createModelDecoder(ILcdDataSource)
.Constructor and Description |
---|
TLcdOGCModelDecoderFactory()
Constructs the model decoder factory.
|
TLcdOGCModelDecoderFactory(java.util.function.Predicate<java.lang.String> aClassesPredicate)
Constructs the model decoder factory with a predicate allowing to filter on the model decoders.
|
Modifier and Type | Method and Description |
---|---|
ILcdModelDecoder |
createModelDecoder(ILcdDataSource aDataSource)
Creates a new
ILcdModelDecoder that can decode the specified data source. |
ILcdModelDecoder |
createModelDecoder(java.lang.String aSource)
Creates a new
ILcdModelDecoder that can decode the specified
source. |
public TLcdOGCModelDecoderFactory()
public TLcdOGCModelDecoderFactory(java.util.function.Predicate<java.lang.String> aClassesPredicate)
aClassesPredicate
- the predicate to filter on the model decoders, based on the class name.public ILcdModelDecoder createModelDecoder(java.lang.String aSource) throws java.lang.IllegalArgumentException
ILcdOGCModelDecoderFactory
ILcdModelDecoder
that can decode the specified
source. Note that models produced by this decoder must implement
ILcd2DBoundsIndexedModel
, and the model descriptor must be an
ILcdFeaturedDescriptor
.createModelDecoder
in interface ILcdOGCModelDecoderFactory
aSource
- the source to obtain a ILcdModelDecoder
for.ILcdModelDecoder
that can decode the specified source.java.lang.IllegalArgumentException
- if there is no ILcdModelDecoder
known for this source.public ILcdModelDecoder createModelDecoder(ILcdDataSource aDataSource) throws java.lang.IllegalArgumentException
ILcdOGCModelDecoderFactory
Creates a new ILcdModelDecoder
that can decode the specified data source.
By default, this method checks if the given ILcdDataSource
is a
TLcdDataSource
. If so, it delegates to the ILcdOGCModelDecoderFactory.createModelDecoder(String)
method. If not, an IllegalArgumentException
is thrown.
createModelDecoder
in interface ILcdOGCModelDecoderFactory
aDataSource
- the data source to obtain a ILcdModelDecoder
for.ILcdModelDecoder
that can decode the specified source.java.lang.IllegalArgumentException
- if there is no ILcdModelDecoder
known for this source.