Interface BeanElement
public interface BeanElement
This interface allows setting properties of a data model element.
- Since:
- 5.8.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddFacetConstraint
(Class<? extends Constraint<?>> aConstraintClass) Adds a programmatic constraint to this element.addFacetDatasetSet
(AdaptationHome aDataspace) Adds a dataset constraint to this element.addFacetDatasetSet
(Path aPath) Adds a dataset constraint to this element.Adds a dataspace constraint to this element.addFacetEnumeration
(Nomenclature<?> aNomenclature) Sets a nomenclature for this element.addFacetEnumeration
(List<?> anEnumeration) Sets a list of possible values for this element.addFacetFractionDigits
(int aValue) Sets the number of fraction digits for decimal types.addFacetLength
(int aValue) Sets the exact number of characters required for this element.addFacetMax
(Object aBoundaryValue, boolean isBoundaryExcluded) Sets the maximum value for an element.addFacetMaxLength
(int aValue) Sets the maximum number of characters required for this element.addFacetMin
(Object aBoundaryValue, boolean isBoundaryExcluded) Sets the minimum value for an element.addFacetMinLength
(int aValue) Sets the minimum number of characters required for this element.addFacetPattern
(String aPattern) Sets a pattern that the value of the field must match.addFacetTableRef
(AdaptationTable aTable) Adds a table reference constraint to this element.addFacetTotalDigits
(int aValue) Sets the maximum number of digits for integer or decimal types.void
setDefaultCollapseMode
(boolean isCollapsed) Sets the default collapsed mode.void
setDefaultValue
(Object aDefaultValue) Sets the default value.void
setDefaultViewMode
(DefaultViewMode aDefaultViewMode) Sets the default view mode.void
setDescription
(UserMessage aDescription) Sets the localized description for this element.void
setDescription
(String aDescription) Sets the description for this element.void
setDisableTrimAtUserInput
(boolean disableTrim) Specifies if leading and trailing whitespaces must be preserved upon user input.void
setLabel
(UserMessage aLabel) Sets the localized label for this element.void
Sets the label for this element.void
setMaxOccurs
(int maxOccurs) Sets the maximum number of occurrences for this element.void
Removes the maximum number of occurrences for this element.void
setMinOccurs
(int minOccurs) Sets the minimum number of occurrences for this element.void
setMinOccursErrorMessage
(UserMessage anErrorMessage) Sets the localized error message to display when the minimum number of occurrences check failed.void
setMinOccursErrorMessage
(String anErrorMessage) Sets the error message to display when the minimum number of occurrences check failed.void
setUIBean
(Class<? extends UIBeanEditor> aUIBeanClass) Deprecated.void
setWidget
(Class<? extends UIWidgetFactory<?>> aWidgetFactoryClass) Sets the widget for this element.
-
Method Details
-
setDefaultValue
Sets the default value.- Parameters:
aDefaultValue
- the default value. It must be compatible with the element's type.
-
setLabel
Sets the label for this element.- Parameters:
aLabel
- the label for this element.
-
setLabel
Sets the localized label for this element.- Parameters:
aLabel
- the label for this element.
-
setDescription
Sets the description for this element.- Parameters:
aDescription
- the description for this element.
-
setDescription
Sets the localized description for this element.- Parameters:
aDescription
- the description for this element.
-
setMinOccurs
void setMinOccurs(int minOccurs) Sets the minimum number of occurrences for this element. Default is0
.- Parameters:
minOccurs
- the minimum number of occurrences for this element.
-
setMinOccursErrorMessage
Sets the error message to display when the minimum number of occurrences check failed. If none is set, a default message will be displayed.- Parameters:
anErrorMessage
- the error message.
-
setMinOccursErrorMessage
Sets the localized error message to display when the minimum number of occurrences check failed. If none is set, a default message will be displayed.- Parameters:
anErrorMessage
- the error message.
-
setMaxOccurs
void setMaxOccurs(int maxOccurs) Sets the maximum number of occurrences for this element. Default is1
.- Parameters:
maxOccurs
- the maximum number of occurrences for this element.
-
setMaxOccursAsUnbounded
void setMaxOccursAsUnbounded()Removes the maximum number of occurrences for this element. -
addFacetLength
Sets the exact number of characters required for this element. This facet is supported only for some element types.- Parameters:
aValue
- the exact number of characters for this element.- Returns:
- the new facet.
-
addFacetMinLength
Sets the minimum number of characters required for this element. This facet is supported only for some element types.- Parameters:
aValue
- the minimum number of characters for this element.- Returns:
- the new facet.
-
addFacetMaxLength
Sets the maximum number of characters required for this element. This facet is supported only for some element types.- Parameters:
aValue
- the maximum number of characters for this element.- Returns:
- the new facet.
-
addFacetMin
Sets the minimum value for an element. This facet is supported only for some element types.- Parameters:
aBoundaryValue
- the maximum value. It must be compatible with the element's type.isBoundaryExcluded
- must betrue
if@aBoundaryValue
if not a valid value.- Returns:
- the new facet.
-
addFacetMax
Sets the maximum value for an element. This facet is supported only for some element types.- Parameters:
aBoundaryValue
- the maximum value. It must be compatible with the element's type.isBoundaryExcluded
- must betrue
if@aBoundaryValue
if not a valid value.- Returns:
- the new facet.
-
addFacetTotalDigits
Sets the maximum number of digits for integer or decimal types.- Parameters:
aValue
- the maximum number of digits.- Returns:
- the new facet.
-
addFacetFractionDigits
Sets the number of fraction digits for decimal types.- Parameters:
aValue
- the maximum number of digits.- Returns:
- the new facet.
-
addFacetPattern
Sets a pattern that the value of the field must match.- Parameters:
aPattern
- the regular expression pattern.- Returns:
- the new facet.
-
addFacetConstraint
Adds a programmatic constraint to this element.- Parameters:
aConstraintClass
- the constraint class to add to this element. The class must extend Constraint or ConstraintEnumeration.- Returns:
- the new facet.
- See Also:
-
addFacetTableRef
Adds a table reference constraint to this element.- Parameters:
aTable
- table that is referenced by this element.- Returns:
- the new facet.
-
addFacetEnumeration
Sets a nomenclature for this element.One may consider using instead a enumeration constraint.
- Parameters:
aNomenclature
- A collection of possible values.- Returns:
- the new facet.
- See Also:
-
addFacetEnumeration
Sets a list of possible values for this element.One may consider using instead a enumeration constraint.
- Parameters:
anEnumeration
- A collection of possible values.- Returns:
- the new facet.
- Since:
- 6.1.1
- See Also:
-
addFacetDataspaceSet
BeanFacetDataspaceSet addFacetDataspaceSet()Adds a dataspace constraint to this element.- Returns:
- the new facet.
-
addFacetDatasetSet
Adds a dataset constraint to this element.- Parameters:
aDataspace
- a dataspace. Can be a branch or a snapshot.- Returns:
- the new facet.
-
addFacetDatasetSet
Adds a dataset constraint to this element.- Parameters:
aPath
- a path to the value that holds the dataspace key. The path must be relative and is resolved against the current node.- Returns:
- the new facet.
-
setDefaultCollapseMode
void setDefaultCollapseMode(boolean isCollapsed) Sets the default collapsed mode. Should be used only for a complex element. Default isfalse
.- Parameters:
isCollapsed
- iftrue
, the group will be collapsed by default. Iffalse
, the group will be expanded by default.
-
setDefaultViewMode
Sets the default view mode. Should be used only for a complex element or an association. Default isDefaultViewMode.DEFAULT
.- Since:
- 6.1.0
-
setDisableTrimAtUserInput
void setDisableTrimAtUserInput(boolean disableTrim) Specifies if leading and trailing whitespaces must be preserved upon user input. Whitespaces are by default always trimmed upon user input.- Since:
- 6.1.0
-
setUIBean
Deprecated.Sets the UI bean for this element.This method allows to reuse existing UI beans but is deprecated because one should consider the porting of UI beans to the new custom widget API.
- Parameters:
aUIBeanClass
- the JavaBean class for the UI bean. This class must extend the class UIBeanEditor.
-
setWidget
Sets the widget for this element.- Parameters:
aWidgetFactoryClass
- the Java bean class for the widget. This class must implement the interface UIWidgetFactory.
-