org.nuiton.util.decorator
Class PropertyDecorator<O>
java.lang.Object
org.nuiton.util.decorator.Decorator<O>
org.nuiton.util.decorator.PropertyDecorator<O>
- Type Parameters:
O - type of data to decorate
- All Implemented Interfaces:
- Serializable
public class PropertyDecorator<O>
- extends Decorator<O>
Simple property decorator based on String.format(String, Object...)
method.
To use it, give him a class and the property name to render.
For example :
Decorator<Object> d = DecoratorUtil.newPropertyDecorator(PropertyDecorator.class,"property");
- Since:
- 2.3
- Author:
- tchemit
- See Also:
Decorator,
Serialized Form
| Fields inherited from class org.nuiton.util.decorator.Decorator |
type |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
property
protected String property
- name of property
m
protected transient Method m
PropertyDecorator
protected PropertyDecorator(Class<O> internalClass,
String property)
throws NullPointerException
- Throws:
NullPointerException
toString
public String toString(Object bean)
- Specified by:
toString in class Decorator<O>
- Parameters:
bean - the bean to decorate
- Returns:
- the string value of the given bean
getProperty
public String getProperty()
getM
protected Method getM()
Copyright © 2004-2012 CodeLutin. All Rights Reserved.