Klasse TypeDeclarationStatement


public class TypeDeclarationStatement extends Statement
Local type declaration statement AST node type.

This kind of node is used to convert a type declaration node into a statement node by wrapping it.

 TypeDeclarationStatement:
    TypeDeclaration
    EnumDeclaration
 
Although allowed at the AST, not all arrangements of AST nodes are meaningful; in particular, only class and enum declarations are meaningful in the context of a block.
Seit:
2.0
  • Felddetails

  • Methodendetails

    • propertyDescriptors

      public static List propertyDescriptors(int apiLevel)
      Returns a list of structural property descriptors for this node type. Clients must not modify the result.
      Parameter:
      apiLevel - the API level; one of the AST.JLS* constants
      Gibt zurück:
      a list of property descriptors (element type: StructuralPropertyDescriptor)
      Seit:
      3.0
    • getDeclaration

      public AbstractTypeDeclaration getDeclaration()
      Returns the abstract type declaration of this local type declaration statement (added in JLS3 API).
      Gibt zurück:
      the type declaration node
      Seit:
      3.1
    • setDeclaration

      public void setDeclaration(AbstractTypeDeclaration decl)
      Sets the abstract type declaration of this local type declaration statement (added in JLS3 API).
      Parameter:
      decl - the type declaration node
      Löst aus:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      • a cycle in would be created
      Seit:
      3.1
    • getTypeDeclaration

      public TypeDeclaration getTypeDeclaration()
      Veraltet.
      In the JLS3 API, this method is replaced by getDeclaration(), which returns AbstractTypeDeclaration instead of TypeDeclaration.
      Returns the type declaration of this local type declaration statement (JLS2 API only).
      Gibt zurück:
      the type declaration node
      Löst aus:
      UnsupportedOperationException - if this operation is used in an AST later than JLS2
    • setTypeDeclaration

      public void setTypeDeclaration(TypeDeclaration decl)
      Veraltet.
      In the JLS3 API, this method is replaced by setDeclaration(AbstractTypeDeclaration) which takes AbstractTypeDeclaration instead of TypeDeclaration.
      Sets the type declaration of this local type declaration statement (JLS2 API only).
      Parameter:
      decl - the type declaration node
      Löst aus:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      • a cycle in would be created
      UnsupportedOperationException - if this operation is used in an AST later than JLS2
    • resolveBinding

      public ITypeBinding resolveBinding()
      Resolves and returns the binding for the class or interface declared in this type declaration statement.

      Note that bindings are generally unavailable unless requested when the AST is being built.

      Gibt zurück:
      the binding, or null if the binding cannot be resolved