org.eclipse.actf.validation.core
Class Reflector.Result

java.lang.Object
  extended by org.eclipse.actf.validation.core.Reflector.Result
Enclosing class:
Reflector

public class Reflector.Result
extends Object

used primarily by the Reflector class to return the results of introspection


Constructor Summary
Reflector.Result(Object member, Object value)
          create a new Reflector.Result for a reflected Field member
Reflector.Result(Object member, Object[] params)
          create a new Reflector.Result
 
Method Summary
 String[] getFormattedParameters()
          returns the formatted parameters.
 Object getMember()
          gets the reflected class member (e.g.
 Object[] getParameters()
          gets the parameters to be used for invokation of the reflected class member
 Object getValue()
          gets the value of the member should the member be a Field or returns the result of a method invokation or constructor call.
 Object invoke(Object object)
          invoke the member Constructor or Method with the corresponding parameters on the specified object (which may be null)
 boolean isConstructor()
          returns true if member is not null and is an instance of java.lang.reflect.Constructor
 boolean isField()
          returns true if member is not null and is an instance of java.lang.reflect.Field
 boolean isMethod()
          returns true if member is not null and is an instance of java.lang.reflect.Method
 void setFormattedParameters(String[] params)
          set the formatted parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reflector.Result

public Reflector.Result(Object member,
                        Object[] params)
create a new Reflector.Result

Parameters:
member - -- reflected member
params - -- parameters to be used upon invokation of member

Reflector.Result

public Reflector.Result(Object member,
                        Object value)
create a new Reflector.Result for a reflected Field member

Parameters:
member - -- reflected Field member
value - -- value of Field
Method Detail

getMember

public Object getMember()
gets the reflected class member (e.g. Field, Constructor, or Method)

Returns:
reflected class member

getParameters

public Object[] getParameters()
gets the parameters to be used for invokation of the reflected class member

Returns:
parameters to be used upon invokation

setFormattedParameters

public void setFormattedParameters(String[] params)
set the formatted parameters. Formatted parameters are those that will be used as actual parameters in source code generation. They will usually be generated with the format method of the code generator being used.

Parameters:
params - -- the formatted parameters ready for source code placement

getFormattedParameters

public String[] getFormattedParameters()
returns the formatted parameters.

Returns:
formatted parameters for source code generation
See Also:
setFormattedParameters(String[])

getValue

public Object getValue()
gets the value of the member should the member be a Field or returns the result of a method invokation or constructor call. This method will return null for the latter two cases until invoke is called.

Returns:
value of Field member

isConstructor

public boolean isConstructor()
returns true if member is not null and is an instance of java.lang.reflect.Constructor

Returns:
true if this Result holds a Constructor member, false otherwise

isMethod

public boolean isMethod()
returns true if member is not null and is an instance of java.lang.reflect.Method

Returns:
true if this Result holds a Method member, false otherwise

isField

public boolean isField()
returns true if member is not null and is an instance of java.lang.reflect.Field

Returns:
true if this Result holds a Field member, false otherwise

invoke

public Object invoke(Object object)
              throws Exception
invoke the member Constructor or Method with the corresponding parameters on the specified object (which may be null)

Parameters:
object - -- object upon which to invoke method (or null if method is static)
Returns:
result of invocation
Throws:
Exception - - any exception thrown by members of the Reflection API may be thrown
See Also:
"Java Reflection API"