public class TLcdGMLTransformer extends TLcdTransformer
TLcdTransformer can transforms objects from a given source
data model into GML and vice versa. Note that the inverse transformation is only
supported for source data models that are editable (this means that new instances
of their types can be created and all properties can be set).
This class can also write out the GML application schema
according to which the transformation is done.
New instances of this class are created using the
This builder can be used to configure the GML transformation. It can for instance
be used to specify the GML version and whether or not a Simple Feature Profile
should be used.
More fine-grained customization of the GML transformation is possible by
adding appropriate annotations
on the source data model. The abstract base classes of these annotation classes
(such as for instance
ALcdGMLNameAnnotation) can be found in this package.
Version specific concrete extensions (such as for instance
TLcdGML32NameAnnotation) can be found
in separate packages grouped by version.
|Modifier and Type||Method and Description|
Creates a transformation context and configures it with the given model reference.
Returns the source data model.
Returns the target data model.
Transforms the given object of the specified type with the given transformation context.
Writes out the GML application schema to the given output stream.
Writes out the GML application schema to the given XMLStreamWriter.
createTransformationContext, getInverse, getProvider, transform, transform, transformTo, transformTo, transformTo
public TLcdDataModel getSourceDataModel()
public TLcdDataModel getTargetDataModel()
TLcdGML32DataTypes.getDataModel(). Source data objects are transformed into instances of the target data model.
public void writeSchema(java.io.OutputStream aOutputStream) throws java.io.IOException
aOutputStream- the output stream onto which the schema is to be written
public void writeSchema(javax.xml.stream.XMLStreamWriter aStreamWriter) throws javax.xml.stream.XMLStreamException
aStreamWriter- the stream writer to use
public java.util.Map<java.lang.Object,java.lang.Object> createTransformationContext(ILcdModelReference aModelReference)
ILcdShapeinstances into GML geometries. In GML, all geometries require a model reference. Because LuciadLightspeed
ILcdShapeimplementations don't expose this model reference, the model reference needs to be provided separately in the transformation context.
aModelReference- the model reference of the shapes that are to be transformed
public java.lang.Object transform(java.lang.Object aObject, TLcdDataType aType, java.util.Map<java.lang.Object,java.lang.Object> aContext)
Transforms the given object of the specified type with the given transformation context.The object is assumed to be of the given type. The transformer will look in its provider for a transformation that can transform objects of the given type. If one such transformation is found, the object is transformed using that transformation. Otherwise an
IllegalArgumentExceptionis thrown to indicate that the object can't be transformed.
Note that this method is typically called for
objects that do not implement
ILcdDataObject. It allows for instance
to transform string values into integers.