Top Description Inners Constructors Methods
org.codehaus.janino

public final Class Java

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collection, .Collections, .HashMap, .Iterator, .List, .Map, .SortedMap, .TreeMap, org.codehaus.commons.compiler.CompileException, .InternalCompilerException, .Location, org.codehaus.commons.compiler.util.iterator.ReverseListIterator, org.codehaus.commons.nullanalysis.Nullable, org.codehaus.janino.CodeContext.Offset, .IClass.IMethod, .Java.FunctionDeclarator.FormalParameter, .Java.FunctionDeclarator.FormalParameters, .Visitor.AbstractCompilationUnitVisitor, .Visitor.AnnotationVisitor, .Visitor.ArrayInitializerOrRvalueVisitor, .Visitor.AtomVisitor, .Visitor.BlockStatementVisitor, .Visitor.ConstructorInvocationVisitor, .Visitor.ElementValueVisitor, .Visitor.FieldDeclarationOrInitializerVisitor, .Visitor.FunctionDeclaratorVisitor, .Visitor.ImportVisitor, .Visitor.LambdaBodyVisitor, .Visitor.LambdaParametersVisitor, .Visitor.LvalueVisitor, .Visitor.ModifierVisitor, .Visitor.ModuleDirectiveVisitor, .Visitor.RvalueVisitor, .Visitor.TryStatementResourceVisitor, .Visitor.TypeArgumentVisitor, .Visitor.TypeBodyDeclarationVisitor, .Visitor.TypeDeclarationVisitor, .Visitor.TypeVisitor, org.codehaus.janino.util.AbstractTraverser

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 and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
Java.AbstractAnnotation

Convenience class.

public abstract static class
Java.AbstractClassDeclaration

Base for the various class declaration kinds.

public abstract static class
public abstract static class
public abstract static class
Java.AbstractTypeDeclaration

Abstract implementation of TypeDeclaration.

public static class
Java.AccessModifier

Representation of the modifier flags and annotations that are associated with a declaration.

public static class
Java.AlternateConstructorInvocation

Representation of a JLS7 8.8.7.1.

public static class
Java.AmbiguousName

Representation of a JLS7 6.5.2 "ambiguous name".

public static interface
Java.Annotatable

Representation of Java elements that can be annotated: Fields, constructors, methods, type declarations.

public static interface
Java.Annotation

Representation of a Java annotation.

public static interface
Java.AnnotationTypeDeclaration

Base for package member ("top-level") and member ("nested") annotation type declarations.

public static class
Java.AnonymousClassDeclaration

Representation of a JLS7 15.9.5 "anonymous class declaration".

public static class
Java.ArrayAccessExpression

Representation of a JLS7 15.13 (JLS8: 15.10.3) "array access expression".

public static class
Java.ArrayCreationReference

Representation of a "method reference expression", as described in JLS9 15.13, with the form "<var>arrayType</var>::new".

public static class
Java.ArrayInitializer

Representation of a JLS7 10.6 "array initializer".

public static interface
public static class
Java.ArrayLength

Representation of the JLS7 10.7 array type "length" pseudo-member.

public static class
Java.ArrayType

Representation of a JLS7 10.1 "array type".

public static class
Java.AssertStatement

Representation of the JLS7 14.10 ASSERT statement.

public static class
Java.Assignment

Representation of all JLS7 15.26 assignments.

public abstract static class
public static class
Java.BinaryOperation

Representation of all non-operand-modifying binary operations.

public static class
Java.Block

Representation of a Java "block" (JLS7 14.2).

public static class
Java.BlockLambdaBody

Representation of a "lambda body" that is a block; see JLS9 15.27.2.

public static interface
Java.BlockStatement

Everything that can be compiled to code, e.g. the statements occurring in the body of a method or in a block, explicit constructor invocations and instance/static initializers.

public static class
Java.BooleanLiteral

Representation of a "boolean literal" (JLS7 3.10.3) (type boolean).

public abstract static class
Java.BooleanRvalue

Base class for Java.Rvalues that compile better as conditional branches.

public abstract static class
Java.BreakableStatement

Base class for statements that can be terminated abnormally with a break statement.

public static class
Java.BreakStatement

Representation of the JLS7 14.15 BREAK statement.

public static class
Java.Cast

Representation of a JLS7 15.16 "cast expression".

public static class
Java.CatchClause

Representation of a JLS7 14.20.1 CATCH clause.

public static class
Java.CatchParameter

Representation of a "catch" parameter.

public static class
Java.CharacterLiteral

Representation of a "character literal" (JLS7 3.10.4) (type char).

public static interface
Java.ClassDeclaration

