org.milyn.cdr.annotation
Annotation Type ConfigParam


@Documented
@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface ConfigParam

Configuration paramater field annotation.

Helps supports reflective injection of ContentHandler paramaters from its SmooksResourceConfiguration instance. To inject the whole SmooksResourceConfiguration instance, use the @org.milyn.cdr.annotation.Config annotation.

Usage

Where the paramater name is the same as the field name:
     @ConfigParam(decoder=IntegerDecoder.class)
     private int maxDigits;
 
Where the paramater name is NOT the same as the field name:
     @ConfigParam(name="max-digits", decoder=IntegerDecoder.class)
     private int maxDigits;
 

Author:
tom.fennelly@gmail.com
See Also:
Configurator

Optional Element Summary
 String[] choice
          Paramater choice values.
 Class<? extends DataDecoder> decoder
          The DataDecoder class to use when decoding the paramater value.
 String defaultVal
          The default paramater value.
 String name
          The paramater name as defined in the resource configuration.
 ConfigParam.Use use
          Paramater required or optional.
 

name

public abstract String name
The paramater name as defined in the resource configuration. If not defined, the name defaults to the name of the field.

Returns:
The paramater name.
Default:
"##NULL"

use

public abstract ConfigParam.Use use
Paramater required or optional.

Defaults to required.

Returns:
Paramater usage.
Default:
REQUIRED

defaultVal

public abstract String defaultVal
The default paramater value.

Only relevant when use=OPTIONAL and the paramater is not defined on the configuration..

Returns:
The default paramater value (un-decoded).
Default:
"org.milyn.cdr.annotation.AnnotationConstants##UNASSIGNED"

choice

public abstract String[] choice
Paramater choice values.

Returns:
List of valid choices (un-decoded).
Default:
"##NULL"

decoder

public abstract Class<? extends DataDecoder> decoder
The DataDecoder class to use when decoding the paramater value.

Returns:
The DataDecoder class.
Default:
org.milyn.javabean.DataDecoder.class


Copyright © 2008. All Rights Reserved.