org.pm4j.core.pm.annotation
Annotation Type PmAttrCfg


@Retention(value=RUNTIME)
@Target(value={TYPE,FIELD})
public @interface PmAttrCfg

Name of the field to address.

Author:
olaf boede

Optional Element Summary
 PmAttrCfg.AttrAccessKind accessKind
           
 java.lang.Class<?> beanInfoClass
          Supports usage of JSR-303 bean validation annotations of a related bean class.
 java.lang.String beanInfoField
          Allows to specify the name of the field to read JSR-303 validation information from.
It is not required to define this if the PM attribute and the related field have the same name.
 boolean checkValueChangeOnStringInput
          Defines value change detection on string level.
If set to true a difference between the current string representation and the value provided by the UI will be used to detect a value change.
This will usually only be done on the native value representation.
 java.lang.String defaultPath
          May be specified alternatively to defaultValue().
 java.lang.String defaultValue
           
 java.lang.String formatResKey
           
 boolean hideWhenEmpty
           
 int maxLen
           
 int minLen
           
 boolean readOnly
           
 boolean required
           
 java.lang.String valuePath
           
 

valuePath

public abstract java.lang.String valuePath
Returns:
An optional expression that describes how to access the attribute value.

TODO: document the format and provide an example.

Default:
""

hideWhenEmpty

public abstract boolean hideWhenEmpty
Returns:
true when only field with values that are not empty should be shown.
Default value is false.
Default:
false

required

public abstract boolean required
Returns:
true when the field has to be filled on each data entry form.
Default:
false

readOnly

public abstract boolean readOnly
Returns:
true for attributes that can't be set..
Default:
false

maxLen

public abstract int maxLen
Returns:
maximal string length.
Default:
-1

minLen

public abstract int minLen
Returns:
minimal string length.
Default:
0

defaultValue

public abstract java.lang.String defaultValue
Returns:
The default to be assigned to the attribute when the value of the attribute is null.
Default:
""

beanInfoClass

public abstract java.lang.Class<?> beanInfoClass
Supports usage of JSR-303 bean validation annotations of a related bean class.

If the attribute is simply bound to a corresponding bean attribute having the same name, the JSR-303 annotations of the bound field are considered automatically for the attribute.
But if the field is somehow bound to a field of a different bean class (e.g. by value expression or getBackingValue implementation), the framework can't access these definitions.
This annotation may be used to provides a reference to a class that defines JSR-303 restrictions.
The annotation attribute beanInfoField() allows to specify the field with the JSR-303 restriction definition. The beanInfoField() definition is not required if the field has the same name as this attribute.

Returns:
The class that provides the related JSR-303 validation restrictions.
Default:
java.lang.Void.class

beanInfoField

public abstract java.lang.String beanInfoField
Allows to specify the name of the field to read JSR-303 validation information from.
It is not required to define this if the PM attribute and the related field have the same name.

See also: beanInfoClass().

Returns:
The name of the related bean field to read JSR-303 information from.
Default:
""

defaultPath

public abstract java.lang.String defaultPath
May be specified alternatively to defaultValue().

Denotes a path expression that points to the default value.

If used together with defaultValue(), first this path will be evaluated. If that results to null, the specified default value will be used.

Returns:
A path that will be evaluated using the method PmObject#findPmProperty(String).
Default:
""

formatResKey

public abstract java.lang.String formatResKey
Returns:
Key of a format definition used for string conversions.
Default:
""

checkValueChangeOnStringInput

public abstract boolean checkValueChangeOnStringInput
Defines value change detection on string level.
If set to true a difference between the current string representation and the value provided by the UI will be used to detect a value change.
This will usually only be done on the native value representation.

The main reason for this option are formatted date fields.... is checked if an entered value should be compared against

Returns:
Default:
false

accessKind

public abstract PmAttrCfg.AttrAccessKind accessKind
Returns:
The data access kind definition.
Default:
org.pm4j.core.pm.annotation.PmAttrCfg.AttrAccessKind.DEFAULT