KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jofti > introspect > ClassIntrospector


1 /*
2  * Created on 01-Jan-2005
3  *
4  */

5 package com.jofti.introspect;
6
7 import java.util.List JavaDoc;
8 import java.util.Map JavaDoc;
9 import java.util.Set JavaDoc;
10
11 import com.jofti.config.IndexConfig;
12 import com.jofti.exception.JoftiException;
13
14 /**
15  *
16  *
17  * Internal Interface used by the index implementations to obtain information about the
18  * Classes and objects to be indexed.<p>
19  *
20  * @author Steve Woodcock (Steve@jofti.com)
21  * @version 1.0
22  */

23 public interface ClassIntrospector {
24
25      /**
26       * Parses the IndexConfig ovject to retrieve the class mappings to be used in the introspector.
27      * @param config
28      * @throws JoftiException
29      */

30     public void parseConfig(IndexConfig config) throws JoftiException;
31      
32      /**
33       * Returns the dimension in the introspector for the class and property name.<p>
34       * Key dimensions are negative and property dimenions are positive.
35      * @param className
36      * @param propertyName
37      * @return an int value representing dimensions.
38      * @throws JoftiException
39      */

40     public int getDimension(String JavaDoc className, String JavaDoc propertyName) throws JoftiException;
41      
42     
43     public int getDimension(Class JavaDoc clazz, String JavaDoc propertyName) throws JoftiException;
44     
45      /**
46       Returns the dimension in the introspector for the class.<p>
47       * Key dimensions are negative.
48      * @param className
49      * @return an int representing the dimension
50      */

51     public int getKeyDimension(Class JavaDoc className);
52      
53      /**
54       * A map containing all the key dimensions and classes.
55      * @return a Map
56      */

57     public Map JavaDoc getKeyDimensions();
58     
59     /**
60       * A map containing all the non-key dimensions and classes.
61      * @return a Map
62      */

63     public Map JavaDoc getDimensions();
64      
65      /**
66       * Takes an object and returns a Map containing the values of the to be indexed properties in that class. The values are
67       * obtained by introspection from the class. The keys are dimesnions and the value is the actual value in the object for that dimension.<p>
68      * @param obj - the object to be introspected.
69      * @return A map of dimension to value mappings
70      * @throws JoftiException
71      */

72     public Map JavaDoc getAttributeValues(Object JavaDoc obj)throws JoftiException;
73      
74      /**
75       * Returns all the primitive classes the introspector has registered.
76      * @return a set of class names.
77      */

78     public Set JavaDoc getPrimitiveClasses();
79      
80     /**
81      *
82      * Gets the actual class that the className will return for the attribute name.
83      * @param className
84      * @param attribute
85      * @return the class of the return parameter.
86      * @throws JoftiException
87      */

88     public Class JavaDoc getClassForAttribute(Class JavaDoc className, String JavaDoc attribute) throws JoftiException;
89     
90     
91     public List JavaDoc getParsedObjectsForClass(Class JavaDoc clazz);
92     
93      public Object JavaDoc[] getMethodsForAttribute(Class JavaDoc clazz,String JavaDoc attribute) throws JoftiException;
94          
95      public Object JavaDoc getResultFromMethods(Object JavaDoc obj, Object JavaDoc[] methods) throws JoftiException;
96      
97       public Map JavaDoc getResultValuesFromObject(Map JavaDoc temp, Object JavaDoc obj,Map JavaDoc methodMap);
98       
99       public Class JavaDoc boxPrimitive(Class JavaDoc clazz);
100
101 }
102
Popular Tags