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
aSourceis<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
Constructors -
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.voidsetInputStreamFactory(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:
decodeModelReferencein interfaceILcdModelReferenceDecoder- Parameters:
aDataSourceName- a data source for which to return the model reference; typically a file name or a URL.- Returns:
- the
ILcdModelReferenceassociated with the data source. Whilenullis allowed, implementors are advised to throw an error instead. - Throws:
IOException- if theILcdModelReferencecannot 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:ILcdModelReferenceDecoderFinds 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 anullsource, indicating that the source is unknown or does not exist.- Specified by:
findAndDecodeModelReferencein interfaceILcdModelReferenceDecoder- Parameters:
aSource- a data source for which to return the model reference; typically a file name or a URL.- Returns:
- the decoded
ILcdModelReferenceand the location of the reference file. Nevernull. - Throws:
IOException- if no model reference file is found, or theILcdModelReferencecannot 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:ILcdInputStreamFactoryCapableSets the input stream factory to be used.- Specified by:
setInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Parameters:
aInputStreamFactory- the input stream factory to be used.
-
getInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapableReturns the input stream factory that is used.- Specified by:
getInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Returns:
- the input stream factory that is used.
-