org.progeeks.meta.format
Class BeanFieldPropertyFormat

java.lang.Object
  extended by org.progeeks.meta.format.AbstractPropertyFormat
      extended by org.progeeks.meta.format.BeanFieldPropertyFormat
All Implemented Interfaces:
PropertyFormat

public class BeanFieldPropertyFormat
extends AbstractPropertyFormat

PropertyFormat implementation that uses the value of a bean field as the format value.

Version:
$Revision: 1.4 $
Author:
Paul Speed

Constructor Summary
BeanFieldPropertyFormat(java.lang.String fieldName)
          Creates a property format object that will use the value of the specified field to convert a bean into a String using String.valueOf() on the property value.
BeanFieldPropertyFormat(java.lang.String fieldName, PropertyFormat format)
          Creates a property format object that will use the value of the specified field to convert a bean into a String.
 
Method Summary
 java.lang.String format(java.lang.Object obj)
          Returns the formatted String for the specified Object.
 PropertyFormat getFormat()
          Returns the format that will be used to format the bean field.
 java.lang.Object parseObject(java.lang.String source)
          Parsing is not supported.
 java.lang.Object parseObject(java.lang.String source, int index)
          Parsing is not supported.
 void setFormat(PropertyFormat format)
          Sets the format that will be used for formatting the bean field.
 java.lang.String toString()
          String summary.
 
Methods inherited from class org.progeeks.meta.format.AbstractPropertyFormat
format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanFieldPropertyFormat

public BeanFieldPropertyFormat(java.lang.String fieldName)
Creates a property format object that will use the value of the specified field to convert a bean into a String using String.valueOf() on the property value.


BeanFieldPropertyFormat

public BeanFieldPropertyFormat(java.lang.String fieldName,
                               PropertyFormat format)
Creates a property format object that will use the value of the specified field to convert a bean into a String. The returned value will be passed through the specified PropertyFormat before being returned.

Method Detail

setFormat

public void setFormat(PropertyFormat format)
Sets the format that will be used for formatting the bean field.

Parameters:
format - PropertyFormat object to use for formatting bean field.

getFormat

public PropertyFormat getFormat()
Returns the format that will be used to format the bean field.

Returns:
PropertyFormat object or null if no format set.

format

public java.lang.String format(java.lang.Object obj)
Returns the formatted String for the specified Object.

Specified by:
format in interface PropertyFormat
Specified by:
format in class AbstractPropertyFormat

parseObject

public java.lang.Object parseObject(java.lang.String source)
Parsing is not supported.

Specified by:
parseObject in interface PropertyFormat
Overrides:
parseObject in class AbstractPropertyFormat

parseObject

public java.lang.Object parseObject(java.lang.String source,
                                    int index)
Parsing is not supported.

Specified by:
parseObject in interface PropertyFormat
Specified by:
parseObject in class AbstractPropertyFormat

toString

public java.lang.String toString()
String summary.

Overrides:
toString in class java.lang.Object


Copyright © 2002-2003 Paul Speed. All Rights Reserved.