|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.aspectj.org.eclipse.jdt.core.dom.ASTNode
org.aspectj.org.eclipse.jdt.core.dom.Expression
org.aspectj.org.eclipse.jdt.core.dom.LambdaExpression
public class LambdaExpression
Lambda expression AST node type (added in JLS8 API).
LambdaExpression:
Identifier -> Body
( [ Identifier { , Identifier } ] ) -> Body
( [ FormalParameter { , FormalParameter } ] ) -> Body
The first two forms use VariableDeclarationFragment for the parameter or parameters,
while the third form uses SingleVariableDeclaration.
The Body can be either a Block or an Expression.
| Field Summary | |
|---|---|
static ChildPropertyDescriptor |
BODY_PROPERTY
The "body" structural property of this node type (child type: ASTNode,
must be either a Block or an Expression). |
static ChildListPropertyDescriptor |
PARAMETERS_PROPERTY
The "parameters" structural property of this node type (element type: VariableDeclaration). |
static SimplePropertyDescriptor |
PARENTHESES_PROPERTY
The "parentheses" structural property of this node type (type: Boolean). |
| Method Summary | |
|---|---|
ASTNode |
getBody()
Returns the body of this lambda expression. |
boolean |
hasParentheses()
Returns whether parentheses around the parameters are present or not. |
java.util.List |
parameters()
Returns the live ordered list of formal parameters of this lambda expression. |
static java.util.List |
propertyDescriptors(int apiLevel)
Returns a list of structural property descriptors for this node type. |
IMethodBinding |
resolveMethodBinding()
Resolves and returns the binding for the lambda expression |
void |
setBody(ASTNode body)
Sets the body of this lambda expression. |
void |
setParentheses(boolean hasParentheses)
Sets whether this lambda expression has parentheses around its parameters or not. |
| Methods inherited from class org.aspectj.org.eclipse.jdt.core.dom.Expression |
|---|
resolveBoxing, resolveConstantExpressionValue, resolveTypeBinding, resolveUnboxing |
| Methods inherited from class org.aspectj.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 |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final SimplePropertyDescriptor PARENTHESES_PROPERTY
Boolean).
Note that parentheses are required unless parameters() contains
just a single VariableDeclarationFragment.
ASTRewrite may ignore this property if necessary.
public static final ChildListPropertyDescriptor PARAMETERS_PROPERTY
VariableDeclaration).
Note that all elements must be of the same type, either all SingleVariableDeclaration or all VariableDeclarationFragment.
public static final ChildPropertyDescriptor BODY_PROPERTY
ASTNode,
must be either a Block or an Expression).
| Method Detail |
|---|
public static java.util.List propertyDescriptors(int apiLevel)
apiLevel - the API level; one of the AST.JLS* constants
StructuralPropertyDescriptor)public boolean hasParentheses()
Note that parentheses are required unless parameters() contains
just a single VariableDeclarationFragment.
ASTRewrite may ignore this property if necessary.
true if this lambda expression has parentheses around
its parameters and false otherwisepublic void setParentheses(boolean hasParentheses)
Note that parentheses are required unless parameters() contains
just a single VariableDeclarationFragment.
ASTRewrite may ignore this property if necessary.
hasParentheses - true if this lambda expression has parentheses around its parameters
and false otherwisepublic java.util.List parameters()
SingleVariableDeclaration (explicit type), orVariableDeclarationFragment (inferred type).
VariableDeclaration)public ASTNode getBody()
Block or an Expressionpublic void setBody(ASTNode body)
body - a block node or an expression node
java.lang.IllegalArgumentException - if:
Block nor an Expressionpublic IMethodBinding resolveMethodBinding()
Note that bindings are generally unavailable unless requested when the AST is being built.
null if the binding cannot be
resolved
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||