Class ALcdGMLTypeMappingAnnotation

All Implemented Interfaces:
Direct Known Subclasses:
TLcdGML2TypeMappingAnnotation, TLcdGML31TypeMappingAnnotation, TLcdGML32TypeMappingAnnotation

public abstract class ALcdGMLTypeMappingAnnotation extends Object implements ILcdAnnotation
Maps and transforms a source data type to a given (GML) target data type.
If this annotation is present on a data type, TLcdGMLTransformer will map and transform that type to and from the given target type using the given transformation.

As an example, you could define and use a GregorianCalender type in your data model. You can map the type to an XML date type as follows:

 TLcdDataModel dataModel = dataModelBuilder.createDataModel();
 TLcdDataType dateType = dataModel.getDeclaredType("DateType");
 dateType.addAnnotation(new TLcdGML32TypeMappingAnnotation(
   TLcdXMLBuiltInDataTypes.DateTime, new ALcdObjectTransformation() {

     public Object transform(Object aValue, Map<Object, Object> aContext) {
       return DatatypeFactory.newInstance().newXMLGregorianCalendar((GregorianCalendar) aValue);

     protected Object invert(Object aValue, Map<Object, Object> aContext) {
       return ((XMLGregorianCalendar) aValue).toGregorianCalendar();
See Also:
  • Constructor Details

    • ALcdGMLTypeMappingAnnotation

      public ALcdGMLTypeMappingAnnotation(TLcdDataType aType, ILcdObjectTransformation aTransformation)
      Creates a new instance. The data model that declares aType should be annotated with TLcdXMLSchemaMappingAnnotation and TLcdXMLSchemaTypeMappingAnnotation such that instances can be properly marshalled from and to XML.
      aType - the type that is the GML representation of the type to which this annotation is added
      aTransformation - a transformation that can transform instances from the annotated type to the given type
  • Method Details

    • getType

      public TLcdDataType getType()
      Returns the GML representation of the annotated type.
      the GML representation of the annotated type
    • getTransformation

      public ILcdObjectTransformation getTransformation()
      Returns the transformation that is capable of transforming instances of the annotated type to instances of getType().
      the transformation from annotated type to GML type