Package org.apache.empire.data.bean
Class BeanProperty
java.lang.Object
org.apache.empire.data.bean.BeanProperty
- All Implemented Interfaces:
Column,ColumnExpr
BeanObject
This class defines Metadata for a single property.
- Author:
- Rainer
-
Field Summary
FieldsFields inherited from interface org.apache.empire.data.Column
COLATTR_CASESENSITIVE, COLATTR_CURRENCY_CODE, COLATTR_ENUMTYPE, COLATTR_FRACTION_DIGITS, COLATTR_INTEGER_DIGITS, COLATTR_MAXVALUE, COLATTR_MINLENGTH, COLATTR_MINVALUE, COLATTR_NORMCOLUMN, COLATTR_NULLTEXT, COLATTR_NUMBER_GROUPSEP, COLATTR_NUMBER_TYPE, COLATTR_REFCOLUMNS, COLATTR_REGEXP, COLATTR_SORTDESCENDING, COLATTR_SORTEXPRESSION, COLATTR_TITLE, COLATTR_TOOLTIP, COLATTR_TYPE, NUMTYPE_CURRENCY, NUMTYPE_DECIMAL, NUMTYPE_INTEGER, NUMTYPE_PERCENT -
Constructor Summary
ConstructorsConstructorDescriptionBeanProperty(String name, DataType dataType, double size, boolean required) Constructs a bean property definitionBeanProperty(String name, DataType dataType, double size, boolean required, String controlType) Constructs a bean property definitionBeanProperty(String name, DataType dataType, double size, boolean required, String controlType, boolean readOnly) Constructs a bean property definition -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String name) Returns the value of a column attribute.Returns all metadata attributes.returns the bean class of this property.Gets the Java bean property name.Returns the columns control type.Returns the data type of the bean property.Returns the EntityType that this Column belongs toReturns the enum type for this columngetName()Returns the name of the property.Returns the list of options for this column containing all allowed field values.doublegetSize()Returns the maximum size a value for this column is allowed to have.final ColumnDeprecated.getTitle()Returns the title attribute.Returns the underlying source column (if any).booleanReturns whether or not the value for this column is auto-generatedbooleanReturns true if the values for this column are generally read only (like i.e. for sequence generated values).booleanReturns whether or not the value for this column must be supplied (i.e. it is mandatory) or not.<T extends ColumnExpr>
TsetAttribute(String name, Object value) Sets an attribute for this columnvoidsetControlType(String controlType) voidsetOptions(Options options) voidvalidateValue(Object value) Checks if the given value is a valid value for this column If not, an exception is thrown
-
Field Details
-
beanClass
-
-
Constructor Details
-
BeanProperty
public BeanProperty(String name, DataType dataType, double size, boolean required, String controlType, boolean readOnly) Constructs a bean property definition- Parameters:
name- the name of the propertydataType- the type of the propertysize- the sizerequired- flag true if requiredcontrolType- string indication which type of control to usereadOnly- flag true if read-only
-
BeanProperty
public BeanProperty(String name, DataType dataType, double size, boolean required, String controlType) Constructs a bean property definition- Parameters:
name- the name of the propertydataType- the type of the propertysize- the sizerequired- flag true if requiredcontrolType- string indication which type of control to use
-
BeanProperty
Constructs a bean property definition- Parameters:
name- the name of the propertydataType- the type of the propertysize- the sizerequired- flag true if required
-
-
Method Details
-
getEntity
Description copied from interface:ColumnReturns the EntityType that this Column belongs to -
getName
Returns the name of the property.- Specified by:
getNamein interfaceColumnExpr- Returns:
- the property name
-
getDataType
Returns the data type of the bean property.- Specified by:
getDataTypein interfaceColumnExpr- Returns:
- the property data type
- See Also:
-
getAttribute
Returns the value of a column attribute. Column attributes are used to provide metadata for a property.- Specified by:
getAttributein interfaceColumnExpr- Parameters:
name- the attribute name- Returns:
- value of the attribute if it exists or null otherwise
-
setAttribute
Sets an attribute for this column- Specified by:
setAttributein interfaceColumnExpr- Type Parameters:
T- the column expression type- Parameters:
name- the attribute namevalue- the attribute value- Returns:
- the column itself
-
getAttributes
Returns all metadata attributes.- Specified by:
getAttributesin interfaceColumn- Returns:
- set of metadata attributes
-
getTitle
Returns the title attribute.- Specified by:
getTitlein interfaceColumnExpr- Returns:
- the column title
-
getOptions
Returns the list of options for this column containing all allowed field values.- Specified by:
getOptionsin interfaceColumnExpr- Returns:
- the list of options
-
getEnumType
Returns the enum type for this column- Specified by:
getEnumTypein interfaceColumnExpr- Returns:
- the enum type
-
getControlType
Returns the columns control type. The control type is a client specific name for the type of input control that should be used to display and edit values for this column.- Specified by:
getControlTypein interfaceColumnExpr- Returns:
- the columns control type
-
getBeanPropertyName
Gets the Java bean property name. This function should return the same string as getName()- Specified by:
getBeanPropertyNamein interfaceColumnExpr- Returns:
- the name of the bean property
-
getUpdateColumn
Description copied from interface:ColumnExprReturns the underlying source column (if any). If an expression is based not based on a particutlar column this function returns null.- Specified by:
getUpdateColumnin interfaceColumnExpr- Returns:
- the column on which this expression is based or null if not applicable.
-
getSourceColumn
Deprecated.Use getUpdateColumn() instead!- Specified by:
getSourceColumnin interfaceColumnExpr
-
getSize
public double getSize()Description copied from interface:ColumnReturns the maximum size a value for this column is allowed to have.For the data type DECIMAL the size defines the scale and precision of the value.
-
isReadOnly
public boolean isReadOnly()Description copied from interface:ColumnReturns true if the values for this column are generally read only (like i.e. for sequence generated values).- Specified by:
isReadOnlyin interfaceColumn- Returns:
- Returns true if the values for this column are generally read-only
-
isAutoGenerated
public boolean isAutoGenerated()Description copied from interface:ColumnReturns whether or not the value for this column is auto-generated- Specified by:
isAutoGeneratedin interfaceColumn- Returns:
- Returns true if the value for this column is auto-generated
-
isRequired
public boolean isRequired()Description copied from interface:ColumnReturns whether or not the value for this column must be supplied (i.e. it is mandatory) or not.- Specified by:
isRequiredin interfaceColumn- Returns:
- Returns true if the value for this column must be supplied
-
validateValue
Description copied from interface:ColumnChecks if the given value is a valid value for this column If not, an exception is thrown- Specified by:
validateValuein interfaceColumn- Parameters:
value- the value to validate- Returns:
- the value the validated and possibly converted value
-
getBeanClass
returns the bean class of this property.- Returns:
- the BeanClass or
nullif BeanProperty is used 'stand alone'
-
setControlType
-
setOptions
-
setTitle
-