Snippet.SubKind (Java SE 19 & JDK 19) (original) (raw)
All Implemented Interfaces:
[Serializable](../../../java.base/java/io/Serializable.html "interface in java.io")
, [Comparable](../../../java.base/java/lang/Comparable.html "interface in java.lang")<[Snippet.SubKind](Snippet.SubKind.html "enum class in jdk.jshell")>
, [Constable](../../../java.base/java/lang/constant/Constable.html "interface in java.lang.constant")
Enclosing class:
[Snippet](Snippet.html "class in jdk.jshell")
The detailed variety of a snippet. This is a sub-classification of the Kind. The Kind of a SubKind is accessible withkind().
Nested Class Summary
Enum Constant Summary
Enum Constants
An annotation interface declaration.
An assignment expression.
An interface declaration.
An expression which has not been wrapped in a temporary variable (reserved).
Single-Static-Import Declaration.
Single-Type-Import Declaration.
Static-Import-on-Demand Declaration.
An expression whose value has been stored in a temporary variable.
Type-Import-on-Demand Declaration.
A variable declaration without initializer.
A variable declaration with an initializer expression.
A simple variable reference expression.
Method Summary
boolean
[hasValue](#hasValue%28%29)()
Indicates whether this SubKind
is executable and is non-void
.boolean
Indicates whether this SubKind
is executable.[kind](#kind%28%29)()
Returns the enum constant of this class with the specified name.[values](#values%28%29)()
Returns an array containing the constants of this enum class, in the order they are declared.
Methods declared in class java.lang.Enum
[clone](../../../java.base/java/lang/Enum.html#clone%28%29), [compareTo](../../../java.base/java/lang/Enum.html#compareTo%28E%29), [describeConstable](../../../java.base/java/lang/Enum.html#describeConstable%28%29), [equals](../../../java.base/java/lang/Enum.html#equals%28java.lang.Object%29), [finalize](../../../java.base/java/lang/Enum.html#finalize%28%29), [getDeclaringClass](../../../java.base/java/lang/Enum.html#getDeclaringClass%28%29), [hashCode](../../../java.base/java/lang/Enum.html#hashCode%28%29), [name](../../../java.base/java/lang/Enum.html#name%28%29), [ordinal](../../../java.base/java/lang/Enum.html#ordinal%28%29), [toString](../../../java.base/java/lang/Enum.html#toString%28%29), [valueOf](../../../java.base/java/lang/Enum.html#valueOf%28java.lang.Class,java.lang.String%29)
Enum Constant Details
SINGLE_TYPE_IMPORT_SUBKIND
public static final Snippet.SubKind SINGLE_TYPE_IMPORT_SUBKIND
Single-Type-Import Declaration. An import declaration of a single type.
See Java Language Specification:
7.5.1 Single-Type-Import DeclarationsTYPE_IMPORT_ON_DEMAND_SUBKIND
public static final Snippet.SubKind TYPE_IMPORT_ON_DEMAND_SUBKIND
Type-Import-on-Demand Declaration. A non-static "star" import.
See Java Language Specification:
7.5.2 Type-Import-on-Demand DeclarationsSINGLE_STATIC_IMPORT_SUBKIND
public static final Snippet.SubKind SINGLE_STATIC_IMPORT_SUBKIND
Single-Static-Import Declaration. An import of a static member.
See Java Language Specification:
7.5.3 Single-Static-Import DeclarationsSTATIC_IMPORT_ON_DEMAND_SUBKIND
public static final Snippet.SubKind STATIC_IMPORT_ON_DEMAND_SUBKIND
Static-Import-on-Demand Declaration. A static "star" import of all static members of a named type.
See Java Language Specification:
7.5.4 Static-Import-on-Demand DeclarationsCLASS_SUBKIND
See Java Language Specification:
8.1 Class DeclarationsINTERFACE_SUBKIND
See Java Language Specification:
9.1 Interface DeclarationsENUM_SUBKIND
See Java Language Specification:
8.9 Enum TypesRECORD_SUBKIND
See Java Language Specification:
8.10 Record Types
Since:
14ANNOTATION_TYPE_SUBKIND
See Java Language Specification:
9.6 Annotation TypesMETHOD_SUBKIND
See Java Language Specification:
8.4 Method DeclarationsVAR_DECLARATION_SUBKIND
A variable declaration without initializer. A
SubKind
of Snippet.Kind.VAR.
See Java Language Specification:
8.3 Field DeclarationsVAR_DECLARATION_WITH_INITIALIZER_SUBKIND
public static final Snippet.SubKind VAR_DECLARATION_WITH_INITIALIZER_SUBKIND
A variable declaration with an initializer expression. ASubKind
of Snippet.Kind.VAR.
See Java Language Specification:
8.3 Field DeclarationsTEMP_VAR_EXPRESSION_SUBKIND
public static final Snippet.SubKind TEMP_VAR_EXPRESSION_SUBKIND
An expression whose value has been stored in a temporary variable. ASubKind
of Snippet.Kind.VAR.
See Java Language Specification:
15 ExpressionsVAR_VALUE_SUBKIND
See Java Language Specification:
15.11 Field Access ExpressionsASSIGNMENT_SUBKIND
See Java Language Specification:
15.26 Assignment OperatorsOTHER_EXPRESSION_SUBKIND
An expression which has not been wrapped in a temporary variable (reserved). A
SubKind
of Snippet.Kind.EXPRESSION.STATEMENT_SUBKIND
See Java Language Specification:
14.5 StatementsUNKNOWN_SUBKIND
Method Details
values
Returns an array containing the constants of this enum class, in the order they are declared.
Returns:
an array containing the constants of this enum class, in the order they are declaredvalueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
Parameters:
name
- the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
[IllegalArgumentException](../../../java.base/java/lang/IllegalArgumentException.html "class in java.lang")
- if this enum class has no constant with the specified name
[NullPointerException](../../../java.base/java/lang/NullPointerException.html "class in java.lang")
- if the argument is nullisExecutable
public boolean isExecutable()
Indicates whether thisSubKind
is executable.
Returns:
true
if thisSubKind
can be executed; otherwisefalse
hasValue
public boolean hasValue()
Indicates whether thisSubKind
is executable and is non-void
.
Returns:
true
if thisSubKind
has a value; otherwisefalse
kind
The Snippet.Kind that corresponds to this
SubKind
.
Returns:
the fixedKind
for thisSubKind