Class IzTypeDeclaration

  • All Implemented Interfaces:
    java.lang.Cloneable

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

      Fields 
      Modifier and Type Field Description
      java.lang.String classFQN
      The fully qualified name.
      int flags
      Flags.
      java.lang.String packageFQN
      The package fully qualified name.
      org.eclipse.jdt.core.IType type
      The Java element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String canInstantiate()
      Checks if this class can be instantiated for iizi with default constructor.
      java.lang.String checkAnnotation​(java.lang.String annotationFQN, java.lang.String param, java.lang.String value)
      Checks the annotation for optional parameter value.
      IzTypeDeclaration clone()
      Clones the instance.
      void getAvailableMethods​(java.util.ArrayList<java.lang.String> list, org.eclipse.jdt.core.IType clazz, java.lang.String instanceAnnotation, java.lang.String staticAnnotation)
      Gets the list of methods that can match the specified annotations.
      java.lang.String getClassNameNoPackage()
      Gets the class name without package.
      java.util.ArrayList<IzMethodDeclaration> getMethods​(boolean isStatic, java.lang.String annotation)
      Gets the public methods that match the annotation (if present).
      boolean hasAnnotation​(java.lang.String annotationFQN)
      Checks if method is annotation by the fully qualified annotation name.
      boolean hasMethod​(java.lang.String methodName)
      Checks if a method name is present without checking signatures, etc.
      boolean implementsInterface​(java.lang.String interfaceFQN)
      Checks if method is annotation by the fully qualified annotation name.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • classFQN

        public final java.lang.String classFQN
        The fully qualified name.
      • packageFQN

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

        public final int flags
        Flags.
      • type

        public final org.eclipse.jdt.core.IType type
        The Java element.
    • Method Detail

      • clone

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

        public java.lang.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​(java.lang.String annotationFQN)
        Checks if method is annotation by the fully qualified annotation name.
      • implementsInterface

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

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

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

        public java.util.ArrayList<IzMethodDeclaration> getMethods​(boolean isStatic,
                                                                   java.lang.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​(java.util.ArrayList<java.lang.String> list,
                                        org.eclipse.jdt.core.IType clazz,
                                        java.lang.String instanceAnnotation,
                                        java.lang.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​(java.lang.String methodName)
        Checks if a method name is present without checking signatures, etc.