ter.API
Class ClassifierAnalyser

java.lang.Object
  |
  +--ter.API.ClassifierAnalyser

public class ClassifierAnalyser
extends java.lang.Object

Title: JavInspector API for analysing a class

Description:API for analysing a class

Company: UNSA

Version:
1.0
Author:
Jerôme GAHIDE - Lucas CHARBIT - Gabriel ZERBIB - Xavier GALBOIS

Constructor Summary
ClassifierAnalyser(java.lang.Class classAnalysed, Inspector inspector)
          the constructor of this class
 
Method Summary
static TypeClass createTypeClass(int dimension, java.lang.Class cl)
          creates a TypeClass object from the dimension and the name of the class
 TypeClass formatParametre(java.lang.Class c)
          parses the name of the class c to find its type and its realname (case the class is an array)
 java.lang.String fullName()
          this function returns the full name of the classifier
 java.util.ArrayList getAllSuperInterfaces()
          get all the super interfaces of the class analysed
 ClassifierAnalyser[] getAllSuperInterfacesClassifier()
          this function return an Array of java.lang.Class of all the SuperInterfaces
 java.util.ArrayList getAnonymousInternalClasses()
          get a list of java.lang.Class of all the internal anonymous classes
 java.lang.Class getClassAnalysed()
          get the class analysed
 int getClassModifiers()
          get the class modifiers of the analysed class(attributes)
 java.lang.Package getClassPackage()
          get the package of the analysed class
 java.lang.String getCompleteName()
           
 ConstructorAnalyser[] getConstructor()
          returns the array of ConstructorAnalyser of ALL the constructors
 java.util.ArrayList getConstructorsException()
          get all the exceptions thrown by any contructors
 java.util.ArrayList getConstructorsParameterType()
          this function return the ArrayList with all the classes used by the analysed class
 FieldAnalyser[] getField()
          returns the array of FieldAnalyser of ALL fields
 java.util.ArrayList getHeritageClasses()
          this function return all the super classes of the class analysed
 java.util.ArrayList getHeritageClassifier()
          get the list of heritage ClassifierAnalyser
 ClassifierAnalyser[] getInterfacesClassifier()
          Determines the interfaces implemented by the class represented by this object.
 java.lang.Class[] getInternalClasses()
          get the internal classes declared by this class
 MethodAnalyser[] getMethod()
          returns an array MethodAnalyzer of ALL Methods
 java.lang.reflect.Method getMethod(java.lang.String name, java.lang.Class[] parameterTypes, java.lang.Class cl, java.lang.Class returnType, int modifier)
          return a method that matchs with name, parameterTypes, returnType, modifier and which is in cl
 java.util.ArrayList getMethodRedefinedInClass(java.lang.Class cl)
          this function returns all the methods in the classifier who are already defined in the class cl
 java.util.ArrayList getMethodReturnType()
          this function returns all the type of return type of all methods
 java.util.ArrayList getMethodsExceptions()
          this function returns the list of all the exceptions throwed by the methods
 java.util.ArrayList getMethodsParameterType()
          this function returns all the type of parameters of all methods
 java.util.ArrayList getTypeField()
          get all the type of class for all the fields
 void initialiseAnonymousInternalClasses()
          this function initialise the anonym internal classes
 void initialiseField()
          Initilalise the informations for each field
 void initialiseHeritageClasses()
          this function initialise the heritage classes
 void initialiseHeritageClassifier()
          initialise the arraylist of all the superclasses of the analysed class
 java.lang.String modifierToString()
          get the modifier in String
static java.lang.String modifierToString(java.lang.Class cl)
          get the modifiers(attributes) of the analysed class in a String
static java.lang.String nameInternalClass(java.lang.Class cl)
          get the name of an internal class
static java.lang.String shortName(java.lang.String s)
          this function returns the short name of a class name if the name is java.lang.String this function return String
 java.lang.String toString()
          get the name of a ClassifierAnanlyser
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassifierAnalyser

public ClassifierAnalyser(java.lang.Class classAnalysed,
                          Inspector inspector)
the constructor of this class

Parameters:
classAnalysed - the class to analyse
inspector - the inspector of this
Method Detail

getClassAnalysed

public java.lang.Class getClassAnalysed()
get the class analysed

Returns:
the class analysed by this ClassifierAnalyser

getConstructor

public ConstructorAnalyser[] getConstructor()
returns the array of ConstructorAnalyser of ALL the constructors

Returns:
the array of ConstructorAnalyser of ALL the constructors

getField

public FieldAnalyser[] getField()
returns the array of FieldAnalyser of ALL fields

Returns:
the array of FieldAnalyser of ALL fields

initialiseField

public void initialiseField()
Initilalise the informations for each field


getMethod

public MethodAnalyser[] getMethod()
returns an array MethodAnalyzer of ALL Methods

Returns:
the array of FieldAnalyser of ALL fields

initialiseHeritageClassifier

public void initialiseHeritageClassifier()
initialise the arraylist of all the superclasses of the analysed class


initialiseHeritageClasses

public void initialiseHeritageClasses()
this function initialise the heritage classes


