com.alibaba.dubbo.common.bytecode
Class Wrapper

java.lang.Object
  extended by com.alibaba.dubbo.common.bytecode.Wrapper

public abstract class Wrapper
extends Object

Wrapper.

Author:
qian.lei

Constructor Summary
Wrapper()
           
 
Method Summary
abstract  String[] getDeclaredMethodNames()
          get method name array.
abstract  String[] getMethodNames()
          get method name array.
abstract  String[] getPropertyNames()
          get property name array.
abstract  Class<?> getPropertyType(String pn)
          get property type.
abstract  Object getPropertyValue(Object instance, String pn)
          get property value.
 Object[] getPropertyValues(Object instance, String[] pns)
          get property value.
static Wrapper getWrapper(Class<?> c)
          get wrapper.
 boolean hasMethod(String name)
          has method.
abstract  boolean hasProperty(String name)
          has property.
abstract  Object invokeMethod(Object instance, String mn, Class<?>[] types, Object[] args)
          invoke method.
abstract  void setPropertyValue(Object instance, String pn, Object pv)
          set property value.
 void setPropertyValues(Object instance, String[] pns, Object[] pvs)
          set property value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Wrapper

public Wrapper()
Method Detail

getWrapper

public static Wrapper getWrapper(Class<?> c)
get wrapper.

Parameters:
c - Class instance.
Returns:
Wrapper instance(not null).

getPropertyNames

public abstract String[] getPropertyNames()
get property name array.

Returns:
property name array.

getPropertyType

public abstract Class<?> getPropertyType(String pn)
get property type.

Parameters:
pn - property name.
Returns:
Property type or nul.

hasProperty

public abstract boolean hasProperty(String name)
has property.

Parameters:
name - property name.
Returns:
has or has not.

getPropertyValue

public abstract Object getPropertyValue(Object instance,
                                        String pn)
                                 throws NoSuchPropertyException,
                                        IllegalArgumentException
get property value.

Parameters:
instance - instance.
pn - property name.
Returns:
value.
Throws:
NoSuchPropertyException
IllegalArgumentException

setPropertyValue

public abstract void setPropertyValue(Object instance,
                                      String pn,
                                      Object pv)
                               throws NoSuchPropertyException,
                                      IllegalArgumentException
set property value.

Parameters:
instance - instance.
pn - property name.
pv - property value.
Throws:
NoSuchPropertyException
IllegalArgumentException

getPropertyValues

public Object[] getPropertyValues(Object instance,
                                  String[] pns)
                           throws NoSuchPropertyException,
                                  IllegalArgumentException
get property value.

Parameters:
instance - instance.
pns - property name array.
Returns:
value array.
Throws:
NoSuchPropertyException
IllegalArgumentException

setPropertyValues

public void setPropertyValues(Object instance,
                              String[] pns,
                              Object[] pvs)
                       throws NoSuchPropertyException,
                              IllegalArgumentException
set property value.

Parameters:
instance - instance.
pns - property name array.
pvs - property value array.
Throws:
NoSuchPropertyException
IllegalArgumentException

getMethodNames

public abstract String[] getMethodNames()
get method name array.

Returns:
method name array.

getDeclaredMethodNames

public abstract String[] getDeclaredMethodNames()
get method name array.

Returns:
method name array.

hasMethod

public boolean hasMethod(String name)
has method.

Parameters:
name - method name.
Returns:
has or has not.

invokeMethod

public abstract Object invokeMethod(Object instance,
                                    String mn,
                                    Class<?>[] types,
                                    Object[] args)
                             throws NoSuchMethodException,
                                    InvocationTargetException
invoke method.

Parameters:
instance - instance.
mn - method name.
types -
args - argument array.
Returns:
return value.
Throws:
NoSuchMethodException
InvocationTargetException


Copyright © 2012–2017 Alibaba. All rights reserved.