* Use the introspection cache
*/
int type = UNKNOWN;
IntrospectionCacheData icd = context.icacheGet( this );
Class c = listObject.getClass();
/*
* if we have an entry in the cache, and the Class we have
* cached is the same as the Class of the data object
* then we are ok
*/
if ( icd != null && icd.contextData == c )
{
/* dig the type out of the cata object */
type = ((Integer) icd.thingy ).intValue();
}
/*
* If we still don't know what this is,
* figure out what type of object the list
* element is, and get the iterator for it
*/
if ( type == UNKNOWN )
{
if ( listObject.getClass().isArray() )
type = INFO_ARRAY;
else if ( listObject instanceof Collection)
type = INFO_COLLECTION;
else if ( listObject instanceof Map )
type = INFO_MAP;
else if ( listObject instanceof Iterator )
type = INFO_ITERATOR;
else if ( listObject instanceof Enumeration )
type = INFO_ENUMERATION;
/*
* if we did figure it out, cache it
*/
if ( type != UNKNOWN )
{
icd = new IntrospectionCacheData();
icd.thingy = new Integer( type );
icd.contextData = c;
context.icachePut( this, icd );
}
}