| java.lang.Object com.jidesoft.grouper.ObjectGrouperManager
ObjectGrouperManager | public class ObjectGrouperManager (Code) | | A global object that can register Object Grouper with a type and a GrouperContext.
|
addRegistrationListener | public static void addRegistrationListener(RegistrationListener l)(Code) | | Adds a listener to the list that's notified each time a change
to the manager occurs.
Parameters: l - the RegistrationListener |
getGroupValue | public static Object getGroupValue(Object object)(Code) | | Converts an object to string using default grouper context.
Parameters: object - object to be converted. the string |
getGroupValue | public static Object getGroupValue(Object object, Class> clazz)(Code) | | Converts an object to string using default grouper context.
Parameters: object - object to be converted. Parameters: clazz - type of the object the string |
getGrouper | public static ObjectGrouper getGrouper(Class> clazz, GrouperContext context)(Code) | | Gets the registered grouper associated with class and context.
Parameters: clazz - the data type. Parameters: context - the grouper context. the registered grouper. It could return null if there is no grouper for the type and the context. |
getGrouper | public static ObjectGrouper getGrouper(Class> clazz)(Code) | | Gets the grouper associated with the type.
Parameters: clazz - the data type. the grouper. It could return null if there is no grouper for the type. |
getGrouperContexts | public static GrouperContext[] getGrouperContexts(Class> clazz)(Code) | | Gets the available GrouperContexts registered with the class.
Parameters: clazz - the class. the available GrouperContexts. |
getValue | public static Object getValue(Object object, Class> clazz, GrouperContext context)(Code) | | Converts an object to string using grouper context sepcified.
Parameters: object - object to be converted. Parameters: clazz - type of the object Parameters: context - group context the string converted from object |
initDefaultGrouper | public static void initDefaultGrouper()(Code) | | Initialize default groupers. Please make sure you call this method before you use any
group related classes. By default we register following groupers.
DateYearGrouper dateYearGrouper = new DateYearGrouper();
registerGrouper(Date.class, dateYearGrouper, DateYearGrouper.CONTEXT);
registerGrouper(Calendar.class, dateYearGrouper, DateYearGrouper.CONTEXT);
registerGrouper(Long.class, dateYearGrouper, DateYearGrouper.CONTEXT);
DateMonthGrouper dateMonthGrouper = new DateMonthGrouper();
registerGrouper(Date.class, dateMonthGrouper, DateMonthGrouper.CONTEXT);
registerGrouper(Calendar.class, dateMonthGrouper, DateMonthGrouper.CONTEXT);
registerGrouper(Long.class, dateMonthGrouper, DateMonthGrouper.CONTEXT);
|
registerGrouper | public static void registerGrouper(Class> clazz, ObjectGrouper grouper, GrouperContext context)(Code) | | Registers a grouper with the type specified as class and a grouper context specified as context.
Parameters: clazz - type Parameters: grouper - group to be registered Parameters: context - the grouper context. |
registerGrouper | public static void registerGrouper(Class> clazz, ObjectGrouper grouper)(Code) | | Registers a grouper with type specified as clazz.
Parameters: clazz - the data type. Parameters: grouper - the grouper to be registered |
removeRegistrationListener | public static void removeRegistrationListener(RegistrationListener l)(Code) | | Removes a listener from the list that's notified each time a
change to the manager occurs.
Parameters: l - the RegistrationListener |
setAutoInit | public static void setAutoInit(boolean autoInit)(Code) | | Sets autoInit to true or false. If autoInit is true, whenever someone tries to call methods getValue,
ObjectGrouperManager.initDefaultGrouper() will be called if it has never be called. By default, autoInit is true.
This might affect the behavior if users provide their own groupers and want to overwrite
default groupers. In this case, instead of depending on autoInit to initialize default groupers,
you should call
ObjectGrouperManager.initDefaultGrouper() first, then call registerGrouper to add your own groupers.
Parameters: autoInit - false if you want to disable autoInit which means you either don'twant those default comparators registered or you will call ObjectGrouperManager.initDefaultGrouper() yourself. |
unregisterAllGroupers | public static void unregisterAllGroupers()(Code) | | Unregisters all the groupers which registered before.
|
unregisterGrouper | public static void unregisterGrouper(Class> clazz, GrouperContext context)(Code) | | Unregisters grouper associated with clazz and context.
Parameters: clazz - the data type. Parameters: context - the grouper context. |
unregisterGrouper | public static void unregisterGrouper(Class> clazz)(Code) | | Unregisters grouper associated with clazz.
Parameters: clazz - the data type. |
|
|