Package com.iizix.api.vs
Annotation Type OnVSField
@Documented @Retention(RUNTIME) @Target(METHOD) @Repeatable(OnVSFields.class) public @interface OnVSField
Annotation for tagging methods to receive VirtualSpace Field events, i.e. for Virtual Field Processors.Only 1 acceptable method pattern for this annotation.
Note:methodName
can be any name you want to use.public void methodName(
VSFieldEvent
event)
Example:
@VirtualSpace(ref="Proj:/vs/subFolder/OneVS") public class MyVSListener { public MyVSListener() { ... } // Method called to validate the "FieldName" field. @OnVSField(name="FieldName", descr="Validates a Field Name", ops={VSFieldEvent.Op.VALIDATE}) public void onMyValidate(VSFieldEvent event) throws ValueConversionException { ... } // Method called to convert the "group/FieldName" field value to other formats. @OnVSField(name="group/FieldName", descr="Converts a Field Value", ops={Op.CONVERT_TO_NATIVE}, source={String.class}, target={Boolean.class}) public void onMyConvert(VSFieldEvent event) throws ValueConversionException { ... } }
- Author:
- Christopher Mindus
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.String
descr
The description of the field processor routine, used in the Eclipse UI.java.lang.String
name
The Name or Relative Path of the Property to associate with the method.VSFieldEvent.Op[]
ops
The list of supported event operations in this instance.
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.Class<?>[]
source
The list of supported Value conversion classes that are handled as source conversion from a value, used in the CONVERT_* operations.java.lang.Class<?>[]
target
The list of supported Value conversion classes that are handled as target conversion from a value, used in the CONVERT_* operations.
Element Detail
name
java.lang.String name
The Name or Relative Path of the Property to associate with the method. Thename
is either a Name without slash ('/') that is a direct child of the VirtualSpace reference, or a Relative Path from the VirtualSpace root.- Returns:
- The Property Name path from the VirtualSpace base "ref" reference specification, e.g. "myField" or "group/mySubField".
ops
VSFieldEvent.Op[] ops
The list of supported event operations in this instance. Only the event for the supported operations are fired to the annotation implementing method.- Returns:
- The list of supported events, e.g. VALIDATE and/or CONVERT_*.
source
java.lang.Class<?>[] source
The list of supported Value conversion classes that are handled as source conversion from a value, used in the CONVERT_* operations.- Returns:
- One or more supported native conversion classes from:
- String.class,
- java.math.BigDecimal.class,
- Boolean.class,
- Byte.class,
- Short.class,
- Integer.class,
- Long.class,
- Float.class,
- Double.class,
- byte[].class (Binary value type),
- java.sql.Date.class,
- java.sql.Time.class,
- java.sql.Timestamp.class,
- Number.class (meaning BigDecimal, Byte, Short, Integer, Long, Float and Double at once).
- Default:
- {}
target
java.lang.Class<?>[] target
The list of supported Value conversion classes that are handled as target conversion from a value, used in the CONVERT_* operations.- Returns:
- One or more supported native value classes of the list below:
- String.class,
- java.math.BigDecimal.class,
- Boolean.class,
- Byte.class,
- Short.class,
- Integer.class,
- Long.class,
- Float.class,
- Double.class,
- byte[].class (Binary value type),
- java.sql.Date.class,
- java.sql.Time.class,
- java.sql.Timestamp.class,
- Number.class (meaning BigDecimal, Byte, Short, Integer, Long, Float and Double at once).
- Default:
- {}