public class TLcdAIXMVORHandler extends Object
ILcdAIXMHandler
deals
with VOR elements. Decoded models have as model descriptor an instance of
TLcdAIXMVORModelDescriptor
.
The objects in decoded models are based on the AIS domain objects available in com.luciad.ais.model
,
which all implement ILcdDataObject
. This interface provides a generic and
format-independent way of accessing the type and properties (features) of a domain object.
For this handler, the type of the decoded objects is TLcdAIXMDataTypes.VOR
,
which can also be retrieved through ILcdDataObject.getDataType()
.
The available properties of the objects are defined in TLcdAIXMVORDataProperties
.
The values for these properties can be retrieved through ILcdDataObject.getValue(com.luciad.datamodel.TLcdDataProperty)
.
Next to ILcdDataObject
, the objects in decoded models also implement ILcdFeatured
,
the former interface to access the properties (features) of a domain object.
This is still fully supported, and explained in the following comments.
The setVORFeatureNamesToBeDecoded
method
allows the user to specify which AIXM features are decoded into the featured model objects.
If no feature names to be decoded are specified, all features will be decoded.
The following fields (taken from the AIXM specification) are supported by the decoder. The list indicates into which feature or attribute the fields are decoded. It also indicates from which AIXM version on they are available.
AIXM handlers rely on a specific set of key features that uniquely define an object. This set of features must always be included in the set of features to be decoded. For VORs the key features are:
The following features are currently not supported:
TLcdAIXMVORModelDescriptor
Constructor and Description |
---|
TLcdAIXMVORHandler()
Creates a new
TLcdAIXMVORHandler instance. |
Modifier and Type | Method and Description |
---|---|
void |
endDocument()
Receive notification of the end of an AIXM document.
|
void |
endElement(String aElementName,
String aContent,
Stack aElementStack)
Receive notification of the end of an AIXM element.
|
ILcdAIXMModelFilter |
getAIXMModelFilter()
Returns the currently registered filter.
|
ILcdBounds |
getBoundsToFilterOn()
Returns the bounds that will be used as a filter on the model
created by this handler.
|
TLcdAISDataObjectFactory |
getDataObjectFactory()
Returns the factory to be used to
create domain objects.
|
ALcdAISObjectFactory |
getDomainFactory()
Deprecated.
|
String[] |
getElementsToBeHandled()
Returns the elements for which the methods
startElement and
endElement should be invoked. |
ILcdBounds |
getInitialBounds()
Returns the bounds to be used as initial bounds for the model created by this handler.
|
ILcdFeatureIndexedAnd2DBoundsIndexedModel |
getModel()
Returns the model build by this handler.
|
String[] |
getVORFeatureNamesToBeDecoded()
Returns the AIXM VOR features which are decoded into the featured model objects.
|
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
newModel(String aSource,
ILcdAIXMErrorMessageSupport aErrorMessage)
Resets the internal state of this handler so that
it is ready to handle a new data source from scratch.
|
void |
setAIXMModelFilter(ILcdAIXMModelFilter aFilter)
Specifies a filter to be used while creating the model.
|
void |
setBoundsToFilterOn(ILcdBounds aBoundsToFilterOn)
Specifies a bounds that will be used as a filter on the model
created by this handler.
|
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setDataObjectFactory(TLcdAISDataObjectFactory aFactory)
Specifies the factory to be used to
create domain objects.
|
void |
setDomainFactory(ALcdAISObjectFactory aDomainFactory)
Deprecated.
|
void |
setInitialBounds(ILcdBounds aInitialBounds)
Specifies a bounds to be used as initial bounds for the model created by this handler.
|
boolean |
setModelToUpdate(String aSource,
ILcdModel aModel,
ILcdAIXMErrorMessageSupport aErrorMessage)
Sets the internal state of this handler so that
it is ready to update the given model with a new data source.
|
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setVORFeatureNamesToBeDecoded(String[] aVORFeatureNamesToBeDecoded)
Sets the AIXM VOR features which need to be decoded into the featured model objects.
|
void |
startDocument()
Receive notification of the beginning of an AIXM document.
|
void |
startElement(String aElementName,
ILcdAssocSet aAttributes,
Stack aElementStack)
Receive notification of the beginning of an AIXM element.
|
void |
updateModel()
Applies the updates that are read to the model.
|
public TLcdAIXMVORHandler()
TLcdAIXMVORHandler
instance.public void startElement(String aElementName, ILcdAssocSet aAttributes, Stack aElementStack)
ILcdAIXMHandler
This method will be invoked at the beginning of every
element in the AIXM document; there will be a corresponding
endElement
event for every startElement event
(even when the element is empty). All of the element's content will be
reported, in order, before the corresponding endElement
event.
The attributes attached to the element are available through an
immutable ILcdAssocSet
. Only the following methods
of the interface are available:
UnsupportedOperationException
will be thrown if one
of the other methods are called.aElementName
- The name of the element.aAttributes
- The attributes attached to the element.aElementStack
- A stack containing the element names of all the parents of the current element and itself.ILcdAIXMHandler.endElement(java.lang.String, java.lang.String, java.util.Stack)
public void endElement(String aElementName, String aContent, Stack aElementStack)
ILcdAIXMHandler
This method will be invoked at the end of every
element in the AIXM document; there will be a corresponding
startElement
event for every endElement
event (even when the element is empty).
aElementName
- The name of the element.aContent
- The contents of the current element, or the
empty string if the element was empty.aElementStack
- A stack containing the element names of all the parents of the current element and itself.public String[] getVORFeatureNamesToBeDecoded()
public void setVORFeatureNamesToBeDecoded(String[] aVORFeatureNamesToBeDecoded)
Note that AIXM handlers rely on a specific set of key features that uniquely define an object. This set of features must always be included in the set of features to be decoded. See the class documentation for the key feature list of this handler.
aVORFeatureNamesToBeDecoded
- the AIXM VOR features which need to be decoded into the featured model objects.public void newModel(String aSource, ILcdAIXMErrorMessageSupport aErrorMessage)
ILcdAIXMHandler
The user should call this method before using this handler in a decoding process of an AIXM snapshot.
newModel
in interface ILcdAIXMHandler
aSource
- the name of the source that will be handledaErrorMessage
- for each irregular situation during the decoding, a report should be added to this objectpublic boolean setModelToUpdate(String aSource, ILcdModel aModel, ILcdAIXMErrorMessageSupport aErrorMessage)
ILcdAIXMHandler
The user should call this method before using this handler in a decoding process of an AIXM update.
setModelToUpdate
in interface ILcdAIXMHandler
aSource
- the name of the source that will be handledaModel
- the model that must be updatedaErrorMessage
- for each irregular situation during the decoding, a report should be added to this objectpublic void startDocument()
ILcdAIXMHandler
startDocument
in interface ILcdAIXMHandler
ILcdAIXMHandler.endDocument()
public void endDocument()
ILcdAIXMHandler
endDocument
in interface ILcdAIXMHandler
ILcdAIXMHandler.startDocument()
@Deprecated public void setDomainFactory(ALcdAISObjectFactory aDomainFactory)
ILcdAIXMHandler
The given domainFactory must not be null. Note that if a data object factory is set, the domain factory will not be used.
setDomainFactory
in interface ILcdAIXMHandler
aDomainFactory
- the domainFactory to be used to
create domain objectsILcdAIXMHandler.getDomainFactory()
@Deprecated public ALcdAISObjectFactory getDomainFactory()
ILcdAIXMHandler
getDomainFactory
in interface ILcdAIXMHandler
ILcdAIXMHandler.setDomainFactory(com.luciad.ais.model.ALcdAISObjectFactory)
public void setDataObjectFactory(TLcdAISDataObjectFactory aFactory)
ILcdAIXMHandler
The given factory must not be null.
setDataObjectFactory
in interface ILcdAIXMHandler
aFactory
- the domainFactory to be used to
create domain objectsILcdAIXMHandler.getDataObjectFactory()
public TLcdAISDataObjectFactory getDataObjectFactory()
ILcdAIXMHandler
getDataObjectFactory
in interface ILcdAIXMHandler
ILcdAIXMHandler.setDataObjectFactory(TLcdAISDataObjectFactory)
public void updateModel()
ILcdAIXMHandler
Please remark that this handler is only capable of updating the model if the user calls
setModelToUpdate
method to
set the model that has to be updated,startDocument
method before the first
call of the startElement
method,startElement
method each time the beginning of
an element in the data source is found,endElement
method each time the end of an
element in the data source is found,endDocument
method after the last
call of the endElement
method.updateModel
in interface ILcdAIXMHandler
public ILcdFeatureIndexedAnd2DBoundsIndexedModel getModel()
ILcdAIXMHandler
Please remark that this handler is only capable of creating the expected model if the user calls
newModel
method to reset the internal
state before he or she starts the decoding process,startDocument
method before the first
call of the startElement
method,startElement
method each time the beginning of
an element in the data source is found,endElement
method each time the end of an
element in the data source is found,endDocument
method after the last
call of the endElement
method.getModel
in interface ILcdAIXMHandler
public void setBoundsToFilterOn(ILcdBounds aBoundsToFilterOn)
ILcdAIXMHandler
If this bounds is null, all objects found in the data source will be inserted into the model. If this bounds is not null, only the objects whose bounds interact with the specified bounds will be inserted into the model.
setBoundsToFilterOn
in interface ILcdAIXMHandler
aBoundsToFilterOn
- the bounds to be used as a filterpublic ILcdBounds getBoundsToFilterOn()
ILcdAIXMHandler
getBoundsToFilterOn
in interface ILcdAIXMHandler
ILcdAIXMHandler.setBoundsToFilterOn(com.luciad.shape.ILcdBounds)
public void setInitialBounds(ILcdBounds aInitialBounds)
ILcdAIXMHandler
This bounds should be large enough to enclose (most of) the model objects. This option is used to avoid to many expansions of the model bounds.
This parameter may be null.
Note: This bounds is not a filter! If a model objects bounds does not interact with aInitialBounds, aInitialBounds will be enlarged to enclose the object.
setInitialBounds
in interface ILcdAIXMHandler
aInitialBounds
- the initial bounds for the model created by this handlerpublic ILcdBounds getInitialBounds()
ILcdAIXMHandler
getInitialBounds
in interface ILcdAIXMHandler
ILcdAIXMHandler.setInitialBounds(com.luciad.shape.ILcdBounds)
public void setAIXMModelFilter(ILcdAIXMModelFilter aFilter)
ILcdAIXMHandler
setAIXMModelFilter
in interface ILcdAIXMHandler
aFilter
- an ILcdAIXMModelFilter
to filter the model
objectspublic ILcdAIXMModelFilter getAIXMModelFilter()
public String[] getElementsToBeHandled()
ILcdAIXMHandler
startElement
and
endElement
should be invoked.
These elements must be a direct child of one of the following AIXM elements:
getElementsToBeHandled
in interface ILcdAIXMHandler
String
array containing the elements for which the methods
startElement
and endElement
should be invoked.public boolean isTraceOn()
true
if tracing is enabled for this class.public static void setClassTraceOn(boolean aClassTraceOn)
true
then all log messages are recorded, otherwise only
the informative, warning and error messages are recorded.aClassTraceOn
- if true then all log messages are recorded,
otherwise only the informative, warning and error messages are recorded.public void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.aTraceOn
- if true then all log messages are recorded for this
instance. If false, then only the informative, warning and
error log messages are recorded.