getHeritageClassifier

public java.util.ArrayList getHeritageClassifier()
get the list of heritage ClassifierAnalyser

Returns:
the list of heritage ClassifierAnalyser

getClassModifiers

public int getClassModifiers()
get the class modifiers of the analysed class(attributes)

Returns:
the class modifiers of this class(attributes)

getClassPackage

public java.lang.Package getClassPackage()
get the package of the analysed class

Returns:
the package of the analysed class

formatParametre

public TypeClass formatParametre(java.lang.Class c)
parses the name of the class c to find its type and its realname (case the class is an array)

Parameters:
c - the class to parse
Returns:
all the information abtained

createTypeClass

public static TypeClass createTypeClass(int dimension,
                                        java.lang.Class cl)
creates a TypeClass object from the dimension and the name of the class

Parameters:
dimension - the diamension of the array (0 if not an array)
cl - the class
Returns:
the TypeClass object containing the real understandable name of the analysed class

shortName

public static java.lang.String shortName(java.lang.String s)
this function returns the short name of a class name if the name is java.lang.String this function return String

Parameters:
s - the name of class
Returns:
the short name of s

getMethodsExceptions

public java.util.ArrayList getMethodsExceptions()
this function returns the list of all the exceptions throwed by the methods

Returns:
the list of all the exceptions

getConstructorsParameterType

public java.util.ArrayList getConstructorsParameterType()
this function return the ArrayList with all the classes used by the analysed class

Returns:
the ArrayList containing java.lang.Class with all the classes used by the analysed class

getConstructorsException

public java.util.ArrayList getConstructorsException()
get all the exceptions thrown by any contructors

Returns:
an arraylist of java.lang.Class object describing the exceptions

getTypeField

public java.util.ArrayList getTypeField()
get all the type of class for all the fields

Returns:
arraylist containing Class of the view

getMethodsParameterType

public java.util.ArrayList getMethodsParameterType()
this function returns all the type of parameters of all methods

Returns:
an ArrayList of java.lang.Class

getMethodReturnType

public java.util.ArrayList getMethodReturnType()
this function returns all the type of return type of all methods

Returns:
an ArrayList of java.lang.Class

getAllSuperInterfaces

public java.util.ArrayList getAllSuperInterfaces()
get all the super interfaces of the class analysed

Returns:
the list of java.lang.Class of super interfaces of the class analysed

getAllSuperInterfacesClassifier

public ClassifierAnalyser[] getAllSuperInterfacesClassifier()
this function return an Array of java.lang.Class of all the SuperInterfaces

Returns:
an Array of java.lang.Class of all the SuperInterfaces

getInternalClasses

public java.lang.Class[] getInternalClasses()
get the internal classes declared by this class

Returns:
the array containing all the internal classes

nameInternalClass

public static java.lang.String nameInternalClass(java.lang.Class cl)
get the name of an internal class

Parameters:
cl - an internal class
Returns:
the name of the internal class

modifierToString

public static java.lang.String modifierToString(java.lang.Class cl)
get the modifiers(attributes) of the analysed class in a String

Parameters:
cl - the class
Returns:
the String containing the modifiers

getInterfacesClassifier

public ClassifierAnalyser[] getInterfacesClassifier()
Determines the interfaces implemented by the class represented by this object.

Returns:
an array of ClassifierAnalyser

modifierToString

public java.lang.String modifierToString()
get the modifier in String

Returns:
a String that represents the modifiers

getCompleteName

public java.lang.String getCompleteName()

fullName

public java.lang.String fullName()
this function returns the full name of the classifier

Returns:
a String which represents the full name of the classifier

toString

public java.lang.String toString()
get the name of a ClassifierAnanlyser

Overrides:
toString in class java.lang.Object
Returns:
the full name of the classifier

initialiseAnonymousInternalClasses

public void initialiseAnonymousInternalClasses()
this function initialise the anonym internal classes


getAnonymousInternalClasses

public java.util.ArrayList getAnonymousInternalClasses()
get a list of java.lang.Class of all the internal anonymous classes

Returns:
reurns all the anonymous classes in this classifier

getMethodRedefinedInClass

public java.util.ArrayList getMethodRedefinedInClass(java.lang.Class cl)
this function returns all the methods in the classifier who are already defined in the class cl

Parameters:
cl - the class where we search the methods
Returns:
an ArrayList that contains all the methods

getMethod

public java.lang.reflect.Method getMethod(java.lang.String name,
                                          java.lang.Class[] parameterTypes,
                                          java.lang.Class cl,
                                          java.lang.Class returnType,
                                          int modifier)
return a method that matchs with name, parameterTypes, returnType, modifier and which is in cl

Parameters:
name - the name of method
parameterTypes - the parameters of method
cl - the java.lang.reflect.Class
returnType - the return type of method
modifier - the modofier of method
Returns:
the method that matchs with name, parameterTypes, cl, returnType, modifier or null if there is no method

getHeritageClasses

public java.util.ArrayList getHeritageClasses()
this function return all the super classes of the class analysed

Returns:
a list of java.lang.Class that are all the super classes of the class analysed