janino.net

org.codehaus.janino
Class Java.FunctionDeclarator

java.lang.Object
  extended by org.codehaus.janino.Java.Located
      extended by org.codehaus.janino.Java.AbstractTypeBodyDeclaration
          extended by 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 for Java.ConstructorDeclarator and Java.MethodDeclarator.


Nested Class Summary
static class Java.FunctionDeclarator.FormalParameter
          Representation of a (formal) function parameter.
static class Java.FunctionDeclarator.FormalParameters
          Representation of the (formal) function parameters.
 
Field Summary
 Java.FunctionDeclarator.FormalParameters formalParameters
          The parameters of the function.
 Map<String,Java.LocalVariable> localVariables
          Mapping of variable names to Java.LocalVariables.
 Java.Modifiers modifiers
          The Java.Modifiers of this declarator.
 String name
          The name of the function ("" for constructors.
 List<? extends Java.BlockStatement> optionalStatements
          The statements that comprise the function; null for abstract method declarations.
 Java.Type[] thrownExceptions
          The types of the declared exceptions.
 Java.Type type
          The 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
Java.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
abstract  void accept(Visitor.FunctionDeclaratorVisitor visitor)
          Invokes the 'visit...()' method of Visitor.FunctionDeclaratorVisitor for the concrete Java.FunctionDeclarator type.
 Java.Annotation[] getAnnotations()
           
 String getDocComment()
           
 Java.Scope getEnclosingScope()
           
 boolean hasDeprecatedDocTag()
          Returns true if the object has a doc comment and the @deprecated tag appears in the doc comment.
 void setDeclaringType(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.TypeBodyDeclaration
accept
 
Methods inherited from interface org.codehaus.janino.Java.Locatable
getLocation, throwCompileException
 

Field Detail

modifiers

public final Java.Modifiers modifiers
The Java.Modifiers of 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; null for abstract method declarations.


localVariables

public Map<String,Java.LocalVariable> localVariables
Mapping of variable names to Java.LocalVariables.

Constructor Detail

Java.FunctionDeclarator

public Java.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 of Visitor.FunctionDeclaratorVisitor for the concrete Java.FunctionDeclarator type.


setDeclaringType

public void setDeclaringType(Java.TypeDeclaration declaringType)
Description copied from interface: Java.TypeBodyDeclaration
Sets the type declaration that this declaration belongs to.

Specified by:
setDeclaringType in interface Java.TypeBodyDeclaration
Overrides:
setDeclaringType in class Java.AbstractTypeBodyDeclaration

getEnclosingScope

public Java.Scope getEnclosingScope()
Specified by:
getEnclosingScope in interface Java.Scope
Overrides:
getEnclosingScope in class Java.AbstractTypeBodyDeclaration
Returns:
The scope that encloses this scope, or null

getDocComment

public String getDocComment()
Specified by:
getDocComment in interface Java.DocCommentable
Returns:
The doc comment of the object or null

hasDeprecatedDocTag

public boolean hasDeprecatedDocTag()
Description copied from interface: Java.DocCommentable
Returns true if the object has a doc comment and the @deprecated tag appears in the doc comment.

Specified by:
hasDeprecatedDocTag in interface Java.DocCommentable

janino.net