public final class TLcdCompositeModelReferenceEncoder extends Object implements ILcdModelReferenceEncoder, ILcdOutputStreamFactoryCapable
Composite implementation of ILcdModelReferenceEncoder
.
Any number of model reference encoders can be added to this composite.
The save(ILcdModelReference, String)
delegates, in order, to the encoders in the list.
See the save(ILcdModelReference, String)
for details.
ILcdModelReferenceEncoder
instances, you can use:
ILcdModelReferenceEncoder encoder =
new TLcdCompositeModelReferenceEncoder(TLcdServiceLoader.getInstance(ILcdModelReferenceEncoder.class));
This will use all model reference encoders annotated with the @LcdService
annotation.
As this is the case for the default available reference encoders,
you end up with a encoder which can encode to *.epsg
, *.prj
and *.ref
files.Constructor and Description |
---|
TLcdCompositeModelReferenceEncoder()
Creates a new, empty composite model reference encoder.
|
TLcdCompositeModelReferenceEncoder(ILcdModelReferenceEncoder... aModelReferenceEncoders)
Creates a new composite model reference encoder containing the supplied delegates
|
TLcdCompositeModelReferenceEncoder(Iterable<? extends ILcdModelReferenceEncoder> aModelReferenceEncoders)
Creates a new composite model reference encoder that lazily uses the given
Iterable to delegate to. |
Modifier and Type | Method and Description |
---|---|
List<ILcdModelReferenceEncoder> |
getModelReferenceEncoders()
Returns the list of delegate model reference encoders contained in this composite.
|
ILcdOutputStreamFactory |
getOutputStreamFactory()
Returns the output stream factory that is used.
|
void |
save(ILcdModelReference aModelReference,
String aDataDestinationName)
Saves the specified model reference to a location, next to the data destination.
|
void |
setOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory)
If not null, overrides the output stream factory of the contained model encoders with the given
factory.
|
public TLcdCompositeModelReferenceEncoder()
model reference encoders list
.public TLcdCompositeModelReferenceEncoder(Iterable<? extends ILcdModelReferenceEncoder> aModelReferenceEncoders)
Iterable
to delegate to.aModelReferenceEncoders
- an Iterable
of model reference encoderspublic TLcdCompositeModelReferenceEncoder(ILcdModelReferenceEncoder... aModelReferenceEncoders)
aModelReferenceEncoders
- delegate model reference encoders to be added to the compositepublic List<ILcdModelReferenceEncoder> getModelReferenceEncoders()
Iterable
, the returned list is unmodifiable.
If not, delegates can be added or removed by modifying this list.public void save(ILcdModelReference aModelReference, String aDataDestinationName) throws IOException
IOException
is thrown.InterruptedIOException
, the encoding stops and that error is re-thrown.save
in interface ILcdModelReferenceEncoder
aModelReference
- the ILcdModelReference
to be encoded.aDataDestinationName
- the destination name of the model to which the specified model reference belongs.IOException
- if the ILcdModelReference
cannot be encoded.public void setOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory)
setOutputStreamFactory
in interface ILcdOutputStreamFactoryCapable
aOutputStreamFactory
- the output stream factory to be used.public ILcdOutputStreamFactory getOutputStreamFactory()
ILcdOutputStreamFactoryCapable
getOutputStreamFactory
in interface ILcdOutputStreamFactoryCapable