FileDocCategorySizeDatePackage
MethodTarget.javaAPI DocApache Axis 1.42981Sat Apr 22 18:57:26 BST 2006org.apache.axis.encoding

MethodTarget

public class MethodTarget extends Object implements Target

Fields Summary
protected static Log
log
private Object
targetObject
private Method
targetMethod
private static final Class[]
objArg
Constructors Summary
public MethodTarget(Object targetObject, Method targetMethod)
Construct a target whose value is set via a method

param
targetObject is the object containing the value to be set
param
targetMethod is the Method used to set the value


                                        
        
    
        this.targetObject = targetObject;
        this.targetMethod = targetMethod;
    
public MethodTarget(Object targetObject, String methodName)
Construct a target whose value is set via a method

param
targetObject is the object containing the value to be set
param
methodName is the name of the Method

        this.targetObject = targetObject;
        Class cls = targetObject.getClass();
        targetMethod = cls.getMethod(methodName, objArg);
    
Methods Summary
public voidset(java.lang.Object value)
Set the target's value by invoking the targetMethod.

param
value is the new Object value

        try {
            targetMethod.invoke(targetObject, new Object [] { value });
        } catch (IllegalAccessException accEx) {
            log.error(Messages.getMessage("illegalAccessException00"),
                      accEx);
            throw new SAXException(accEx);
        } catch (IllegalArgumentException argEx) {
            log.error(Messages.getMessage("illegalArgumentException00"),
                      argEx);
            throw new SAXException(argEx);
        } catch (InvocationTargetException targetEx) {
            log.error(Messages.getMessage("invocationTargetException00"),
                      targetEx);
            throw new SAXException(targetEx);
        }