net.datacrow.enhancers
Interface IValueEnhancer

All Known Implementing Classes:
AssociateNameRewriter, AutoIncrementer, TitleRewriter

public interface IValueEnhancer

A value enhancer changes a value before saving the item to the database. Value enhancers should be registered in the ValueEnhancers class.

Author:
Robert Jan van der Waals

Method Summary
 java.lang.Object apply(DcField field, java.lang.Object value)
          Apply the enhancement.
 int getIndex()
          Unique ID for this enhancer.
 boolean isEnabled()
          Indicates if this enhancer is enabled.
 boolean isRunOnInsert()
          Indicates if the enhancement should be performed after inserting an item.
 boolean isRunOnUpdating()
          Indicates if the enhancement should be performed after updating an item.
 void parse(java.lang.String s)
          Parses a string representation.
 java.lang.String toSaveString()
          Creates a string representation which can be stored to disk.
 

Method Detail

apply

java.lang.Object apply(DcField field,
                       java.lang.Object value)
Apply the enhancement.

Parameters:
field - The field to enhance.
value - The value.
Returns:
The result of the enhancement.

toSaveString

java.lang.String toSaveString()
Creates a string representation which can be stored to disk.


getIndex

int getIndex()
Unique ID for this enhancer.

Returns:

parse

void parse(java.lang.String s)
Parses a string representation.

Parameters:
s -

isEnabled

boolean isEnabled()
Indicates if this enhancer is enabled.


isRunOnUpdating

boolean isRunOnUpdating()
Indicates if the enhancement should be performed after updating an item.


isRunOnInsert

boolean isRunOnInsert()
Indicates if the enhancement should be performed after inserting an item.