Base for the various class declarations (top-level class, local class, anonymous class, nested class, top-level enum, nested enum).

public static class
Java.ClassInstanceCreationReference

Representation of a "method reference expression", as described in JLS9 15.13, with the form "<var>classType</var>::new".

public static class
Java.ClassLiteral

Representation of a JLS7 15.8.2 "class literal".

public static class
Java.CompilationUnit

Representation of an "ordinary compilation unit" as explained in JLS9 7.3 (before Java 9 known as "compilation unit" and described in JLS8 7.3).

public static class
Java.ConditionalExpression

Representation of a JLS7 15.25 "conditional operation".

public static class
Java.ConstructorDeclarator

Representation of a constructor declarator.

public abstract static class
public abstract static class
Java.ContinuableStatement

Base class for statements that support the "continue" statement.

public static class
Java.ContinueStatement

Representation of the JLS7 14.16 CONTINUE statement.

public static class
Java.Crement

Representation 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".

public static interface
Java.DocCommentable

Representation of a Java element that can be annotated with a DOC comment ("/** ...

public static class
Java.DoStatement

Representation of a JLS7 14.13 DO statement.

public static interface
Java.ElementValue

Base of the possible element values in a NormalAnnotation.

public static class
Java.ElementValueArrayInitializer

An element value in the form of an array initializer, e.g. "SuppressWarnings({ "null", "unchecked" })".

public static class
Java.ElementValuePair

Representation of a "name = value" element in a NormalAnnotation.

public static class
Java.EmptyStatement

Representation of the "empty statement", i.e. the blank semicolon.

public static class
Java.EnclosingScopeOfTypeDeclaration

Lazily determines and returns the enclosing Java.Scope of the given Java.TypeDeclaration.

public static class
Java.EnumConstant

Representation of an "enum constant", see JLS7 8.9.1.

public static interface
Java.EnumDeclaration

Base for package member (a.k.a. "top-level") enum declarations and nested enum declarations.

public static class
Java.ExportsModuleDirective

Representation of a (Java 9+) "exports directive", as explained in JLS9 7.7.2.

public static class
Java.ExpressionLambdaBody

Representation of a "lambda body" that is an expression; see JLS9 15.27.2.

public static class
Java.ExpressionStatement

Representation of the JLS7 14.8 "expression statement".

public static class
Java.FieldAccess

Representation of an access to a field of a class or an interface.

public static class
Java.FieldAccessExpression

Representation of a JLS7 15.11 "field access expression", including the "array length" pseudo field access.

public static class
Java.FieldDeclaration

This class is derived from "Statement", because it provides for the initialization of the field.

public static interface
public static class
Java.FloatingPointLiteral

Representation of a "floating-point literal" (JLS7 3.10.2) (types float and double).

public static class
Java.ForEachStatement

Representation of a JLS7 14.14.2 "enhanced FOR statement".

public static class
Java.FormalLambdaParameters

Representation of "lamba parameters" that include a formal parameter list; see JLS9 15.27.1.

public static class
Java.ForStatement

Representation of a JLS7 14.14.1 "basic FOR statement".

public abstract static class
public static class
Java.IdentifierLambdaParameters

Representation of "lamba parameters" that consist of a single identifier; see JLS9 15.27.1

public static class
Java.IfStatement

Representation of a JLS7 14.9 IF statement.

public static class
Java.InferredLambdaParameters

Representation of "lamba parameters" that include an inferred formal parameter list; see JLS9 15.27.1.

public static class
Java.Initializer

Representation of an "instance initializer" (JLS7 8.6) or "static initializer" (JLS7 8.7).

pack-priv static interface
Java.InnerClassDeclaration

Represents the declaration of an inner class, i.e. a class that exists in the context of zero or more "enclosing instances".

public static class
Java.Instanceof

Representation of a JLS7 15.20.2 "type comparison operation".

public static class
Java.IntegerLiteral

Representation of an "integer literal" (JLS7 3.10.1) (types int and long).

public abstract static class
Java.InterfaceDeclaration

Base for the various interface declaration kinds.

public abstract static class
public static class
Java.LabeledStatement

Representation of a JLS7 14.7 "labeled statement".

public static interface
Java.LambdaBody

Representation of a "lambda body", see JLS9 15.27.2.

public static class
Java.LambdaExpression

Representation of a (Java 8+) "lambda expression", see JLS9 15.27.

public static interface
Java.LambdaParameters

Base for the various "lambda parameters" styles, see JLS9 15.27.1.

public abstract static class
Java.Literal

Abstract base class for the various Java literals; see JLS7 3.10.

public static class
Java.LocalClassDeclaration

Representation of a "local class declaration" i.e. a class declaration that appears inside a method body.

public static class
Java.LocalClassDeclarationStatement

Representation of the JLS7 14.3 "local class declaration statement".

public static class
Java.LocalVariable

Representation of a local variable while it is in scope during compilation.

public static class
Java.LocalVariableAccess

Representation of a local variable access -- used during compilation.

public static class
Java.LocalVariableDeclarationStatement

Representation of a JLS7 14.4 "local variable declaration statement".

public static class
Java.LocalVariableSlot

All 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.

public static interface
Java.Locatable

This interface is implemented by objects which are associated with a location in the source code.

public abstract static class
Java.Located

Abstract implementation of Locatable.

public abstract static class
Java.Lvalue

Representation of an "lvalue", i.e. an expression that has a type and a value, and can be assigned to: An expression that can be the left-hand-side of an assignment.

public static class
Java.MarkerAnnotation

Representation of a "marker annotation", i.e. an annotation without any elements in parentheses.

public static class
Java.MemberAnnotationTypeDeclaration

Representation of a member annotation type declaration, a.k.a. "nested annotation type declaration".

public static class
Java.MemberClassDeclaration

Representation of a "member class declaration", i.e. a class declaration that appears inside another class or interface declaration.

public static class
Java.MemberEnumDeclaration

Representation of a "member enum declaration", i.e. an enum declaration that appears inside another class or interface declaration.

public static class
Java.MemberInterfaceDeclaration

Representation of a "member interface declaration", i.e. an interface declaration that appears inside another class or interface declaration.

public static interface
Java.MemberTypeDeclaration

Represents a class or interface declaration where the immediately enclosing scope is another class or interface declaration.

public static class
Java.MethodDeclarator

Representation of a method declarator.

public static class
Java.MethodInvocation

Representation of a JLS7 15.12 "method invocation expression".

public static class
Java.MethodReference

Representation of a "method reference expression", as described in JLS9 15.13, with the form "<var>referenceType</var>::identifier.

public static interface
Java.Modifier

Base for the various modifiers (access modifiers, annotations).

public static class
Java.Modifiers

Deprecated Many methods that previously accepted a parameter of this type now take a Modifier[] (incompatible API change in JANINO version 3.0.13)
public static class
Java.ModularCompilationUnit

Represents a ModularCompilationUnit as specified in JLS11 7.3.

public static class
Java.ModuleDeclaration

Representation of a "module declaration", as described in JLS9 7.7.

public static interface
Java.ModuleDirective

Representation of a (Java 9+) "module directive", as explained in JLS9 7.7.

public abstract static class
Java.NamedClassDeclaration

Base for the various named class declarations.

public static interface
Java.NamedTypeDeclaration

Represents the declaration of a class or an interface that has a name.

public static class
Java.NewAnonymousClassInstance

Representation of a JLS7 15.9 "anonymous class instance creation expression".

public static class
Java.NewArray

Representation of a JLS7 15.10 "array creation expression".

public static class
Java.NewClassInstance

Representation of a JLS7 "class instance creation expression".

public static class
Java.NewInitializedArray

Representation of a JLS7 15.10 "array creation expression".

public static class
Java.NormalAnnotation

A "normal annotation", i.e. an annotation with multiple elements in parentheses and curly braces.

public static class
Java.NullLiteral

Representation of a "null literal" (JLS7 3.10.7).

public static class
Java.OpensModuleDirective

Representation of a (Java 9+) "opens directive", as explained in JLS9 7.7.2.

public static class
Java.Package

Representation of a JLS7 6.5.2.1.5 "package name".

public static class
Java.PackageDeclaration

Representation of a package declaration like package com.acme.tools;.

public static class
Java.PackageMemberAnnotationTypeDeclaration

Representation of a package member annotation type declaration, a.k.a. "top-level annotation type declaration".

public static class
Java.PackageMemberClassDeclaration

Implementation of a "package member class declaration", a.k.a. "top-level class declaration".

public static class
Java.PackageMemberEnumDeclaration

Implementation of a "package member enum declaration", a.k.a. "top-level enum declaration".

public static class
Java.PackageMemberInterfaceDeclaration

Representation of a "package member interface declaration", a.k.a. "top-level interface declaration".

public static interface
Java.PackageMemberTypeDeclaration

Represents a class or interface declaration on compilation unit level.

pack-priv static class
public static class
Java.ParameterAccess

"Artificial" operation for accessing the parameters of the synthetic constructor of an anonymous class.

public static class
Java.ParenthesizedExpression

Representation of a JLS7 15.8.5 "parenthesized expression".

public static enum
Java.Primitive

Java's primitive types.

public static class
Java.PrimitiveType

Representation of a JLS7 4.2 "primitive type", i.e a primitive type "usage", which has a location.

public static class
Java.ProvidesModuleDirective

Representation of a (Java 9+) "provides directive", as explained in JLS9 7.7.4.

public static class
Java.QualifiedThisReference

Representation of an JLS7 15.8.4 access to the current object or an enclosing instance.

public static class
Java.ReferenceType

Representation of a JLS7 4.3 reference type.

public static class
Java.RequiresModuleDirective

Representation of a (Java 9+) "requires directive", as explained in JLS9 7.7.1.

public static class
Java.ReturnStatement

Representation of the JLS7 14.17 RETURN statement.

public abstract static class
Java.Rvalue

Representation of an "rvalue", i.e. an expression that has a type and a value, but cannot be assigned to: An expression that can be the right-hand-side of an assignment.

public static class
Java.RvalueMemberType

Representation of the first part of a JLS7 15.9 "Qualified class instance creation expression": The "a.new MyClass" part of "a.new MyClass(...)" expression.

public static interface
Java.Scope

Representation of a Java "scope", e.g. a compilation unit, type, method or block.

public static class
Java.SimpleConstant

This class is not used when code is parsed; it is intended for "programmatic" literals.

public static class
Java.SimpleType

This class is not used when code is parsed; it is intended for "programmatic" types.

public static class
Java.SingleElementAnnotation

Representation of a "single-element annotation", i.e. an annotation followed by a single element in parentheses.

public abstract static class
Java.Statement

Everything that can occur in the body of a method or in a block.

public static class
Java.StringLiteral

Representation of a "string literal" (JLS7 3.10.5) (type String).

public static class
Java.SuperclassFieldAccessExpression

Representation of an JLS7 "superclass field access expression", e.g. "super.fld" and "Type.super.fld".

public static class
Java.SuperclassMethodInvocation

Representation of a JLS7 15.12.1.1.3 "superclass method invocation".

public static class
Java.SuperConstructorInvocation

Representation of a JLS7 8.8.7.1.

public static class
Java.SwitchStatement

The JLS7 14.10 switch Statement.

public static class
Java.SynchronizedStatement

Representation of a JLS7 14.9 SYNCHRONIZED statement.

public static class
Java.TextBlock

Representation of a "text block" (JLS17 3.10.6 Text Blocks) (type String).

public static class
Java.ThisReference

Representation of an JLS7 15.8.3 access to the innermost enclosing instance.

public static class
Java.ThrowStatement

Representation of a JLS7 14.18 THROW statement.

public static class
Java.TryStatement

Representation of a JLS7 14.20 TRY statement.

public abstract static class
Java.Type

Representation of a Java type.

public static interface
Java.TypeArgument

Representation of a JLS7 4.5.1 type argument.

public static interface
Java.TypeBodyDeclaration

Representation of a "ClassBodyDeclaration" or an "InterfaceMemberDeclaration".

public static interface
Java.TypeDeclaration

Base for the various kinds of type declarations, e.g. top-level class, member interface, local class.

public static class
Java.TypeParameter

Representation of a type parameter (which declares a type variable).

public static class
Java.UnaryOperation

Representation 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".

public static class
Java.UsesModuleDirective

Representation of a (Java 9+) "uses directive", as explained in JLS9 7.7.3.

public static class
Java.VariableDeclarator

Used by FieldDeclaration and LocalVariableDeclarationStatement.

public static class
Java.WhileStatement

Representation of the JLS7 14.2 WHILE statement.

public static class
Java.Wildcard

Representation of a JLS7 4.5.1 "wildcard".

Constructor Summary

AccessConstructor and Description
private
Java()

Method Summary

Modifier and TypeMethod and Description
public static Java.AccessModifier[]

Returns:

An array of Modifiers, parsed from a sequence of access modifier keywords
accessModifiers
(Location location, String... keywords)

private static Java.Annotation[]
private static boolean

Returns:

Whether the modifiers contain any of the access modifier keywords
hasAccessModifier
(Java.Modifier[] modifiers, String... keywords)

public static String

Returns:

null iff a == null, or "" iff a.length == 0, or the elements of a, converted to strings concatenated and separated with the separator
join
(Object[] a, String separator)

public static String

Returns:

null iff aa == null, or "" iff aa.length == 0, or the elements of aa, converted to strings concatenated and separated with the outerSeparator
join
(Object[][] aa, String innerSeparator, String outerSeparator)

public static String

Returns:

"" iff off >= len, or elements off ... len-1 of a, converted to strings, concatenated and separated with the separator
join
(Object[] a, String separator, int off, int len)

private static Access
private static String
toString(Java.Modifier[] modifiers)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait