|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.core.dom.ASTNode
org.eclipse.jdt.core.dom.MethodRefParameter
public class MethodRefParameter
AST node for a parameter within a method reference (MethodRef
).
These nodes only occur within doc comments (Javadoc
).
For JLS2:
MethodRefParameter: Type [ Identifier ]For JLS3, the variable arity indicator was added:
MethodRefParameter: Type [ ... ] [ Identifier ]
Note: The 1.5 spec for the Javadoc tool does not mention the possibility of a variable arity indicator in method references. However, the 1.5 Javadoc tool itself does indeed support it. Since it makes sense to have a way to explicitly refer to variable arity methods, it seems more likely that the Javadoc spec is wrong in this case.
Javadoc
Field Summary | |
---|---|
static ChildPropertyDescriptor |
NAME_PROPERTY
The "name" structural property of this node type. |
static ChildPropertyDescriptor |
TYPE_PROPERTY
The "type" structural property of this node type. |
static SimplePropertyDescriptor |
VARARGS_PROPERTY
The "varargs" structural property of this node type (added in JLS3 API). |
Method Summary | |
---|---|
SimpleName |
getName()
Returns the parameter name, or null if there is none. |
Type |
getType()
Returns the paramter type. |
boolean |
isVarargs()
Returns whether this method reference parameter is for the last parameter of a variable arity method (added in JLS3 API). |
static java.util.List |
propertyDescriptors(int apiLevel)
Returns a list of structural property descriptors for this node type. |
void |
setName(SimpleName name)
Sets or clears the parameter name. |
void |
setType(Type type)
Sets the paramter type to the given type. |
void |
setVarargs(boolean variableArity)
Sets whether this method reference parameter is for the last parameter of a variable arity method (added in JLS3 API). |
Methods inherited from class org.eclipse.jdt.core.dom.ASTNode |
---|
accept, copySubtree, copySubtrees, delete, equals, getAST, getFlags, getLength, getLocationInParent, getNodeType, getParent, getProperty, getRoot, getStartPosition, getStructuralProperty, hashCode, nodeClassForType, properties, setFlags, setProperty, setSourceRange, setStructuralProperty, structuralPropertiesForType, subtreeBytes, subtreeMatch, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ChildPropertyDescriptor TYPE_PROPERTY
public static final SimplePropertyDescriptor VARARGS_PROPERTY
public static final ChildPropertyDescriptor NAME_PROPERTY
Method Detail |
---|
public static java.util.List propertyDescriptors(int apiLevel)
apiLevel
- the API level; one of the AST.JLS* constants
StructuralPropertyDescriptor
)public Type getType()
public void setType(Type type)
type
- the new type
java.lang.IllegalArgumentException
- if:
null
public boolean isVarargs()
Note that the binding for the type Foo
in the vararg method
reference #fun(Foo...)
is always for the type as
written; i.e., the type binding for Foo
. However, if you
navigate from the MethodRef to its method binding to the
type binding for its last parameter, the type binding for the vararg
parameter is always an array type (i.e., Foo[]
) reflecting
the way vararg methods get compiled.
true
if this is a variable arity parameter,
and false
otherwise
java.lang.UnsupportedOperationException
- if this operation is used in
a JLS2 ASTpublic void setVarargs(boolean variableArity)
variableArity
- true
if this is a variable arity
parameter, and false
otherwisepublic SimpleName getName()
null
if there is none.
null
if there is nonepublic void setName(SimpleName name)
name
- the parameter name node, or null
if
there is none
java.lang.IllegalArgumentException
- if:
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |