Package com.luciad.reference.format
Class TLcdWKTModelReferenceDecoder
java.lang.Object
com.luciad.reference.format.TLcdWKTModelReferenceDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable
,ILcdModelReferenceDecoder
@LcdService(service=ILcdModelReferenceDecoder.class,
priority=20000)
public class TLcdWKTModelReferenceDecoder
extends Object
implements ILcdModelReferenceDecoder, ILcdInputStreamFactoryCapable
This decoder attempts to create a
ILcdModelReference
from a file in the directory of the given data source file aSource
.
- If the file name
aSource
is<name>.xxx
, it first tries to open a file called<name>.prj
. - If this file does not exist, it
tries to open a file called
directory.prj
(this can be used as a common default file for all the data files in the same directory). - It this file does not exist, a IOException is thrown..
.prj
and .PRJ
is tried for
case sensitive file systems.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.luciad.model.ILcdModelReferenceDecoder
ILcdModelReferenceDecoder.ModelReferenceWithSource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondecodeModelReference
(String aDataSourceName) Returns the model reference, associated with the specified data source.findAndDecodeModelReference
(String aSource) Finds and decodes the model reference file, associated with the specified data source.Returns the input stream factory that is used.void
setInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory to be used.
-
Constructor Details
-
TLcdWKTModelReferenceDecoder
public TLcdWKTModelReferenceDecoder()
-
-
Method Details
-
decodeModelReference
Returns the model reference, associated with the specified data source. This implementation delegates tofindAndDecodeModelReference(java.lang.String)
and returns the resulting model reference.- Specified by:
decodeModelReference
in interfaceILcdModelReferenceDecoder
- Parameters:
aDataSourceName
- a data source for which to return the model reference; typically a file name or a URL.- Returns:
- the
ILcdModelReference
associated with the data source. Whilenull
is allowed, implementors are advised to throw an error instead. - Throws:
IOException
- if theILcdModelReference
cannot be decoded.
When the thread on which this method is called is interrupted, it is recommended to stop the decoding and throw anInterruptedIOException
. This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding through the UI.
-
findAndDecodeModelReference
public ILcdModelReferenceDecoder.ModelReferenceWithSource findAndDecodeModelReference(String aSource) throws IOException Description copied from interface:ILcdModelReferenceDecoder
Finds and decodes the model reference file, associated with the specified data source. The default implementation delegates toILcdModelReferenceDecoder.decodeModelReference(java.lang.String)
and returns the resulting model reference, paired with anull
source, indicating that the source is unknown or does not exist.- Specified by:
findAndDecodeModelReference
in interfaceILcdModelReferenceDecoder
- Parameters:
aSource
- a data source for which to return the model reference; typically a file name or a URL.- Returns:
- the decoded
ILcdModelReference
and the location of the reference file. Nevernull
. - Throws:
IOException
- if no model reference file is found, or theILcdModelReference
cannot be decoded.
When the thread on which this method is called is interrupted, it is recommended to stop the decoding and throw anInterruptedIOException
. This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding through the UI.
-
setInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapable
Sets the input stream factory to be used.- Specified by:
setInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Parameters:
aInputStreamFactory
- the input stream factory to be used.
-
getInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapable
Returns the input stream factory that is used.- Specified by:
getInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Returns:
- the input stream factory that is used.
-