com.planetalia.dynject.preprocess
Annotation Type Normalized


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

Marks a property as "normalized", performing different value normalization operations before making an assignment.

Author:
Alexander Hristov

Optional Element Summary
 boolean convertNull
          If set to true, allows nulls to be converted into a base value before assignment or before feeding the result to the next step.
 java.lang.String defaultValue
          If set to something different than the default (the empty string), specifies a default value that is used whenever a null value is received.
 PadType pad
          Specifies how to pad the value.
 char padChar
          Specifies which character to use when padding the value.
 int padLength
          Specifies the length of the field into which to apply the padding.
 TransformType transform
          Specifies the type of transformation to use before assigning the value.
 TrimType trim
          Specifies how to process leading and trailing spaces of the value.
 WhitespaceProcessing whitespace
          Specifies how to process whitespaces present in the value.
 

transform

public abstract TransformType transform
Specifies the type of transformation to use before assigning the value. Default is TransformType.NONE

Returns:
Type of transformation.
Default:
com.planetalia.dynject.preprocess.TransformType.NONE

trim

public abstract TrimType trim
Specifies how to process leading and trailing spaces of the value. Default is no processing (TrimType.NONE)

Returns:
Trim operation
Default:
com.planetalia.dynject.preprocess.TrimType.NONE

whitespace

public abstract WhitespaceProcessing whitespace
Specifies how to process whitespaces present in the value. Default is no processing (WhitespaceProcessing.PRESERVE)

Returns:
Whitespace processing
Default:
com.planetalia.dynject.preprocess.WhitespaceProcessing.PRESERVE

pad

public abstract PadType pad
Specifies how to pad the value. Default is no padding (PadType.NONE)

Returns:
Padding type
Default:
com.planetalia.dynject.preprocess.PadType.NONE

padChar

public abstract char padChar
Specifies which character to use when padding the value. Default is '0'

Returns:
Padding character
Default:
48

padLength

public abstract int padLength
Specifies the length of the field into which to apply the padding. Default is 0

Returns:
Padding length
Default:
0

convertNull

public abstract boolean convertNull
If set to true, allows nulls to be converted into a base value before assignment or before feeding the result to the next step. The resulting value depends on what type expects the next step:

Returns:
true if null conversion is allowed
Default:
false

defaultValue

public abstract java.lang.String defaultValue
If set to something different than the default (the empty string), specifies a default value that is used whenever a null value is received. The resulting value depends on what type expects the next step: In all of the above cases, if a parsing error occurs, an exception is raised (since this situation is a programming error)

Returns:
Default value
Default:
""