Class TLcdDataModelDescriptor
- All Implemented Interfaces:
ILcdAnnotatedElement
,ILcdDataModelDescriptor
,ILcdModelDescriptor
,Serializable
- Direct Known Subclasses:
ALcdASDIModelDescriptor
,ALcdMagneticNorthModelDescriptor
,TLcdAIXM51ModelDescriptor
,TLcdAreaMinimumAltitudeModelDescriptor
,TLcdFinalApproachPathModelDescriptor
,TLcdGeoJsonModelDescriptor
,TLcdGMLModelDescriptor
,TLcdKML22ModelDescriptor
,TLcdMinimumSectorAltitudeModelDescriptor
,TLcdNVGModelDescriptor
,TLcdPanoramaModelDescriptor
,TLcdS57LevelModelDescriptor
,TLcdSIGWXModelDescriptor
ILcdDataModelDescriptor
. This class also implements
ILcdAnnotatedElement
to make it easily extensible.- Since:
- 10.0
- See Also:
-
Constructor Summary
ConstructorDescriptionTLcdDataModelDescriptor
(TLcdDataModel aDataModel) Deprecated.TLcdDataModelDescriptor
(TLcdDataModel aDataModel, Collection<TLcdDataType> aModelElementTypes, Collection<TLcdDataType> aModelTypes) Constructs a newTLcdDataModelDescriptor
with the given arguments and default source name, type name and display name.TLcdDataModelDescriptor
(String aSourceName, String aTypeName, String aDisplayName, TLcdDataModel aDataModel) Deprecated.Use a constructor which specifies the model element types instead (eitherTLcdDataModelDescriptor(TLcdDataModel, Collection, Collection)
orTLcdDataModelDescriptor(String, String, String, TLcdDataModel, Collection, Collection)
).TLcdDataModelDescriptor
(String aSourceName, String aTypeName, String aDisplayName, TLcdDataModel aDataModel, Collection<TLcdDataType> aModelElementTypes, Collection<TLcdDataType> aModelTypes) Constructs a newTLcdDataModelDescriptor
with the given arguments. -
Method Summary
Modifier and TypeMethodDescription<T extends ILcdAnnotation>
TaddAnnotation
(ILcdAnnotation aAnnotation) Adds the given annotation to this element.<T extends ILcdAnnotation>
TgetAnnotation
(Class<T> aAnnotationClass) Returns the element's annotation for the specified class if such an annotation is present, else null.Returns all annotations present on this element as an unmodifiable collection.Returns the data model that describes the elements of the model.Returns a set containing all the data types of which instances can be elements in the model associated with this descriptor.Returns a set containing all the types of which instances can be used (including both top-level elements and child objects) in the model associated with this descriptor.boolean
isAnnotationPresent
(Class<? extends ILcdAnnotation> aAnnotationClass) Returns true if an annotation for the specified class is present on this element, else false.<T extends ILcdAnnotation>
TremoveAnnotation
(Class<T> aAnnotationClass) Removes the annotation of the given class from this element.Methods inherited from class com.luciad.model.TLcdModelDescriptor
getDisplayName, getSourceName, getTypeName, setDisplayName, setSourceName, setTypeName, sourceNameToDisplayName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelDescriptor
getDisplayName, getSourceName, getTypeName
-
Constructor Details
-
TLcdDataModelDescriptor
Deprecated.Use a constructor which specifies the model element types instead (eitherTLcdDataModelDescriptor(TLcdDataModel, Collection, Collection)
orTLcdDataModelDescriptor(String, String, String, TLcdDataModel, Collection, Collection)
).Constructs a newTLcdDataModelDescriptor
with default source name, type name, and display name. The model types and model element types arenull
.- Parameters:
aDataModel
- the data model for this descriptor
-
TLcdDataModelDescriptor
@Deprecated public TLcdDataModelDescriptor(String aSourceName, String aTypeName, String aDisplayName, TLcdDataModel aDataModel) Deprecated.Use a constructor which specifies the model element types instead (eitherTLcdDataModelDescriptor(TLcdDataModel, Collection, Collection)
orTLcdDataModelDescriptor(String, String, String, TLcdDataModel, Collection, Collection)
).Constructs a newTLcdDataModelDescriptor
with the given source name, type name, display name and data model. The model types and model element types arenull
.- Parameters:
aSourceName
- the name of the data source.aTypeName
- the type name of the data source.aDisplayName
- the display name of the data source.aDataModel
- the data model of the data source
-
TLcdDataModelDescriptor
public TLcdDataModelDescriptor(String aSourceName, String aTypeName, String aDisplayName, TLcdDataModel aDataModel, Collection<TLcdDataType> aModelElementTypes, Collection<TLcdDataType> aModelTypes) Constructs a newTLcdDataModelDescriptor
with the given arguments.- Parameters:
aSourceName
- the name of the data source.aTypeName
- the type name of the data source.aDisplayName
- the display name of the data source.aDataModel
- the data model of the data sourceaModelElementTypes
- a collection containing all the data types of which instances can be elements in the model associated with this descriptor. Typically this is only a single type. It is not recommended to mix multiple element types in the same model, as any code dealing with that model will need code paths for each of those element types instead of a single code path. If you passnull
, thedata model declared types
are used.aModelTypes
- a collection containing all types which are used within the model (both model element types and other types which are nested more deeply within the model data structure). If you passnull
, thedata model types
are used.
-
TLcdDataModelDescriptor
public TLcdDataModelDescriptor(TLcdDataModel aDataModel, Collection<TLcdDataType> aModelElementTypes, Collection<TLcdDataType> aModelTypes) Constructs a newTLcdDataModelDescriptor
with the given arguments and default source name, type name and display name. The values ofaDataModel.getName()
andaDataModel.getDisplayName()
are used as type name and display name of this model descriptor.- Parameters:
aDataModel
- the data model of the data sourceaModelElementTypes
- a collection containing all the data types of which instances can be elements in the model associated with this descriptor. Typically this is only a single type. It is not recommended to mix multiple element types in the same model, as any code dealing with that model will need code paths for each of those element types instead of a single code path. If you passnull
, thedata model declared types
are used.aModelTypes
- a collection containing all types which are used within the model (both model element types and other types which are nested more deeply within the model data structure). If you passnull
, thedata model types
are used.
-
-
Method Details
-
getAnnotation
Description copied from interface:ILcdAnnotatedElement
Returns the element's annotation for the specified class if such an annotation is present, else null.
Note that the exact annotation class needs to be passed as parameter. In other words, in case the element is only annotated with instances of subclasses of the given annotation class,
null
is returned.- Specified by:
getAnnotation
in interfaceILcdAnnotatedElement
- Parameters:
aAnnotationClass
- - the Class object corresponding to the annotation type- Returns:
- this element's annotation for the specified annotation class if present on this element, else null
-
getAnnotations
Description copied from interface:ILcdAnnotatedElement
Returns all annotations present on this element as an unmodifiable collection.- Specified by:
getAnnotations
in interfaceILcdAnnotatedElement
- Returns:
- all annotations present on this element
-
isAnnotationPresent
Description copied from interface:ILcdAnnotatedElement
Returns true if an annotation for the specified class is present on this element, else false. This method is designed primarily for convenient access to marker annotations.
Note that the exact annotation class needs to be passed as parameter. In other words, in case the element is only annotated with instances of subclasses of the given annotation class,
false
is returned.- Specified by:
isAnnotationPresent
in interfaceILcdAnnotatedElement
- Parameters:
aAnnotationClass
- the Class object corresponding to the annotation class- Returns:
- true if an annotation for the specified annotation class is present on this element, else false
-
addAnnotation
Description copied from interface:ILcdAnnotatedElement
Adds the given annotation to this element.- Specified by:
addAnnotation
in interfaceILcdAnnotatedElement
- Parameters:
aAnnotation
- the annotation to add- Returns:
- the previous annotation of the same class as the given annotation associated with this element, or null if there was no annotation for that class.
-
removeAnnotation
Description copied from interface:ILcdAnnotatedElement
Removes the annotation of the given class from this element.
Note that the exact annotation class needs to be passed as parameter. In other words, in case the element is only annotated with instances of subclasses of the given annotation class, nothing is removed and
null
is returned.- Specified by:
removeAnnotation
in interfaceILcdAnnotatedElement
- Parameters:
aAnnotationClass
- the class of annotation to remove- Returns:
- the annotation of the given class that was associated with this element, or null if there was no annotation for that class.
-
getDataModel
Description copied from interface:ILcdDataModelDescriptor
Returns the data model that describes the elements of the model. Note that not necessarily all data in the model will be of a type of this data model. Very likely, types from the dependencies of the returned data model are used as well.
In case the model accepts objects from multiple data models, an anonymous data model that depends on all these data models should be returned (see
TLcdDataModelBuilder.createAnonymousDataModel(java.util.Collection)
).- Specified by:
getDataModel
in interfaceILcdDataModelDescriptor
- Returns:
- the data model that describes the elements of the model
-
getModelElementTypes
Description copied from interface:ILcdDataModelDescriptor
Returns a set containing all the data types of which instances can be elements in the model associated with this descriptor. Implementations are free to limit the result to only include the types of which there are actually elements in the model; but they are not required to do so.
Implementations should return
null
in case they don't know which element types are present in the model.For each element of the model associated with this model descriptor, the following holds true :
getModelElementTypes().contains( element.getDataType() )
.- Specified by:
getModelElementTypes
in interfaceILcdDataModelDescriptor
- Returns:
- a set containing all the data types of which instances can be elements in the model associated with this descriptor
-
getModelTypes
Description copied from interface:ILcdDataModelDescriptor
Returns a set containing all the types of which instances can be used (including both top-level elements and child objects) in the model associated with this descriptor. Implementations are free to limit the result to only include the types of which there are actually instances in the model; but they are not required to do so.
A simple and correct implementation would be to return
getDataModel().getTypes()
. Implementations are encouraged to return a subset of this set if they can do so without spending an unreasonable amount of resources.Implementations should return
null
in case they don't know which types are present in the model.- Specified by:
getModelTypes
in interfaceILcdDataModelDescriptor
- Returns:
- a set containing all the data types of which instances can be used in the model associated with this descriptor
-
TLcdDataModelDescriptor(TLcdDataModel, Collection, Collection)
orTLcdDataModelDescriptor(String, String, String, TLcdDataModel, Collection, Collection)
).