com.threerings.editor
Class Introspector

java.lang.Object
  extended by com.threerings.editor.Introspector

public class Introspector
extends Object

Provides access to the editable properties of objects.


Field Summary
protected static HashMap<Class<?>,String> _bundles
          Cached editor bundle mappings.
protected static HashMap<Class<?>,String[]> _categories
          Cached category lists.
protected static HashMap<Class<?>,Property[]> _properties
          Cached property lists.
protected static Comparator<Property> WEIGHT_COMP
          Sorts properties by increasing weight.
 
Constructor Summary
Introspector()
           
 
Method Summary
protected static Property[] createProperties(Class<?> clazz)
          Creates and returns the list of properties for the supplied class.
protected static void createProperties(Class<?> clazz, ArrayList<Property> properties)
          Retrieves all Editable properties of the specified class.
protected static String findMessageBundle(Class<?> clazz)
          Finds the editor message bundle for the supplied class.
static String[] getCategories(Class<?> clazz)
          Returns an array containing the categories to which the supplied class's properties are assigned.
static String getMessageBundle(Class<?> clazz)
          Returns the message bundle to use when translating the supplied class's properties.
static Property[] getProperties(Class<?> clazz)
          Returns an array containing the editable properties of the supplied class.
static Property[] getProperties(Object object)
          Returns an array containing both the static and the dynamic properties of the specified object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_categories

protected static HashMap<Class<?>,String[]> _categories
Cached category lists.


_properties

protected static HashMap<Class<?>,Property[]> _properties
Cached property lists.


_bundles

protected static HashMap<Class<?>,String> _bundles
Cached editor bundle mappings.


WEIGHT_COMP

protected static final Comparator<Property> WEIGHT_COMP
Sorts properties by increasing weight.

Constructor Detail

Introspector

public Introspector()
Method Detail

getCategories

public static String[] getCategories(Class<?> clazz)
Returns an array containing the categories to which the supplied class's properties are assigned.


getProperties

public static Property[] getProperties(Object object)
Returns an array containing both the static and the dynamic properties of the specified object.


getProperties

public static Property[] getProperties(Class<?> clazz)
Returns an array containing the editable properties of the supplied class.


getMessageBundle

public static String getMessageBundle(Class<?> clazz)
Returns the message bundle to use when translating the supplied class's properties.


findMessageBundle

protected static String findMessageBundle(Class<?> clazz)
Finds the editor message bundle for the supplied class.


createProperties

protected static Property[] createProperties(Class<?> clazz)
Creates and returns the list of properties for the supplied class.


createProperties

protected static void createProperties(Class<?> clazz,
                                       ArrayList<Property> properties)
Retrieves all Editable properties of the specified class.