Class DtSketchBuilder
java.lang.Object
io.vertigo.studio.notebook.domain.DtSketchBuilder
- All Implemented Interfaces:
io.vertigo.core.lang.Builder<DtSketch>
This class must be used to build a DtSketch.
Each dtSketch must have a name following this pattern DT_XXX_YYYY
- Author:
- pchretien, mlaroche
-
Method Summary
Modifier and TypeMethodDescriptionaddComputedField(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, ComputedExpression computedExpression) Adds a computed field.addDataField(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, boolean persistent) Adds a common data field.addForeignKey(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, String fkDtSketchName) Adds a field linked to another dtSketch (aka foreign key).addIdField(String fieldName, String label, DomainSketch domainSketch) Adds an ID field.build()withDataSpace(String dataSpace) Sets the dataSpace to which the dtSketch belongs.withDisplayField(String displayFieldName) Specifies which field to be used for displaywithFragment(DtSketch fragment) Sets fragmentwithHandleField(String handleFieldName) Specifies which field to be used for handlewithKeyField(String keyFieldName) Specifies which field to be used for key to distinguish elements in a collectionwithPackageName(String packageName) Sets packageNamewithSortField(String sortFieldName) Specifies which field to be used for sortingwithStereoType(StudioStereotype stereotype) Sets the stereotype of the dtSketch.
-
Method Details
-
withPackageName
Sets packageName- Parameters:
packageName- the name of the package (nullable)- Returns:
- this builder
-
withFragment
Sets fragment- Parameters:
fragment- Persistent root DtSketch for this fragment- Returns:
- this builder
-
withStereoType
Sets the stereotype of the dtSketch.- Parameters:
stereotype- the stereotype of the dtSketch- Returns:
- this builder
-
addForeignKey
public DtSketchBuilder addForeignKey(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, String fkDtSketchName) Adds a field linked to another dtSketch (aka foreign key).- Parameters:
fieldName- the name of the fieldlabel- the label of the fielddomainSketch- the domain of the fieldfkDtSketchName- the name of the linked definition- Returns:
- this builder
-
addComputedField
public DtSketchBuilder addComputedField(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, ComputedExpression computedExpression) Adds a computed field.- Parameters:
fieldName- the name of the fieldlabel- the label of the fielddomainSketch- the domain of the fieldcomputedExpression- the expression use to compute the field- Returns:
- this builder
-
addDataField
public DtSketchBuilder addDataField(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, boolean persistent) Adds a common data field.- Parameters:
fieldName- the name of the fieldlabel- the label of the fielddomainSketch- the domain of the fieldpersistent- if the fiels is persistent- Returns:
- this builder
-
addIdField
Adds an ID field. This field is required.- Parameters:
fieldName- the name of the fieldlabel- the label of the fielddomainSketch- the domain of the field- Returns:
- this builder
-
withDataSpace
Sets the dataSpace to which the dtSketch belongs.- Parameters:
dataSpace- the dataSpace to which the DtSketch is mapped.- Returns:
- this builder
-
withSortField
Specifies which field to be used for sorting- Parameters:
sortFieldName- fieldName to use- Returns:
- this builder
-
withDisplayField
Specifies which field to be used for display- Parameters:
displayFieldName- fieldName to use- Returns:
- this builder
-
withHandleField
Specifies which field to be used for handle- Parameters:
handleFieldName- fieldName to use- Returns:
- this builder
-
withKeyField
Specifies which field to be used for key to distinguish elements in a collection- Parameters:
keyFieldName- fieldName to use- Returns:
- this builder
-
build
- Specified by:
buildin interfaceio.vertigo.core.lang.Builder<DtSketch>
-