public class TLcdDataPropertyBuilder extends Object
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.
TLcdDataModelBuilder
,
TLcdDataTypeBuilder
Modifier and Type | Class and Description |
---|---|
static interface |
TLcdDataPropertyBuilder.PropertyAnnotationFactory<T extends ILcdAnnotation>
This factory interface offers a convenient way to annotate a property while it is being
built.
|
Modifier and Type | Method and Description |
---|---|
TLcdDataPropertyBuilder |
annotate(ILcdAnnotation aAnnotation)
Adds an annotation to the property that is being built.
|
TLcdDataPropertyBuilder |
annotateFromFactory(TLcdDataPropertyBuilder.PropertyAnnotationFactory<?> aAnnotationFactory)
Annotates the data property that is being built.
|
TLcdDataPropertyBuilder |
collectionType(TLcdDataProperty.CollectionType aCollectionType)
Sets the collection type for the property that is to be built.
|
TLcdDataPropertyBuilder |
contained(boolean aValue)
Controls if the property that is to be created should be contained in its
owning instance.
|
TLcdDataPropertyBuilder |
defaultValue(Object aValue)
Sets the default value for this property to the given value.
|
TLcdDataTypeBuilder |
getDeclaringTypeBuilder()
Returns the type builder of the type that declares the property that this builder builds.
|
String |
getName()
Returns the name of the property that is being built.
|
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. |
TLcdDataPropertyBuilder |
map(TLcdDataType aKeyType)
Marks the property to be built as a
TLcdDataProperty.CollectionType.MAP with
the type as key type. |
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. |
TLcdDataPropertyBuilder |
nullable(boolean aValue)
Controls if the property that is to be created should be nullable.
|
public TLcdDataPropertyBuilder defaultValue(Object aValue)
aValue
- the value that is to be used as defaultpublic TLcdDataPropertyBuilder nullable(boolean aValue)
aValue
- boolean that specifies if the property is to be nullablepublic String getName()
public TLcdDataTypeBuilder getDeclaringTypeBuilder()
public TLcdDataPropertyBuilder contained(boolean aValue)
aValue
- boolean that specifies if the property is to be containedpublic TLcdDataPropertyBuilder collectionType(TLcdDataProperty.CollectionType aCollectionType)
CollectionType
is null
).aCollectionType
- the CollectionType object for the propertypublic TLcdDataPropertyBuilder map(TLcdDataType aKeyType)
TLcdDataProperty.CollectionType.MAP
with
the type as key type.
The default CollectionType
is null
.aKeyType
- the type of the keys of this mappublic TLcdDataPropertyBuilder map(String aTypeName)
TLcdDataProperty.CollectionType.MAP
with
the type with the given name as key type.
The default CollectionType
is null
.aTypeName
- the name of a type of keys in the data model of this property's typepublic TLcdDataPropertyBuilder map(TLcdDataTypeBuilder aTypeBuilder)
TLcdDataProperty.CollectionType.MAP
with
the type of the given type builder as key type.
The default CollectionType
is null
.aTypeBuilder
- a builder for the type that is to be used a key typepublic TLcdDataPropertyBuilder annotate(ILcdAnnotation aAnnotation)
TLcdProperty.getAnnotation(Class<? extends ILcdAnnotation>)
.aAnnotation
- the annotation to addpublic 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.
aAnnotationFactory
- a factory that is able to create the value of the annotation