net.sf.japaki.beans
Class SelfProperty<V,B extends V>

java.lang.Object
  extended by net.sf.japaki.beans.SelfProperty<V,B>
All Implemented Interfaces:
Property<B,V>

public class SelfProperty<V,B extends V>
extends Object
implements Property<B,V>

The property that returns the given bean as the value.


Constructor Summary
protected SelfProperty(Class<V> type)
          Creates a new self property.
 
Method Summary
 Class<V> getType()
          Returns the stored type.
 V getValue(B bean)
          Returns the bean itself.
static
<V> Property<V,V>
newInstance(Class<V> type)
          Creates a new self property.
 void setValue(B bean, V value)
          Not implemented.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelfProperty

protected SelfProperty(Class<V> type)
Creates a new self property.

Parameters:
type - type of the new property
Method Detail

newInstance

public static <V> Property<V,V> newInstance(Class<V> type)
Creates a new self property.

Parameters:
type - type of the new property
Returns:
the new property

getValue

public V getValue(B bean)
Returns the bean itself.

Specified by:
getValue in interface Property<B extends V,V>
Parameters:
bean - a bean
Returns:
the input bean

setValue

public void setValue(B bean,
                     V value)
Not implemented.

Specified by:
setValue in interface Property<B extends V,V>
Parameters:
bean - ignored
value - ignored
Throws:
UnsupportedOperationException - always

getType

public Class<V> getType()
Returns the stored type.

Specified by:
getType in interface Property<B extends V,V>
Returns:
the stored type

toString

public String toString()
Overrides:
toString in class Object