Package org.codehaus.janino
The classes in this package pose the core of the Janino JavaTM compiler.
The package comprises a scanner (Scanner
, a parser (Parser
)
and a class file library. The parser builds a syntax tree from the "Java.*" classes that represents the parsed code.
The UnitCompiler.compileUnit(boolean, boolean, boolean)
method compiles this syntax tree into a ClassFile
object, which can write JavaTM bytecode to an "OutputStream".
-
Interface Summary Interface Description CodeContext.FixUp A throw-in interface that marksCodeContext.Offset
s as "fix-ups": During the execution ofCodeContext.fixUp()
, all "fix-ups" are invoked and can do last touches to the code attribute.IClass.IMember Java.Annotation Java.ArrayInitializerOrRvalue Java.BlockStatement Everything that can be compiled to code, e.g.Java.DocCommentable Java.ElementValue Java.Locatable This interface is implemented by objects which are associated with a location in the source code.Java.MemberTypeDeclaration Represents a class or interface declaration where the immediately enclosing scope is another class or interface declaration.Java.NamedTypeDeclaration Represents the declaration of a class or an interface that has a name.Java.PackageMemberTypeDeclaration Represents a class or interface declaration on compilation unit level.Java.Scope Java.TypeBodyDeclaration Representation of a "ClassBodyDeclaration" or an "InterfaceMemberDeclaration".Java.TypeDeclaration UnitCompiler.ErrorHandler Visitor.AnnotationVisitor Visitor.AtomVisitor Visitor.BlockStatementVisitor The visitor for all kinds of block statements (statements that may appear with a block).Visitor.ComprehensiveVisitor Visitor.ElementValueArrayInitializerVisitor Visitor.ElementValueVisitor Visitor.ImportVisitor The visitor for all kinds of IMPORT declarations.Visitor.LvalueVisitor Visitor.RvalueVisitor Visitor.TypeBodyDeclarationVisitor The visitor for all kinds of type body declarations (declarations that may appear in the body of a type declaration).Visitor.TypeDeclarationVisitor The visitor for all kinds of type declarations.Visitor.TypeVisitor WarningHandler Interface type forUnitCompiler.setWarningHandler(WarningHandler)
. -
Class Summary Class Description Access Return value forIClass.IMember.getAccess()
.AntCompilerAdapter A simpleorg.apache.tools.ant.taskdefs.compilers.CompilerAdapter
for the "ant" tool that silently ignores most of the configuration parameters and attempts to compile all given source files into class files.ByteArrayClassLoader ThisClassLoader
allows for the loading of a set of Java™ classes provided in class file format.CachingJavaSourceClassLoader AJavaSourceClassLoader
that uses a resource storage provided by the application to cache compiled classes and thus saving unnecessary recompilations.ClassBodyEvaluator TheoptionalClassLoader
serves two purposes: It is used to look for classes referenced by the class body.ClassFileIClass ClassLoaderIClassLoader CodeContext The context of the compilation of a function (constructor or method).Compiler A simplified substitute for the javac tool.Compiler.SimpleWarningHandler CompilerFactory The JANINO implementation ofICompilerFactory
.Descriptor Helper class that defines useful methods for handling "field descriptors" (JVMS 4.3.2) and "method descriptors" (JVMS 4.3.3).ExpressionEvaluator ThisIExpressionEvaluator
is implemented by creating and compiling a temporary compilation unit defining one class with one static method with one RETURN statement.FilterWarningHandler Invokes a delegate iff the handle of the warning matches one or more of a set ofStringPattern
s.IClass A simplified equivalent to "java.lang.reflect".IClassLoader Loads anIClass
by type name.Java This wrapper class defines classes that represent the elements of the Java™ programming language.Java.AbstractTypeBodyDeclaration Java.AbstractTypeDeclaration Java.AlternateConstructorInvocation Java.AmbiguousName This class is special: It does not extend/implement the Atom subclasses, but overrides Atom's "to...()" methods.Java.AnonymousClassDeclaration Java.ArrayAccessExpression This class implements an array access.Java.ArrayInitializer Represents a Java™ array initializer (JLS 10.6).Java.ArrayLength Java.ArrayType Representation of a Java™ array type (JLS 10.1).Java.AssertStatement Java.Assignment Java.Atom Java.BasicType Representation of a Java™ "basic type" (obviously equaivalent to a "primitive type") (JLS 4.2).Java.BinaryOperation Representation of all non-operand-modifying Java™ binary operations.Java.Block Representation of a Java™ "block" (JLS 14.2).Java.BooleanLiteral Java.BooleanRvalue Base class forJava.Rvalue
s that compile better as conditional branches.Java.BreakableStatement Base class for statements that can be terminated abnormally with a "break" statement.Java.BreakStatement Representation of the Java™ "break" statement (JLS 14.14).Java.Cast Java.CatchClause Java.CharacterLiteral Java.ClassDeclaration Java.ClassLiteral Java.CompilationUnit Holds the result ofParser.parseCompilationUnit()
.Java.CompilationUnit.ImportDeclaration Java.CompilationUnit.SingleStaticImportDeclaration Represents a single static import declaration likeJava.CompilationUnit.SingleTypeImportDeclaration Represents a single type import declaration likeJava.CompilationUnit.StaticImportOnDemandDeclaration Represents a static-import-on-demand declaration likeJava.CompilationUnit.TypeImportOnDemandDeclaration Represents a type-import-on-demand declaration likeJava.ConditionalExpression Java.ConstructorDeclarator Java.ConstructorInvocation Java.ContinuableStatement Java.ContinueStatement Representation of the Java™ "continue" statement (JLS 14.15).Java.Crement Objects of this class represent represent one pre- or post-increment or decrement.Java.DoStatement Java.ElementValueArrayInitializer Java.ElementValuePair Java.EmptyStatement Represents the "empty statement", i.e.Java.EnclosingScopeOfTypeDeclaration Lazily determines and returns the enclosingJava.Scope
of the givenJava.TypeDeclaration
.Java.ExpressionStatement Java.FieldAccess Representation of an access to a field of a class or an interface.Java.FieldAccessExpression This class implements class or interface field access, and also the "array length" expression "xy.length".Java.FieldDeclaration This class is derived from "Statement", because it provides for the initialization of the field.Java.FloatingPointLiteral Java.ForStatement Java.FunctionDeclarator Abstract base class forJava.ConstructorDeclarator
andJava.MethodDeclarator
.Java.FunctionDeclarator.FormalParameter Java.IfStatement Java.Initializer Representation of an instance (JLS2 8.6) or static initializer (JLS2 8.7).Java.Instanceof Java.IntegerLiteral Java.InterfaceDeclaration Java.Invocation Java.LabeledStatement Java.Literal Java.LocalClassDeclaration Java.LocalClassDeclarationStatement Java.LocalVariable Used during resolution.Java.LocalVariableAccess Representation of a local variable access -- used during compilation.Java.LocalVariableDeclarationStatement Java.LocalVariableSlot All local variables have a slot number, local variables that get written into the localvariabletable also have a start and end offset that defines the variable's extent in the bytecode.Java.Located Java.Lvalue Representation of an "lvalue", i.e.Java.MarkerAnnotation Java.MemberClassDeclaration Java.MemberInterfaceDeclaration Java.MethodDeclarator Java.MethodInvocation Java.ModifiersAndAnnotations Java.NamedClassDeclaration Java.NewAnonymousClassInstance Java.NewArray Java.NewClassInstance Java.NewInitializedArray Java.NormalAnnotation Java.NullLiteral Java.Package Java.PackageDeclaration Represents a package declaration likeJava.PackageMemberClassDeclaration Java.PackageMemberInterfaceDeclaration Java.ParameterAccess Java.ParenthesizedExpression Java.QualifiedThisReference Representation of an access to the current object or an enclosing instance.Java.ReferenceType Java.ReturnStatement Java.Rvalue Representation of an "rvalue", i.e.Java.RvalueMemberType Java.SimpleType Java.SingleElementAnnotation Java.Statement Everything that can occur in the body of a method or in a block.Java.StringLiteral Java.SuperclassFieldAccessExpression Representation of "super.fld" and "Type.super.fld".Java.SuperclassMethodInvocation Java.SuperConstructorInvocation Java.SwitchStatement 14.10 The "switch" StatementJava.SwitchStatement.SwitchBlockStatementGroup Java.SynchronizedStatement Java.ThisReference Representation of an access to the innermost enclosing instance.Java.ThrowStatement Java.TryStatement Java.Type Representation of a Java™ type.Java.UnaryOperation This class implements the unary operators "+", "-", "~" and "!".Java.VariableDeclarator Used by FieldDeclaration and LocalVariableDeclarationStatement.Java.WhileStatement JavaSourceClassLoader AClassLoader
that, unlike usualClassLoader
s, does not load byte code, but reads Java™ source code and then scans, parses, compiles and loads it into the virtual machine.JavaSourceIClassLoader ThisIClassLoader
finds, scans and parses compilation units.MethodDescriptor Representation of a "method descriptor" (JVMS 4.3.3).Mod This class defines constants and convenience methods for the handling of modifiers as defined by the JVM.Parser A parser for the Java™ programming language.Parser.ClassDeclarationContext Parser.InterfaceDeclarationContext ResourceFinderIClassLoader Scanner Splits up a character stream into tokens and returns them asString
objects.ScriptEvaluator A number of "convenience constructors" exist that execute the setup steps instantly.SimpleCompiler To set up aSimpleCompiler
object, proceed as described forISimpleCompiler
.UnicodeUnescapeReader AFilterReader
that unescapes the "Unicode Escapes" as described in the Java Language Specification, 2nd edition.UnitCompiler This class actually implements the Java™ compiler.UnitCompiler.SimpleIField Short-hand implementation ofIClass.IField
that implements a non-constant, non-static, package-accessible field.UnparseVisitor A visitor that unparses (un-compiles) an AST to aWriter
.Visitor Basis for the "visitor" pattern as described in "Gamma, Helm, Johnson, Vlissides: Design Patterns". -
Exception Summary Exception Description JaninoRuntimeException All Janino components that throwRuntimeException
throw this subclass to allow for client libraries to intercept them more easily.UnicodeUnescapeException Represents a problem that occurred while unescaping a unicode escape sequence through aUnicodeUnescapeReader
.