@LcdService(service=ILcdModelReferenceDecoder.class, priority=20000) public class TLcdWKTModelReferenceDecoder extends Object implements ILcdModelReferenceDecoder, ILcdInputStreamFactoryCapable
ILcdModelReference
from a file in the directory of the given data source file aSource
.
aSource
is <name>.xxx
, it
first tries to open a file called <name>.prj
.
directory.prj
(this can be used as
a common default file for all the data files in the same directory).
.prj
and .PRJ
is tried for
case sensitive file systems.ILcdModelReferenceDecoder.ModelReferenceWithSource
Constructor and Description |
---|
TLcdWKTModelReferenceDecoder() |
Modifier and Type | Method and Description |
---|---|
ILcdModelReference |
decodeModelReference(String aDataSourceName)
Returns the model reference, associated with the specified data source.
|
ILcdModelReferenceDecoder.ModelReferenceWithSource |
findAndDecodeModelReference(String aSource)
Finds and decodes the model reference file, associated with the specified data source.
|
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is used.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory to be used.
|
public ILcdModelReference decodeModelReference(String aDataSourceName) throws IOException
findAndDecodeModelReference(java.lang.String)
and returns the resulting model reference.decodeModelReference
in interface ILcdModelReferenceDecoder
aDataSourceName
- a data source for which to return the model reference; typically a file name or a URL.ILcdModelReference
associated with the data source. While null
is allowed,
implementors are advised to throw an error instead.IOException
- if the ILcdModelReference
cannot be decoded.
InterruptedIOException
.
This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding
through the UI.public ILcdModelReferenceDecoder.ModelReferenceWithSource findAndDecodeModelReference(String aSource) throws IOException
ILcdModelReferenceDecoder
ILcdModelReferenceDecoder.decodeModelReference(java.lang.String)
and returns the resulting model reference, paired with a null
source, indicating that the source is unknown or does not exist.findAndDecodeModelReference
in interface ILcdModelReferenceDecoder
aSource
- a data source for which to return the model reference; typically a file name or a URL.ILcdModelReference
and the location of the reference file. Never null
.IOException
- if no model reference file is found, or the ILcdModelReference
cannot be
decoded.
InterruptedIOException
.
This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding
through the UI.public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
ILcdInputStreamFactoryCapable
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the input stream factory to be used.public ILcdInputStreamFactory getInputStreamFactory()
ILcdInputStreamFactoryCapable
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable