|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object olg.csv.bean.impl.PropertyFormatter
public abstract class PropertyFormatter
In writing Bean, allows to represent a field of an object as a String. This
class seems to be the same as Formatter
class. But its motivation is
different : We want to product a string which represents a characteristic of
an object not the object itself.
Nested Class Summary | |
---|---|
private static class |
PropertyFormatter.ConcatePropertyReader
Allows to concate severals characteristics of an object into a single string. |
private static class |
PropertyFormatter.DelegatePropertyReader
PropertyFormatter to use to represent a characterstic of a field as a string. |
private static class |
PropertyFormatter.PropertyReader
Basic PropertyFormatter. |
Field Summary | |
---|---|
protected String |
name
Name of the property on which to apply the conversion. |
Constructor Summary | |
---|---|
PropertyFormatter()
|
Method Summary | ||
---|---|---|
boolean |
equals(Object obj)
|
|
static PropertyFormatter |
getConcatePropertyReader(List<PropertyFormatter> formatters,
AbstractStringFilter filtre)
Returns a PropertyFormatter which concates strings the given propertyformatters returns. |
|
static PropertyFormatter |
getDelegatePropertyReader(Method getter,
String name,
PropertyFormatter propertyFormatter)
Returns a PropertyFormatter which extracts as a string a characteristic of a field. |
|
String |
getFullName()
Return the full name of the property. |
|
String |
getName()
Returns the name of the property. |
|
static
|
getPropertyReader(Method getter,
String name,
Formatter<T> formatter,
AbstractStringFilter filtre)
Returns a basic PropertyFormatter. |
|
int |
hashCode()
|
|
abstract String |
toString(Object object)
Returns a string representation of the property. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String name
Constructor Detail |
---|
public PropertyFormatter()
Method Detail |
---|
public abstract String toString(Object object)
Throws a PropertyException when errors occurs during the formatting.
object
- Object from which product a string representation of its
property
public String getName()
public String getFullName()
public static PropertyFormatter getConcatePropertyReader(List<PropertyFormatter> formatters, AbstractStringFilter filtre)
formatters
- list of PropertyFormatter to concate. Must be not
null
and not empty.filtre
- it's possible to filtre the string rendered by the given
propertyFormatters before to be returned
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public static PropertyFormatter getDelegatePropertyReader(Method getter, String name, PropertyFormatter propertyFormatter)
getter
- the method to extract the field from its object. Must be not
null
.name
- the field namepropertyFormatter
- the formatter to apply to the field, not to the owner object.
May be obtained from getPropertyReader or get
delegatePropertyReader methods.Must be not null
.
public static <T> PropertyFormatter getPropertyReader(Method getter, String name, Formatter<T> formatter, AbstractStringFilter filtre)
T
- the type of the propertygetter
- the method to extract the field from the object. Must not be
null
.name
- the property nameformatter
- this formatter allows to transform the field into a string. if
the given argument is null
a default formatter is
define which use the toString method of the field.filtre
- it's possible to filtre the string rendered by the formatter
before to be returned
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |