Package org.apache.dubbo.common.bytecode
Class Wrapper
java.lang.Object
org.apache.dubbo.common.bytecode.Wrapper
Wrapper.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract String[]get method name array.abstract String[]get method name array.abstract String[]get property name array.abstract Class<?> get property type.abstract ObjectgetPropertyValue(Object instance, String pn) get property value.Object[]getPropertyValues(Object instance, String[] pns) get property value.static WrappergetWrapper(Class<?> c) get wrapper.booleanhas method.abstract booleanhasProperty(String name) has property.abstract ObjectinvokeMethod(Object instance, String mn, Class<?>[] types, Object[] args) invoke method.abstract voidsetPropertyValue(Object instance, String pn, Object pv) set property value.voidsetPropertyValues(Object instance, String[] pns, Object[] pvs) set property value.
-
Constructor Details
-
Wrapper
public Wrapper()
-
-
Method Details
-
getWrapper
get wrapper.- Parameters:
c- Class instance.- Returns:
- Wrapper instance(not null).
-
getPropertyNames
get property name array.- Returns:
- property name array.
-
getPropertyType
get property type.- Parameters:
pn- property name.- Returns:
- Property type or nul.
-
hasProperty
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:
NoSuchPropertyExceptionIllegalArgumentException
-
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:
NoSuchPropertyExceptionIllegalArgumentException
-
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:
NoSuchPropertyExceptionIllegalArgumentException
-
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:
NoSuchPropertyExceptionIllegalArgumentException
-
getMethodNames
get method name array.- Returns:
- method name array.
-
getDeclaredMethodNames
get method name array.- Returns:
- method name array.
-
hasMethod
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:
NoSuchMethodExceptionInvocationTargetException
-