Class IzTypeDeclaration

java.lang.Object
com.iizigo.java.parser.type.IzTypeDeclaration
All Implemented Interfaces:
Cloneable

public class IzTypeDeclaration extends Object implements Cloneable
A type declaration for a class or interface.
Author:
Christopher Mindus
  • Field Details

    • classFQN

      public final String classFQN
      The fully qualified name.
    • packageFQN

      public final String packageFQN
      The package fully qualified name.
    • flags

      public final int flags
      Flags.
    • type

      public final IType type
      The Java element.
  • Method Details

    • clone

      public IzTypeDeclaration clone()
      Clones the instance.
      Overrides:
      clone in class Object
    • canInstantiate

      public String canInstantiate()
      Checks if this class can be instantiated for IIZI with default constructor.
      Returns:
      null for OK, otherwise an error.
    • hasAnnotation

      public boolean hasAnnotation(String annotationFQN)
      Checks if method is annotation by the fully qualified annotation name.
    • implementsInterface

      public boolean implementsInterface(String interfaceFQN)
      Checks if method is annotation by the fully qualified annotation name.
    • checkAnnotation

      public String checkAnnotation(String annotationFQN, String param, String value)
      Checks the annotation for optional parameter value.
    • getClassNameNoPackage

      public String getClassNameNoPackage()
      Gets the class name without package.
    • getMethods

      public ArrayList<IzMethodDeclaration> getMethods(boolean isStatic, String annotation)
      Gets the public methods that match the annotation (if present).
      Parameters:
      annotation - The annotation required or null for none.
      Returns:
      A new array with matching methods.
    • getAvailableMethods

      public void getAvailableMethods(ArrayList<String> list, IType clazz, String instanceAnnotation, String staticAnnotation)
      Gets the list of methods that can match the specified annotations.
      Parameters:
      list - List filled in with info upon return.
      clazz - The class to search in for the instanceAnnotation.
      instanceAnnotation - The instance annotation to search the class for, null for none.
      staticAnnotation - Static annotation to search classes for static methods.
    • hasMethod

      public boolean hasMethod(String methodName)
      Checks if a method name is present without checking signatures, etc.