com.googlecode.objectify.impl
Class MethodWrapper

java.lang.Object
  extended by com.googlecode.objectify.impl.MethodWrapper
All Implemented Interfaces:
Wrapper

public class MethodWrapper
extends java.lang.Object
implements Wrapper

Wrapper which makes a method with a single parameter look just like a field. Well, almost - if you try to get() the value it is always null.


Constructor Summary
MethodWrapper(java.lang.reflect.Method method)
           
 
Method Summary
 java.lang.Object get(java.lang.Object pojo)
          Get the value of the thing thing (field) if possible, or null if not possible (method)
 java.lang.reflect.Type getGenericType()
          Get the "generictype", which can be a ParameterizedType
 java.lang.Class<?> getType()
          Get the type of the thing.
 boolean isSerialized()
           
 void set(java.lang.Object pojo, java.lang.Object value)
          Actually set the thing (field or method) on an object
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodWrapper

public MethodWrapper(java.lang.reflect.Method method)
Method Detail

getType

public java.lang.Class<?> getType()
Description copied from interface: Wrapper
Get the type of the thing. Might return null when unknown (ie content of Collection with no generic type)

Specified by:
getType in interface Wrapper

getGenericType

public java.lang.reflect.Type getGenericType()
Description copied from interface: Wrapper
Get the "generictype", which can be a ParameterizedType

Specified by:
getGenericType in interface Wrapper

set

public void set(java.lang.Object pojo,
                java.lang.Object value)
Description copied from interface: Wrapper
Actually set the thing (field or method) on an object

Specified by:
set in interface Wrapper

get

public java.lang.Object get(java.lang.Object pojo)
Description copied from interface: Wrapper
Get the value of the thing thing (field) if possible, or null if not possible (method)

Specified by:
get in interface Wrapper

isSerialized

public boolean isSerialized()
Specified by:
isSerialized in interface Wrapper
Returns:
true if the value should be deserialized from blob

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011 Jeff Schnitzer and a gang of pirates. All Rights Reserved. Build version: 3.1