org.nuiton.util.decorator
Class Decorator<O>

java.lang.Object
  extended by org.nuiton.util.decorator.Decorator<O>
Type Parameters:
O - the type of data to decorate
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JXPathDecorator, PropertyDecorator

public abstract class Decorator<O>
extends Object
implements Serializable

A simple contract to define a String decorator on any java object.

Since:
2.3
Author:
tchemit
See Also:
Serialized Form

Field Summary
protected  Class<O> type
          Type of the data to decorate
 
Constructor Summary
Decorator(Class<O> type)
           
 
Method Summary
 Class<O> getInternalClass()
          Deprecated. is remplaced by getType() and will be removed soon
 Class<O> getType()
           
abstract  String toString(Object bean)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected final Class<O> type
Type of the data to decorate

Constructor Detail

Decorator

public Decorator(Class<O> type)
          throws NullPointerException
Throws:
NullPointerException
Method Detail

toString

public abstract String toString(Object bean)
Parameters:
bean - the bean to decorate
Returns:
the string value of the given bean

getType

public Class<O> getType()

getInternalClass

@Deprecated
public Class<O> getInternalClass()
Deprecated. is remplaced by getType() and will be removed soon

Returns:
the internal type of object that can be decorated by this decorator.


Copyright © 2004-2011 CodeLutin. All Rights Reserved.