This documentation differs from the official API.
Jadeite adds
extra features to the API including:
variable font sizes,
constructions examples,
placeholders for classes and methods, and auto-generated “See Also” links.
Additionally it
is missing some items found in standard Javadoc documentation, including:
generics type information,
“Deprecated” tags and comments,
“See Also” links,
along with other minor differences.
Please send any questions or feedback to
bam@cs.cmu.edu.
javax.lang.model.element
enum NestingKind
- All Implemented Interfaces:
- Serializable, Comparable
public final enum NestingKind
extends Enum
The nesting kind of a type element.
Type elements come in four varieties:
top-level, member, local, and anonymous.
Nesting kind is a non-standard term used here to denote this
classification.
Note that it is possible additional nesting kinds will be added
in future versions of the platform.
Example: The classes below are annotated with their nesting kind.
import java.lang.annotation.*;
import static java.lang.annotation.RetentionPolicy.*;
import javax.lang.model.element.*;
import static javax.lang.model.element.NestingKind.*;
@Nesting(TOP_LEVEL)
public class NestingExamples {
@Nesting(MEMBER)
static class MemberClass1{}
@Nesting(MEMBER)
class MemberClass2{}
public static void main(String... argv) {
@Nesting(LOCAL)
class LocalClass{};
Class<?>[] classes = {
NestingExamples.class,
MemberClass1.class,
MemberClass2.class,
LocalClass.class
};
for(Class<?> clazz : classes) {
System.out.format("%s is %s%n",
clazz.getName(),
clazz.getAnnotation(Nesting.class).value());
}
}
}
@Retention(RUNTIME)
@interface Nesting {
NestingKind value();
}
Method Summary |
boolean |
Does this constant correspond to a nested type element?
A nested type element is any that is not top-level.
|
static NestingKind |
|
static NestingKind[] |
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ANONYMOUS
public static final NestingKind ANONYMOUS
-
LOCAL
public static final NestingKind LOCAL
-
MEMBER
public static final NestingKind MEMBER
-
TOP_LEVEL
public static final NestingKind TOP_LEVEL
-
isNested
public boolean isNested()
-
Does this constant correspond to a nested type element?
A nested type element is any that is not top-level.
An inner type element is any nested type element that
is not {@linkplain Modifier#STATIC static}.
valueOf
public static NestingKind valueOf(String name)
-
- Parameters:
name
values
public static NestingKind[] values()
-
This documentation differs from the official API.
Jadeite adds
extra features to the API including:
variable font sizes,
constructions examples,
placeholders for classes and methods, and auto-generated “See Also” links.
Additionally it
is missing some items found in standard Javadoc documentation, including:
generics type information,
“Deprecated” tags and comments,
“See Also” links,
along with other minor differences.
Please send any questions or feedback to
bam@cs.cmu.edu.
This page displays the
Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
The official Sun™ documentation can be found here at
http://java.sun.com/javase/6/docs/api/.