Package org.codehaus.janino
Class Java.FunctionDeclarator
- java.lang.Object
-
- org.codehaus.janino.Java.Located
-
- org.codehaus.janino.Java.AbstractTypeBodyDeclaration
-
- org.codehaus.janino.Java.FunctionDeclarator
-
- All Implemented Interfaces:
Java.Annotatable,Java.DocCommentable,Java.Locatable,Java.Scope,Java.TypeBodyDeclaration
- Direct Known Subclasses:
Java.ConstructorDeclarator,Java.MethodDeclarator
- Enclosing class:
- Java
public abstract static class Java.FunctionDeclarator extends Java.AbstractTypeBodyDeclaration implements Java.Annotatable, Java.DocCommentable
Abstract base class forJava.ConstructorDeclaratorandJava.MethodDeclarator.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJava.FunctionDeclarator.FormalParameterRepresentation of a (formal) function parameter.static classJava.FunctionDeclarator.FormalParametersRepresentation of the (formal) function parameters.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringdocCommentJava.FunctionDeclarator.FormalParametersformalParametersThe parameters of the function.java.util.Map<java.lang.String,Java.LocalVariable>localVariablesMapping of variable names toJava.LocalVariables.java.lang.StringnameThe name of the function ("<init>"for constructors).(package private) ITypereturnTypeSet by "compile()".java.util.List<? extends Java.BlockStatement>statementsThe statements that comprise the function;nullfor abstract method declarations.Java.Type[]thrownExceptionsThe types of the declared exceptions.Java.TypetypeThe return type of the function (VOID for constructors).-
Fields inherited from class org.codehaus.janino.Java.AbstractTypeBodyDeclaration
modifiers
-
Fields inherited from class org.codehaus.janino.Java.Located
NOWHERE
-
-
Constructor Summary
Constructors Constructor Description FunctionDeclarator(Location location, java.lang.String docComment, Java.Modifier[] modifiers, Java.Type type, java.lang.String name, Java.FunctionDeclarator.FormalParameters formalParameters, Java.Type[] thrownExceptions, java.util.List<? extends Java.BlockStatement> statements)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <R,EX extends java.lang.Throwable>
Raccept(Visitor.FunctionDeclaratorVisitor<R,EX> visitor)Invokes the "visit...()" method ofVisitor.FunctionDeclaratorVisitorfor the concreteJava.FunctionDeclaratortype.<R,EX extends java.lang.Throwable>
Raccept(Visitor.TypeBodyDeclarationVisitor<R,EX> visitor)Invokes the "visit...()" method ofVisitor.TypeBodyDeclarationVisitorfor the concreteJava.TypeBodyDeclarationtype.AccessgetAccess()Java.Annotation[]getAnnotations()java.lang.StringgetDocComment()Java.ScopegetEnclosingScope()booleanhasDeprecatedDocTag()Returnstrueif the object has a doc comment and the@deprecatedtag appears in the doc comment.booleanisStrictfp()voidsetDeclaringType(Java.TypeDeclaration declaringType)Sets the type declaration that this declaration belongs to.voidsetEnclosingScope(Java.Scope enclosingScope)Forward-implementsJava.BlockStatement.setEnclosingScope(Java.Scope).-
Methods inherited from class org.codehaus.janino.Java.AbstractTypeBodyDeclaration
getDeclaringType, getModifiers
-
Methods inherited from class org.codehaus.janino.Java.Located
getLocation, throwCompileException
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.codehaus.janino.Java.Locatable
getLocation, throwCompileException
-
-
-
-
Field Detail
-
docComment
@Nullable private final java.lang.String docComment
-
type
public final Java.Type type
The return type of the function (VOID for constructors).
-
name
public final java.lang.String name
The name of the function ("<init>"for constructors).
-
formalParameters
public final Java.FunctionDeclarator.FormalParameters formalParameters
The parameters of the function.
-
thrownExceptions
public final Java.Type[] thrownExceptions
The types of the declared exceptions.
-
statements
@Nullable public final java.util.List<? extends Java.BlockStatement> statements
The statements that comprise the function;nullfor abstract method declarations.
-
localVariables
@Nullable public java.util.Map<java.lang.String,Java.LocalVariable> localVariables
Mapping of variable names toJava.LocalVariables.
-
-
Constructor Detail
-
FunctionDeclarator
public FunctionDeclarator(Location location, @Nullable java.lang.String docComment, Java.Modifier[] modifiers, Java.Type type, java.lang.String name, Java.FunctionDeclarator.FormalParameters formalParameters, Java.Type[] thrownExceptions, @Nullable java.util.List<? extends Java.BlockStatement> statements)
-
-
Method Detail
-
getAccess
public Access getAccess()
-
getAnnotations
public Java.Annotation[] getAnnotations()
- Specified by:
getAnnotationsin interfaceJava.Annotatable- Overrides:
getAnnotationsin classJava.AbstractTypeBodyDeclaration- Returns:
- The annotations of this function
-
accept
@Nullable public final <R,EX extends java.lang.Throwable> R accept(Visitor.TypeBodyDeclarationVisitor<R,EX> visitor) throws EX extends java.lang.Throwable
Description copied from interface:Java.TypeBodyDeclarationInvokes the "visit...()" method ofVisitor.TypeBodyDeclarationVisitorfor the concreteJava.TypeBodyDeclarationtype.- Specified by:
acceptin interfaceJava.TypeBodyDeclaration- Throws:
EX extends java.lang.Throwable
-
accept
@Nullable public abstract <R,EX extends java.lang.Throwable> R accept(Visitor.FunctionDeclaratorVisitor<R,EX> visitor) throws EX extends java.lang.Throwable
Invokes the "visit...()" method ofVisitor.FunctionDeclaratorVisitorfor the concreteJava.FunctionDeclaratortype.- Throws:
EX extends java.lang.Throwable
-
setDeclaringType
public void setDeclaringType(Java.TypeDeclaration declaringType)
Description copied from interface:Java.TypeBodyDeclarationSets the type declaration that this declaration belongs to.- Specified by:
setDeclaringTypein interfaceJava.TypeBodyDeclaration- Overrides:
setDeclaringTypein classJava.AbstractTypeBodyDeclaration
-
setEnclosingScope
public void setEnclosingScope(Java.Scope enclosingScope)
Description copied from class:Java.AbstractTypeBodyDeclarationForward-implementsJava.BlockStatement.setEnclosingScope(Java.Scope).- Overrides:
setEnclosingScopein classJava.AbstractTypeBodyDeclaration
-
getEnclosingScope
public Java.Scope getEnclosingScope()
- Specified by:
getEnclosingScopein interfaceJava.Scope- Overrides:
getEnclosingScopein classJava.AbstractTypeBodyDeclaration- Returns:
- The scope that encloses this scope, or
null
-
getDocComment
@Nullable public java.lang.String getDocComment()
- Specified by:
getDocCommentin interfaceJava.DocCommentable- Returns:
- The doc comment of the object or
null
-
hasDeprecatedDocTag
public boolean hasDeprecatedDocTag()
Description copied from interface:Java.DocCommentableReturnstrueif the object has a doc comment and the@deprecatedtag appears in the doc comment.- Specified by:
hasDeprecatedDocTagin interfaceJava.DocCommentable
-
isStrictfp
public boolean isStrictfp()
-
-