org.pojomatic.formatter
Interface PropertyFormatter

All Known Implementing Classes:
AccountNumberFormatter, DefaultPropertyFormatter

public interface PropertyFormatter

A formatter for a property. Any implementation of PropertyFormatter must have a public no-argument constructor.


Method Summary
 java.lang.String format(java.lang.Object value)
          Format a given value.
 void initialize(java.lang.reflect.AnnotatedElement element)
          Initialize the formatter for use; this method will be called exactly once on an instance, prior to any calls to format(Object).
 

Method Detail

initialize

void initialize(java.lang.reflect.AnnotatedElement element)
Initialize the formatter for use; this method will be called exactly once on an instance, prior to any calls to format(Object). This method does not need to be thread-safe.

Parameters:
element -

format

java.lang.String format(java.lang.Object value)
Format a given value. This method must be thread safe.

Parameters:
value - the value to format
Returns:
the value, formatted (must not be null)


Copyright © 2008-2009. All Rights Reserved.