EchoPoint
1.0

echopoint.stylesheet
Class StyleSheetIntrospector

java.lang.Object
  extended byechopoint.stylesheet.StyleSheetIntrospector

public class StyleSheetIntrospector
extends java.lang.Object

The StyleSheetIntrospector is used to introspect on a given Component class and find out style attribute information on that class.

The StyleSheetIntrospector looks for a Components's "style info" support class that implements StyleInfo

In much the same way as the java.beans.Introspector looks for BeanInfo classes the StyleSheetIntrospector will first look for a class named componentClassStyleInfo in the same package as component which implements the echopoint.stylesheet.StyleInfo interface.

If it cant find that class, it will look for the first public static nested class inside the Component class that implements the echopoint.stylesheet.StyleInfo interface.

So for example if you component class is call "x.y.z.BlueBell" then the StyleSheetIntrospector will look for a class called "x.y.z.BlueBellStyleInfo".

As in: public class BlueBellStyleInfo implements echopoint.stylesheet.StyleInfo {
...
}
If it cannot that, it will look for a nested class within "x.y.z.BlueBell" that is public, static and that implements echopoint.stylesheet.StyleInfo.

As in: public class BlueBell extends nextapp.echo.Component {
public static NestedStyleInfo implements echopoint.stylesheet.StyleInfo {
...
}

...
}

After the above processing is complete, the introspector will examine the interfaces that the class implements. It will introspect inside all of its interfaces for public nested static class that implements echopoint.stylesheet.StyleInfo. The union of these StyleInfo implementing classes will then be returned for that component class.

For example given :
public class MyComponent extends Component implements Slip, Slop, Slap {
...
The introspector will examine the Slip, Slop Slap interfaces to see if they have nested public static StyleInfo classes. Any sub-interfaces that these interfaces may themselves extended will also be searched. The union of these StyleInfo objects will be returned as the StyleInfo for the original component


Constructor Summary
StyleSheetIntrospector()
           
 
Method Summary
static void addCachedStyleInfo(java.lang.Class clazz, StyleInfo styleInfo)
          Adds a StyleInfo object for the specified clazz into the global cache.
static void flushCachedStyleInfo()
          Flushes the global cache of StyleInfo information.
static StyleInfo getStyleInfo(java.lang.Class searchClass)
          Introspects a class and learns about the style attributes it supports.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleSheetIntrospector

public StyleSheetIntrospector()
Method Detail

addCachedStyleInfo

public static void addCachedStyleInfo(java.lang.Class clazz,
                                      StyleInfo styleInfo)
Adds a StyleInfo object for the specified clazz into the global cache. Once added it can be quickly gathered again. In general you will not need to call this function because it all results of the getStyleInfo() method are always globally cached.

Parameters:
clazz - - the class that the StyleInfo applies
styleInfo - - the styleInfo in question

flushCachedStyleInfo

public static void flushCachedStyleInfo()
Flushes the global cache of StyleInfo information.


getStyleInfo

public static StyleInfo getStyleInfo(java.lang.Class searchClass)
                              throws java.beans.IntrospectionException
Introspects a class and learns about the style attributes it supports.

Parameters:
searchClass - - the component class that is to be introspected
Returns:
StyleInfo - a StyleInfo object or null if no info can be found
Throws:
java.beans.IntrospectionException - - if an exception occurs during introspection.

EchoPoint
1.0