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.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.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 Java.FunctionDeclarator.FormalParametersformalParametersThe parameters of the function.Map<String,Java.LocalVariable>localVariablesMapping of variable names toJava.LocalVariables.Java.ModifiersmodifiersTheJava.Modifiersof this declarator.StringnameThe name of the function ("" for constructors. List<? extends Java.BlockStatement>optionalStatementsThe 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
statiC
-
Fields inherited from class org.codehaus.janino.Java.Located
NOWHERE
-
-
Constructor Summary
Constructors Constructor Description FunctionDeclarator(Location location, String optionalDocComment, Java.Modifiers modifiers, Java.Type type, String name, Java.FunctionDeclarator.FormalParameters parameters, Java.Type[] thrownExceptions, List<? extends Java.BlockStatement> optionalStatements)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaccept(Visitor.FunctionDeclaratorVisitor visitor)Invokes the 'visit...()' method ofVisitor.FunctionDeclaratorVisitorfor the concreteJava.FunctionDeclaratortype.Java.Annotation[]getAnnotations()StringgetDocComment()Java.ScopegetEnclosingScope()booleanhasDeprecatedDocTag()Returnstrueif the object has a doc comment and the@deprecatedtag appears in the doc comment.voidsetDeclaringType(Java.TypeDeclaration declaringType)Sets the type declaration that this declaration belongs to.-
Methods inherited from class org.codehaus.janino.Java.AbstractTypeBodyDeclaration
getDeclaringType, isStatic, setEnclosingScope
-
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
-
Methods inherited from interface org.codehaus.janino.Java.TypeBodyDeclaration
accept
-
-
-
-
Field Detail
-
modifiers
public final Java.Modifiers modifiers
TheJava.Modifiersof this declarator.
-
type
public final Java.Type type
The return type of the function (VOID for constructors).
-
name
public final String name
The name of the function ("" 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.
-
optionalStatements
public final List<? extends Java.BlockStatement> optionalStatements
The statements that comprise the function;nullfor abstract method declarations.
-
localVariables
public Map<String,Java.LocalVariable> localVariables
Mapping of variable names toJava.LocalVariables.
-
-
Constructor Detail
-
FunctionDeclarator
public FunctionDeclarator(Location location, String optionalDocComment, Java.Modifiers modifiers, Java.Type type, String name, Java.FunctionDeclarator.FormalParameters parameters, Java.Type[] thrownExceptions, List<? extends Java.BlockStatement> optionalStatements)
-
-
Method Detail
-
getAnnotations
public Java.Annotation[] getAnnotations()
- Returns:
- The annotations of this function
-
accept
public abstract void accept(Visitor.FunctionDeclaratorVisitor visitor)
Invokes the 'visit...()' method ofVisitor.FunctionDeclaratorVisitorfor the concreteJava.FunctionDeclaratortype.
-
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
-
getEnclosingScope
public Java.Scope getEnclosingScope()
- Specified by:
getEnclosingScopein interfaceJava.Scope- Overrides:
getEnclosingScopein classJava.AbstractTypeBodyDeclaration- Returns:
- The scope that encloses this scope, or
null
-
getDocComment
public 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
-
-