Class TLcdDataPropertyBuilder

java.lang.Object
com.luciad.datamodel.TLcdDataPropertyBuilder

public class TLcdDataPropertyBuilder extends Object
Builder that allows the creation of TLcdDataProperty instances for a certain data model.

Instances of this class can be created via the TLcdDataTypeBuilder in which the property is to be defined.

Since:
10.0
See Also:
  • Method Details

    • defaultValue

      public TLcdDataPropertyBuilder defaultValue(Object aValue)
      Sets the default value for this property to the given value.
      Parameters:
      aValue - the value that is to be used as default
      Returns:
      this
    • nullable

      public TLcdDataPropertyBuilder nullable(boolean aValue)
      Controls if the property that is to be created should be nullable. A property that is nullable is not mandatory. By default a property is nullable.
      Parameters:
      aValue - boolean that specifies if the property is to be nullable
      Returns:
      this
    • sourceName

      public TLcdDataPropertyBuilder sourceName(String aSourceName)
      Set the original name of this property, as defined in the source data. This may differ from the actual name of this property within the TLcdDataType, because that name can contain only alphanumeric characters and underscores and may need to be sanitized. Calling this method is optional. By default, the source name is the same as getName().
      Returns:
      this property builder
      Since:
      2024.0
    • getName

      public String getName()
      Returns the name of the property that is being built.
      Returns:
      the name of the property that is being built
    • getDeclaringTypeBuilder

      public TLcdDataTypeBuilder getDeclaringTypeBuilder()
      Returns the type builder of the type that declares the property that this builder builds.
      Returns:
      the type builder of the type that declares the property that this builder builds
    • contained

      public TLcdDataPropertyBuilder contained(boolean aValue)
      Controls if the property that is to be created should be contained in its owning instance. The default value for containment is true.
      Parameters:
      aValue - boolean that specifies if the property is to be contained
      Returns:
      this
    • collectionType

      public TLcdDataPropertyBuilder collectionType(TLcdDataProperty.CollectionType aCollectionType)
      Sets the collection type for the property that is to be built. By default a property is single valued (CollectionType is null).
      Parameters:
      aCollectionType - the CollectionType object for the property
      Returns:
      this
    • map

      public TLcdDataPropertyBuilder map(TLcdDataType aKeyType)
      Marks the property to be built as a TLcdDataProperty.CollectionType.MAP with the type as key type. The default CollectionType is null.
      Parameters:
      aKeyType - the type of the keys of this map
      Returns:
      this
    • map

      public TLcdDataPropertyBuilder map(String aTypeName)
      Marks the property to be built as a TLcdDataProperty.CollectionType.MAP with the type with the given name as key type. The default CollectionType is null.
      Parameters:
      aTypeName - the name of a type of keys in the data model of this property's type
      Returns:
      this
    • map

      public TLcdDataPropertyBuilder map(TLcdDataTypeBuilder aTypeBuilder)
      Marks the property to be built as a TLcdDataProperty.CollectionType.MAP with the type of the given type builder as key type. The default CollectionType is null.
      Parameters:
      aTypeBuilder - a builder for the type that is to be used a key type
      Returns:
      this
    • annotate

      public TLcdDataPropertyBuilder annotate(ILcdAnnotation aAnnotation)
      Adds an annotation to the property that is being built. The annotation can be retrieved on the property using TLcdProperty.getAnnotation(Class<? extends ILcdAnnotation>).
      Parameters:
      aAnnotation - the annotation to add
      Returns:
      this
    • annotateFromFactory

      public TLcdDataPropertyBuilder annotateFromFactory(TLcdDataPropertyBuilder.PropertyAnnotationFactory<?> aAnnotationFactory)

      Annotates the data property that is being built. The actual annotation is the return value of TLcdDataPropertyBuilder.PropertyAnnotationFactory.createAnnotation(TLcdDataProperty). Once the data model is created, the annotation can be retrieved using TLcdDataProperty.getAnnotation(Class).

      The use of the factory makes it possible to refer to the property from inside the annotation. The actual annotation value will be created at the end of the initialization of the data model.

      Parameters:
      aAnnotationFactory - a factory that is able to create the value of the annotation
      Returns:
      this