Package com.iizix.api.vs
Annotation Interface 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
Optional Element Summary
Modifier and TypeOptional ElementDescriptionClass<?>[]
The list of supported Value conversion classes that are handled as source conversion from a value, used in the CONVERT_* operations.Class<?>[]
The list of supported Value conversion classes that are handled as target conversion from a value, used in the CONVERT_* operations.
Element Details
name
String nameThe 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".
descr
String descrThe description of the field processor routine, used in the Eclipse UI.- Returns:
- A descriptive string of the field processor.
ops
VSFieldEvent.Op[] opsThe 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
Class<?>[] sourceThe 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
Class<?>[] targetThe 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:
- {}