|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.actf.validation.core.Parameter
public class Parameter
A Parameter object represents any attribute value or argument that is to be passed to a constructor or method as it appears in the XML document. Such objects include (but are certainly not limited to):
Thus, this class embodies most of the special syntax used by the RGB engine in reading the description of a GUI in an XML document.
Field Summary | |
---|---|
static String |
EMPTY_VALUE
empty parameter |
static int |
LITERAL_PRIMITIVE
literal primitive |
static int |
METHOD_ALIAS
method alias (not currently used) |
static int |
REFERENCE_ID
reference id |
static int |
SCRIPT_CODE
script code |
static int |
UNKNOWN
unknown parameter type |
static String |
UNRESOLVED
unresolved parameter |
Constructor Summary | |
---|---|
Parameter(Object obj)
wraps the given Object as a resolved Parameter |
|
Parameter(String param,
ICodeProcessor codeProcessor)
create a Parameter object for later resolution. |
|
Parameter(String param,
int type,
ICodeProcessor codeProcessor)
create a Parameter object for later resolution. |
Method Summary | |
---|---|
ICodeProcessor |
getCodeProcessor()
returns the code processor being used by this parameter. |
String |
getFieldName()
gets the fully-qualified name of the field named by this parameter |
int |
getParameterType()
returns the parameter type of this unresolved parameter |
Object |
getResolvedValue()
returns the resolved parameter value. |
String |
getUnresolvedValue()
get the unresolved value for this parameter. |
boolean |
isMethodAlias()
returns true if this parameter is a method alias |
boolean |
isPublicFieldName()
returns whether or not this parameter as an unresolved String names a public field in some class. |
boolean |
isReferenceId()
returns true if this parameter is a reference id |
boolean |
isResolved()
returns true if this Parameter has been resolved via
invoking one of the resolve(...) |
boolean |
isScriptCode()
returns true if this parameter is code to be evaluated by
this Parameter's ICodeProcessor |
Object |
resolve(Class cls)
attempts to resolve this unresolved Parameter. |
Object[] |
resolve(Class[] paramTypes)
force this Parameter to be treated as a series of statements in the scripting language of this Parameter's ICodeProcessor and return the array of objects that is the result of the evaluation of these statements. |
Object |
resolve(Class cls,
Object parent)
|
void |
setCodeProcessor(ICodeProcessor cp)
set the code processor for this parameter |
void |
setParameterType(int type)
set the parameter type of this parameter. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int UNKNOWN
public static final int REFERENCE_ID
public static final int METHOD_ALIAS
public static final int SCRIPT_CODE
public static final int LITERAL_PRIMITIVE
public static final String UNRESOLVED
public static final String EMPTY_VALUE
Constructor Detail |
---|
public Parameter(String param, ICodeProcessor codeProcessor)
param
- --
string representation of parameter as read from XML documentcodeProcessor
- --
ICodeProcessor for evaluation of expressions and idspublic Parameter(String param, int type, ICodeProcessor codeProcessor)
param
- --
representation of the parameter to be resolvedtype
- --
type of this parameter; one of the public static fields of
this classcodeProcessor
- --
code processor for evaluation, which may be null
if the type is not SCRIPT_CODEParameter(String, ICodeProcessor)
public Parameter(Object obj)
obj
- --
an Object that will be passed to a method or constructorMethod Detail |
---|
public void setCodeProcessor(ICodeProcessor cp)
cp
- --
code processorpublic ICodeProcessor getCodeProcessor()
public Object getResolvedValue()
null
if one of the resolve(...)
methods has not been invoked
resolve(Class)
public String getUnresolvedValue()
public void setParameterType(int type)
type
- --
one of the public static fields of this classpublic int getParameterType()
public Object resolve(Class cls)
cls
- --
desired class of which resolution is to produce an instance
null
if resolution
could not take placepublic Object resolve(Class cls, Object parent)
cls
- -
desired class of which resolution is to produce an instanceparent
- -
parent object (e.g. for resolving constraints or other layout
information)
null
if resolution
could not take placeresolve(Class)
public Object[] resolve(Class[] paramTypes)
paramTypes
- --
array of types of desired parameters
null
if code
could not be evaluatedpublic boolean isResolved()
true
if this Parameter has been resolved via
invoking one of the resolve(...)
methods
true
if this Parameter has been resolved,
false
otherwiseresolve(Class)
public boolean isScriptCode()
true
if this parameter is code to be evaluated by
this Parameter's ICodeProcessor
true
if parameter is script code,
false
otherwisepublic boolean isMethodAlias()
true
if this parameter is a method alias
true
if parameter is a method alias,
false
otherwisepublic boolean isReferenceId()
true
if this parameter is a reference id
true
if parameter is a reference id,
false
otherwisepublic boolean isPublicFieldName()
true
if the String names a public field in some
class, false
otherwisepublic String getFieldName()
null
if
parameter does not name a public fieldpublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |