ExpressionSnippet (Java SE 19 & JDK 19) (original) (raw)
public class ExpressionSnippet extends Snippet
Snippet for an assignment or variable-value expression. The Kind is Snippet.Kind.EXPRESSION.
ExpressionSnippet
is immutable: an access to any of its methods will always return the same result. and thus is thread-safe.
See Java Language Specification:
Since:
9
Nested Class Summary
Method Summary
[name](#name%28%29)()
Variable name which is the value of the expression.[typeName](#typeName%28%29)()
Methods declared in class java.lang.Object
[clone](../../../java.base/java/lang/Object.html#clone%28%29), [equals](../../../java.base/java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../../java.base/java/lang/Object.html#finalize%28%29), [getClass](../../../java.base/java/lang/Object.html#getClass%28%29), [hashCode](../../../java.base/java/lang/Object.html#hashCode%28%29), [notify](../../../java.base/java/lang/Object.html#notify%28%29), [notifyAll](../../../java.base/java/lang/Object.html#notifyAll%28%29), [toString](../../../java.base/java/lang/Object.html#toString%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28long%29), [wait](../../../java.base/java/lang/Object.html#wait%28long,int%29)
Method Details
name
Variable name which is the value of the expression. Since the expression is either just a variable identifier or it is an assignment to a variable, there is always a variable which is the subject of the expression. All other forms of expression become temporary variables which are instead referenced by a VarSnippet.
Returns:
the name of the variable which is the subject of the expression.typeName
Type of the expression
Returns:
String representation of the type of the expression.