to.etc.domui.component.meta
Annotation Type MetaProperty


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface MetaProperty

Annotation to add metadata to a property. Data defined in here is added to any data discovered in another way, for instance by scanning JPA annotations. So do not repeat things.

Author:
Frits Jalvingh Created on Jun 18, 2008

Optional Element Summary
 java.lang.String componentTypeHint
          This is a hint string which can help a component factory decide how to render a component.
 java.lang.Class<? extends IConverter<?>> converterClass
          If you have special non-default string-object and object-string conversion rules for this property you can specify your own converter class doing those conversions here.
 SortableType defaultSortable
          Defines whether the property should be sortable when used in a default table, and defines the initial sort direction of the property.
 int displaySize
          The size, in characters, that should be used as the display size.
 java.lang.String[] editpermissions
           
 int length
          The actual maximal input length (for a string) or the precision to use (for a number).
 NumericPresentation numericPresentation
          Defines the number class AND it's presentation format for numeric values.
 MetaValueValidator[] parameterizedValidator
           
 YesNoType readOnly
          Defines this as a readonly (displayonly) property (by default).
 java.lang.String regexpUserString
           
 java.lang.String regexpValidation
          A regular expression defining what text input must look like to be accepted.
 YesNoType required
          Whether the value is a required value.
 TemporalPresentationType temporal
          If this is defined as some Date type this further defines the domain (date only, date time etc).
 java.lang.Class<? extends IValueValidator<?>>[] validator
          Defines one or more parameterless validators for this field.
 java.lang.String[] viewpermissions
          A set of strings that indicate the roles a user must have to view this field.
 

defaultSortable

public abstract SortableType defaultSortable
Defines whether the property should be sortable when used in a default table, and defines the initial sort direction of the property. This defaults to unsortable.

Returns:
Default:
to.etc.domui.component.meta.SortableType.UNKNOWN

displaySize

public abstract int displaySize
The size, in characters, that should be used as the display size. This is not the max size of the input but only of the part that is seen in one go.

Returns:
Default:
-1

length

public abstract int length
The actual maximal input length (for a string) or the precision to use (for a number).

Returns:
Default:
-1

required

public abstract YesNoType required
Whether the value is a required value. This sadly cannot use boolean because I need a value representing "not set here but somewhere else" - and annotations cannot use null ([irony]because that would be helpful and in conformance with the rest of the language[/irony]).

Returns:
Default:
to.etc.domui.component.meta.YesNoType.UNKNOWN

converterClass

public abstract java.lang.Class<? extends IConverter<?>> converterClass
If you have special non-default string-object and object-string conversion rules for this property you can specify your own converter class doing those conversions here.

Returns:
Default:
to.etc.domui.converter.DummyConverter.class

readOnly

public abstract YesNoType readOnly
Defines this as a readonly (displayonly) property (by default). It defaults to "unset" meaning that other metadata defines this property. If no other provider sets it the property is NOT readonly by default. Cannot use "boolean" - see required().

Returns:
Default:
to.etc.domui.component.meta.YesNoType.UNKNOWN

temporal

public abstract TemporalPresentationType temporal
If this is defined as some Date type this further defines the domain (date only, date time etc). It defaults to UNKNOWN, which is treated much the same as date-time.

Returns:
Default:
to.etc.domui.component.meta.TemporalPresentationType.UNKNOWN

viewpermissions

public abstract java.lang.String[] viewpermissions
A set of strings that indicate the roles a user must have to view this field. The permissions

Returns:
Default:
{}

editpermissions

public abstract java.lang.String[] editpermissions
Default:
{}

componentTypeHint

public abstract java.lang.String componentTypeHint
This is a hint string which can help a component factory decide how to render a component. The content is fully free, and individual factories decide which hints they listen to.

Returns:
Default:
""

validator

public abstract java.lang.Class<? extends IValueValidator<?>>[] validator
Defines one or more parameterless validators for this field.

Returns:
Default:
{}

parameterizedValidator

public abstract MetaValueValidator[] parameterizedValidator
Default:
{}

regexpValidation

public abstract java.lang.String regexpValidation
A regular expression defining what text input must look like to be accepted. Can be used to define a default regexp when a Text control is used for this property; it is ignored on other input controls. If validation fails the error generated will be a validation error showing a 'pattern'; this pattern can be set using regexpUserString().

Returns:
Default:
""

regexpUserString

public abstract java.lang.String regexpUserString
Default:
""

numericPresentation

public abstract NumericPresentation numericPresentation
Defines the number class AND it's presentation format for numeric values.

Returns:
Default:
to.etc.domui.component.meta.NumericPresentation.UNKNOWN