Package org.codehaus.janino

# Interface Java.TypeDeclaration

All Superinterfaces:
  `Java.Annotatable`, `Java.Locatable`, `Java.Scope`

All Known Subinterfaces:
  `Java.AnnotationTypeDeclaration`, `Java.ClassDeclaration`, `Java.EnumDeclaration`, `Java.MemberTypeDeclaration`, `Java.NamedTypeDeclaration`, `Java.PackageMemberTypeDeclaration`

All Known Implementing Classes:
  `Java.AbstractClassDeclaration`, `Java.AbstractTypeDeclaration`, `Java.AnonymousClassDeclaration`, `Java.EnumConstant`, `Java.InterfaceDeclaration`, `Java.LocalClassDeclaration`, `Java.MemberAnnotationTypeDeclaration`, `Java.MemberClassDeclaration`, `Java.MemberEnumDeclaration`, `Java.MemberInterfaceDeclaration`, `Java.NamedClassDeclaration`, `Java.PackageMemberAnnotationTypeDeclaration`, `Java.PackageMemberClassDeclaration`, `Java.PackageMemberEnumDeclaration`, `Java.PackageMemberInterfaceDeclaration`

Enclosing class:
  `Java`

public static interface Java.TypeDeclaration extends Java.Annotatable, Java.Locatable, Java.Scope
Base for the various kinds of type declarations, e.g. top-level class, member interface, local class.

## Method Summary

Modifier and Type
Method
Description
`<R, EX extends Throwable>
R`
`accept(Visitor.TypeDeclarationVisitor<R,EX> visitor)`
Invokes the "`visit...()`" method of `Visitor.TypeDeclarationVisitor` for the concrete `Java.TypeDeclaration` type.
`String`
`createAnonymousClassName()`
Creates a unique name for an anonymous class.
`String`
`createLocalTypeName(String localTypeName)`
Creates a unique name for a local class or interface.
`String`
`getClassName()`
Determines the effective class name, e.g.
`Java.MemberTypeDeclaration`
`getMemberTypeDeclaration(String name)`
Returns the member type with the given name.
`Collection<Java.MemberTypeDeclaration>`
`getMemberTypeDeclarations()`
`Java.MethodDeclarator`
`getMethodDeclaration(String name)`
Returns the first method declared with the given name.
`List<Java.MethodDeclarator>`
`getMethodDeclarations()`

### Methods inherited from interface org.codehaus.janino.Java.Annotatable

`getAnnotations`

### Methods inherited from interface org.codehaus.janino.Java.Locatable

`getLocation, throwCompileException`

### Methods inherited from interface org.codehaus.janino.Java.Scope

`getEnclosingScope`

## Method Details

### getMemberTypeDeclaration

@Nullable Java.MemberTypeDeclaration getMemberTypeDeclaration(String name)
Returns the member type with the given name.

Returns:
  `null` if a member type with that name is not declared

### getMemberTypeDeclarations

Collection<Java.MemberTypeDeclaration> getMemberTypeDeclarations()

Returns:
  The (possibly empty) set of member types declared inside this `Java.TypeDeclaration`

### getMethodDeclaration

@Nullable Java.MethodDeclarator getMethodDeclaration(String name)
Returns the first method declared with the given name. (Does not honor inherited methods.)

Returns:
  `null` if a method with this name is not declared

### getMethodDeclarations

List<Java.MethodDeclarator> getMethodDeclarations()

Returns:
  The list of methods declared in this `Java.TypeDeclaration`, not including methods declared in supertypes

### getClassName

String getClassName()
Determines the effective class name, e.g. "pkg.Outer$Inner".

### createLocalTypeName

String createLocalTypeName(String localTypeName)
Creates a unique name for a local class or interface.

### createAnonymousClassName

String createAnonymousClassName()
Creates a unique name for an anonymous class.

### accept

@Nullable <R, EX extends Throwable> R accept(Visitor.TypeDeclarationVisitor<R,EX> visitor) throws EX
Invokes the "`visit...()`" method of `Visitor.TypeDeclarationVisitor` for the concrete `Java.TypeDeclaration` type.

Throws:
  `EX`