Class Java
java.lang.Object
org.codehaus.janino.Java
This wrapper class defines classes that represent the elements of the Java programming language.
Notice: "JLS7" refers to the Java Language Specification, Java SE 7 Edition.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConvenience class.static classBase for the various class declaration kinds.static classHolds the result ofParser.parseAbstractCompilationUnit().static classAbstract implementation ofJava.TypeBodyDeclaration.static classAbstract implementation ofJava.TypeDeclaration.static classRepresentation of the modifier flags and annotations that are associated with a declaration.static final classRepresentation of a JLS7 8.8.7.1.static final classRepresentation of a JLS7 6.5.2 "ambiguous name".static interfaceRepresentation of Java elements that can be annotated: Fields, constructors, methods, type declarations.static interfaceRepresentation of a Java annotation.static interfaceBase for package member ("top-level") and member ("nested") annotation type declarations.static final classRepresentation of a JLS7 15.9.5 "anonymous class declaration".static final classRepresentation of a JLS7 15.13 (JLS8: 15.10.3) "array access expression".static final classRepresentation of a "method reference expression", as described in JLS9 15.13, with the form "<var>arrayType</var>::new".static final classRepresentation of a JLS7 10.6 "array initializer".static interfaceThe union ofJava.ArrayInitializerandJava.Rvalue.static final classRepresentation of the JLS7 10.7 array type "length" pseudo-member.static final classRepresentation of a JLS7 10.1 "array type".static final classRepresentation of the JLS7 14.10 ASSERT statement.static final classRepresentation of all JLS7 15.26 assignments.static classstatic final classRepresentation of all non-operand-modifying binary operations.static final classRepresentation of a Java "block" (JLS7 14.2).static classRepresentation of a "lambda body" that is a block; see JLS9 15.27.2.static interfaceEverything that can be compiled to code, e.g.static final classRepresentation of a "boolean literal" (JLS7 3.10.3) (typeboolean).static classBase class forJava.Rvalues that compile better as conditional branches.static classBase class for statements that can be terminated abnormally with abreakstatement.static final classRepresentation of the JLS7 14.15 BREAK statement.static final classRepresentation of a JLS7 15.16 "cast expression".static classRepresentation of a JLS7 14.20.1 CATCH clause.static final classRepresentation of a "catch" parameter.static final classRepresentation of a "character literal" (JLS7 3.10.4) (typechar).static interfaceBase for the various class declarations (top-level class, local class, anonymous class, nested class, top-level enum, nested enum).static final classRepresentation of a "method reference expression", as described in JLS9 15.13, with the form "<var>classType</var>::new".static final classRepresentation of a JLS7 15.8.2 "class literal".static final classRepresentation of an "ordinary compilation unit" as explained in JLS9 7.3 (before Java 9 known as "compilation unit" and described in JLS8 7.3).static final classRepresentation of a JLS7 15.25 "conditional operation".static final classRepresentation of a constructor declarator.static classAbstract bas class forJava.SuperConstructorInvocationandJava.AlternateConstructorInvocation.static classBase class for statements that support the "continue" statement.static final classRepresentation of the JLS7 14.16 CONTINUE statement.static final classRepresentation of a JLS7 15.14.2 "postfix increment operation", a JLS7 15.14.3 "postfix decrement operation", a JLS7 15.15.1 "prefix increment operation" or a JLS7 15.15.2 "prefix decrement operation".static interfaceRepresentation of a Java element that can be annotated with a DOC comment ("/** ...static final classRepresentation of a JLS7 14.13 DO statement.static interfaceBase of the possible element values in aJava.NormalAnnotation.static final classAn element value in the form of an array initializer, e.g.static classRepresentation of a "name = value" element in aJava.NormalAnnotation.static final classRepresentation of the "empty statement", i.e.static final classLazily determines and returns the enclosingJava.Scopeof the givenJava.TypeDeclaration.static final classRepresentation of an "enum constant", see JLS7 8.9.1.static interfaceBase for package member (a.k.a.static final classRepresentation of a (Java 9+) "exports directive", as explained in JLS9 7.7.2.static classRepresentation of a "lambda body" that is an expression; see JLS9 15.27.2.static final classRepresentation of the JLS7 14.8 "expression statement".static final classRepresentation of an access to a field of a class or an interface.static final classRepresentation of a JLS7 15.11 "field access expression", including the "array length" pseudo field access.static final classThis class is derived from "Statement", because it provides for the initialization of the field.static interfacestatic final classRepresentation of a "floating-point literal" (JLS7 3.10.2) (typesfloatanddouble).static final classRepresentation of a JLS7 14.14.2 "enhanced FOR statement".static classRepresentation of "lamba parameters" that include a formal parameter list; see JLS9 15.27.1.static final classRepresentation of a JLS7 14.14.1 "basic FOR statement".static classAbstract base class forJava.ConstructorDeclaratorandJava.MethodDeclarator.static classRepresentation of "lamba parameters" that consist of a single identifier; see JLS9 15.27.1static final classRepresentation of a JLS7 14.9 IF statement.static classRepresentation of "lamba parameters" that include an inferred formal parameter list; see JLS9 15.27.1.static final classRepresentation of an "instance initializer" (JLS7 8.6) or "static initializer" (JLS7 8.7).(package private) static interfaceRepresents the declaration of an inner class, i.e.static final classRepresentation of a JLS7 15.20.2 "type comparison operation".static final classRepresentation of an "integer literal" (JLS7 3.10.1) (typesintandlong).static classBase for the various interface declaration kinds.static classAbstract base class forJava.MethodInvocationandJava.SuperclassMethodInvocation.static final classRepresentation of a JLS7 14.7 "labeled statement".static interfaceRepresentation of a "lambda body", see JLS9 15.27.2.static classRepresentation of a (Java 8+) "lambda expression", see JLS9 15.27.static interfaceBase for the various "lambda parameters" styles, see JLS9 15.27.1.static classAbstract base class for the various Java literals; see JLS7 3.10.static final classRepresentation of a "local class declaration" i.e.static final classRepresentation of the JLS7 14.3 "local class declaration statement".static classRepresentation of a local variable while it is in scope during compilation.static final classRepresentation of a local variable access -- used during compilation.static final classRepresentation of a JLS7 14.4 "local variable declaration statement".static classAll local variables have a slot number; local variables that get written into the "local variable table" also have a start and end offset that defines the variable's extent in the bytecode.static interfaceThis interface is implemented by objects which are associated with a location in the source code.static classAbstract implementation ofJava.Locatable.static classRepresentation of an "lvalue", i.e.static final classRepresentation of a "marker annotation", i.e.static final classRepresentation of a member annotation type declaration, a.k.a.static classRepresentation of a "member class declaration", i.e.static final classRepresentation of a "member enum declaration", i.e.static classRepresentation of a "member interface declaration", i.e.static interfaceRepresents a class or interface declaration where the immediately enclosing scope is another class or interface declaration.static final classRepresentation of a method declarator.static final classRepresentation of a JLS7 15.12 "method invocation expression".static final classRepresentation of a "method reference expression", as described in JLS9 15.13, with the form "<var>referenceType</var>::identifier.static interfaceBase for the various modifiers (access modifiers, annotations).static classDeprecated.static final classRepresents aModularCompilationUnitas specified in JLS11 7.3.static final classRepresentation of a "module declaration", as described in JLS9 7.7.static interfaceRepresentation of a (Java 9+) "module directive", as explained in JLS9 7.7.static classBase for the various named class declarations.static interfaceRepresents the declaration of a class or an interface that has a name.static final classRepresentation of a JLS7 15.9 "anonymous class instance creation expression".static final classRepresentation of a JLS7 15.10 "array creation expression".static final classRepresentation of a JLS7 "class instance creation expression".static final classRepresentation of a JLS7 15.10 "array creation expression".static final classA "normal annotation", i.e.static final classRepresentation of a "null literal" (JLS7 3.10.7).static final classRepresentation of a (Java 9+) "opens directive", as explained in JLS9 7.7.2.static final classRepresentation of a JLS7 6.5.2.1.5 "package name".static classRepresentation of a package declaration likepackage com.acme.tools;.static final classRepresentation of a package member annotation type declaration, a.k.a.static classImplementation of a "package member class declaration", a.k.a.static final classImplementation of a "package member enum declaration", a.k.a.static classRepresentation of a "package member interface declaration", a.k.a.static interfaceRepresents a class or interface declaration on compilation unit level.(package private) static classstatic final class"Artificial" operation for accessing the parameters of the synthetic constructor of an anonymous class.static final classRepresentation of a JLS7 15.8.5 "parenthesized expression".static enumJava's primitive types.static final classRepresentation of a JLS7 4.2 "primitive type", i.e a primitive type "usage", which has a location.static final classRepresentation of a (Java 9+) "provides directive", as explained in JLS9 7.7.4.static final classRepresentation of an JLS7 15.8.4 access to the current object or an enclosing instance.static final classRepresentation of a JLS7 4.3 reference type.static final classRepresentation of a (Java 9+) "requires directive", as explained in JLS9 7.7.1.static final classRepresentation of the JLS7 14.17 RETURN statement.static classRepresentation of an "rvalue", i.e.static final classRepresentation of the first part of a JLS7 15.9 "Qualified class instance creation expression": The "a.new MyClass" part of "a.new MyClass(...)" expression.static interfaceRepresentation of a Java "scope", e.g.static final classThis class is not used when code is parsed; it is intended for "programmatic" literals.static final classThis class is not used when code is parsed; it is intended for "programmatic" types.static final classRepresentation of a "single-element annotation", i.e.static classEverything that can occur in the body of a method or in a block.static final classRepresentation of a "string literal" (JLS7 3.10.5) (typeString).static final classRepresentation of an JLS7 "superclass field access expression", e.g.static final classRepresentation of a JLS7 15.12.1.1.3 "superclass method invocation".static final classRepresentation of a JLS7 8.8.7.1.static final classThe JLS7 14.10switchStatement.static final classRepresentation of a JLS7 14.9 SYNCHRONIZED statement.static final classRepresentation of a "text block" (JLS17 3.10.6 Text Blocks) (typeString).static final classRepresentation of an JLS7 15.8.3 access to the innermost enclosing instance.static final classRepresentation of a JLS7 14.18 THROW statement.static final classRepresentation of a JLS7 14.20 TRY statement.static classRepresentation of a Java type.static interfaceRepresentation of a JLS7 4.5.1 type argument.static interfaceRepresentation of a "ClassBodyDeclaration" or an "InterfaceMemberDeclaration".static interfaceBase for the various kinds of type declarations, e.g.static classRepresentation of a type parameter (which declares a type variable).static final classRepresentation of a JLS7 15.15.3 "unary plus operator", a JLS7 15.15.4 "unary minus operator", a JLS7 15.15.5 "bitwise complement operator" or a JLS7 15.15.6 "logical complement operator".static final classRepresentation of a (Java 9+) "uses directive", as explained in JLS9 7.7.3.static final classUsed by FieldDeclaration and LocalVariableDeclarationStatement.static final classRepresentation of the JLS7 14.2 WHILE statement.static classRepresentation of a JLS7 4.5.1 "wildcard". -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Java.AccessModifier[]accessModifiers(Location location, String... keywords) private static Java.Annotation[]getAnnotations(Java.Modifier[] modifiers) private static booleanhasAccessModifier(Java.Modifier[] modifiers, String... keywords) static Stringstatic Stringstatic Stringprivate static Accessmodifiers2Access(Java.Modifier[] modifiers) private static StringtoString(Java.Modifier[] modifiers)
-
Constructor Details
-
Java
private Java()
-
-
Method Details
-
join
-
join
-
join
-
accessModifiers
- Returns:
- An array of
Java.Modifiers, parsed from a sequence of access modifier keywords
-
hasAccessModifier
- Returns:
- Whether the modifiers contain any of the access modifier keywords
-
getAnnotations
-
modifiers2Access
-
toString
-
Java.Modifier[](incompatible API change in JANINO version 3.0.13)