public interface ILcdAIXMHandler
ILcdAIXMHandler
expects AIXM data element per element.
It will decode only the records it can handle and create an ILcdModel
with the decoded objects.
In order to use a handler to create a model, a user should
newModel
method or the setModelToUpdate
method,startDocument
method, startElement
method, endElement
method, endDocument
method, getModel
method or the updateModel
method
to respectively obtain the model or update a registered model.Optionally, the user can specify
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.
|
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.
|
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.
|
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 |
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.
|
String[] getElementsToBeHandled()
startElement
and
endElement
should be invoked.
These elements must be a direct child of one of the following AIXM elements:
String
array containing the elements for which the methods
startElement
and endElement
should be invoked.void startDocument()
endDocument()
void startElement(String aElementName, ILcdAssocSet aAttributes, Stack aElementStack)
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.endElement(java.lang.String, java.lang.String, java.util.Stack)
void endElement(String aElementName, String aContent, Stack aElementStack)
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.void endDocument()
startDocument()
void newModel(String aSource, ILcdAIXMErrorMessageSupport aErrorMessage)
The user should call this method before using this handler in a decoding process of an AIXM snapshot.
aSource
- the name of the source that will be handledaErrorMessage
- for each irregular situation during the decoding, a report should be added to this objectboolean setModelToUpdate(String aSource, ILcdModel aModel, ILcdAIXMErrorMessageSupport aErrorMessage)
The user should call this method before using this handler in a decoding process of an AIXM update.
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 objectvoid updateModel()
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.ILcdFeatureIndexedAnd2DBoundsIndexedModel getModel()
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.@Deprecated void setDomainFactory(ALcdAISObjectFactory aDomainFactory)
setDataObjectFactory(TLcdAISDataObjectFactory)
The given domainFactory must not be null. Note that if a data object factory is set, the domain factory will not be used.
aDomainFactory
- the domainFactory to be used to
create domain objectsgetDomainFactory()
@Deprecated ALcdAISObjectFactory getDomainFactory()
getDataObjectFactory()
setDomainFactory(com.luciad.ais.model.ALcdAISObjectFactory)
void setDataObjectFactory(TLcdAISDataObjectFactory aFactory)
The given factory must not be null.
aFactory
- the domainFactory to be used to
create domain objectsgetDataObjectFactory()
TLcdAISDataObjectFactory getDataObjectFactory()
setDataObjectFactory(TLcdAISDataObjectFactory)
void setInitialBounds(ILcdBounds aInitialBounds)
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.
aInitialBounds
- the initial bounds for the model created by this handlerILcdBounds getInitialBounds()
setInitialBounds(com.luciad.shape.ILcdBounds)
void setBoundsToFilterOn(ILcdBounds aBoundsToFilterOn)
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.
aBoundsToFilterOn
- the bounds to be used as a filterILcdBounds getBoundsToFilterOn()
setBoundsToFilterOn(com.luciad.shape.ILcdBounds)
void setAIXMModelFilter(ILcdAIXMModelFilter aFilter)
aFilter
- an ILcdAIXMModelFilter
to filter the model
objects