|
LuciadCPillar C# 2026.1.02
|
Builder that allows DataType instances to be created.
More...
Public Member Functions | |
| Builder (Luciad.Datamodels.DataType.Builder other) | |
| Copy constructor. | |
| Luciad.Datamodels.DataType.Builder | AddAnnotation (Luciad.Datamodels.DataAnnotation annotation) |
| The annotation to add to the data type under construction. | |
| Luciad.Datamodels.DataType.Builder | AddAnnotation (Luciad.Datamodels.IDataAnnotationFactory annotationFactory) |
| Adds an annotation factory that is invoked when build is called. | |
| Luciad.Datamodels.DataType.Builder | AddBooleanProperty (string name) |
Adds a scalar property with the given name and DataType.getBooleanType() as its value type. | |
| Luciad.Datamodels.DataType.Builder | AddDoubleProperty (string name) |
Adds a scalar property with the given name and DataType.getDoubleType() as its value type. | |
| Luciad.Datamodels.DataType.Builder | AddFloatProperty (string name) |
Adds a scalar property with the given name and DataType.getFloatType() as its value type. | |
| Luciad.Datamodels.DataType.Builder | AddGeometryProperty (string name, bool mainGeometry) |
Adds a property with the given name and DataType.getGeometryType() as its value type, marking it as this type's main geometry when mainGeometry is true. | |
| Luciad.Datamodels.DataType.Builder | AddIntProperty (string name) |
Adds a scalar property with the given name and DataType.getIntType() as its value type. | |
| Luciad.Datamodels.DataType.Builder | AddLongProperty (string name) |
Adds a scalar property with the given name and DataType.getLongType() as its value type. | |
| Luciad.Datamodels.DataType.Builder | AddProperty (Luciad.Datamodels.DataProperty property) |
| The property to add to the data type under construction. | |
| Luciad.Datamodels.DataType.Builder | AddStringProperty (string name) |
Adds a scalar property with the given name and DataType.getStringType() as its value type. | |
| Luciad.Datamodels.DataType | Build () |
| Build the data type, including the properties and annotations that were added to this builder. | |
| void | Dispose () |
| Luciad.Datamodels.DataType.Builder | Name (string name) |
| The name of the new data type. | |
Builder that allows DataType instances to be created.
Typical usage would be create a DataType.Builder using DataType.NewBuilder, specifying the data type's name. Then add the necessary DataProperty(s) and finally build() the data type. The following snippet shows how this is done for a simple example data type:
|
inline |
Copy constructor.
| other | the builder to copy. |
|
inline |
The annotation to add to the data type under construction.
| annotation | the annotation to add to the data type under construction. |
| System.ArgumentNullException | when a null value is passed. |
|
inline |
Adds an annotation factory that is invoked when build is called.
The factory is provided with the type that is being built. This can be useful when the created annotation needs access to the type, for instance when the annotation requires a DataPropertyPath.
An example usage is:
| annotationFactory | the factory object. |
| System.ArgumentNullException | when a null value is passed. |
|
inline |
Adds a scalar property with the given name and DataType.getBooleanType() as its value type.
Use addProperty() for anything more specific.
| name | the name of the property. |
|
inline |
Adds a scalar property with the given name and DataType.getDoubleType() as its value type.
Use addProperty() for anything more specific.
| name | the name of the property. |
|
inline |
Adds a scalar property with the given name and DataType.getFloatType() as its value type.
Use addProperty() for anything more specific.
| name | the name of the property. |
|
inline |
Adds a property with the given name and DataType.getGeometryType() as its value type, marking it as this type's main geometry when mainGeometry is true.
If the data type has a single geometry, always pass true. A type needs a main geometry for Feature.findGeometry() and for the default painters to know which property holds the shape to draw. Only a type with several geometry properties needs false, for the ones that are not its main geometry.
For the main geometry, a GeometryDataAnnotation for the property is wired internally, so there is no need to create that annotation through an IDataAnnotationFactory.
A data type has at most one main geometry. Calling this again with true throws an exception, and build() additionally rejects a type of which the second GeometryDataAnnotation came from addAnnotation() rather than from here.
The annotated case is shorthand for adding the property and then attaching its GeometryDataAnnotation through an IDataAnnotationFactory, shown below:
| name | the name of the geometry property. |
| mainGeometry | whether the property is this type's main geometry, annotated with a GeometryDataAnnotation. Pass true unless the data type has more than one geometry property. |
| System.InvalidOperationException | if this data type already has a main geometry and mainGeometry is true. |
|
inline |
Adds a scalar property with the given name and DataType.getIntType() as its value type.
Use addProperty() for anything more specific.
| name | the name of the property. |
|
inline |
Adds a scalar property with the given name and DataType.getLongType() as its value type.
Use addProperty() for anything more specific.
| name | the name of the property. |
|
inline |
The property to add to the data type under construction.
| property | the property to add to the data type under construction. |
|
inline |
Adds a scalar property with the given name and DataType.getStringType() as its value type.
Use addProperty() for anything more specific.
| name | the name of the property. |
|
inline |
Build the data type, including the properties and annotations that were added to this builder.
After calling this function, this builder should no longer be used.
| System.InvalidOperationException | If not all mandatory parameters are set, or if the data type ends up with more than one GeometryDataAnnotation. A data type has at most one main geometry. |
|
inline |
|
inline |
The name of the new data type.
Calling this function is mandatory.
| name | name of the new data type. |