|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.meta.TypeRegistry
org.progeeks.meta.format.FormatRegistry
public class FormatRegistry
Matches types for PropertyFormats. This is essentially a thin wrapper around a TypeRegistry containing property format objects. This class can provide advanced behavior in some cases by automatically resolving formatters for multi-value types and such.
Constructor Summary | |
---|---|
FormatRegistry()
|
Method Summary | |
---|---|
java.lang.String |
format(MetaObject value)
Convenience method for formatting a MetaObject value. |
java.lang.String |
format(java.lang.Object value,
PropertyType type)
Convenience method for formatting a value. |
PropertyFormat |
getFormat(PropertyType type)
Returns a PropertyFormat object for the specified PropertyType. |
protected PropertyFormat |
getListFormat(ListPropertyType type)
Searches for an appropriate formatter for the list type, but will create a default list format if one is not found. |
boolean |
hasFormat(PropertyType type)
Returns true if the specified type has a registered format or registered default format. |
boolean |
hasSpecificFormat(PropertyType type)
Returns true if the specified type has a specifically registered format. |
void |
registerDefaultFormat(java.lang.Class type,
PropertyFormat format)
Registers a PropertyFormat object that will handle all PropertyTypes of the specified base class when no more specific PropertyFormat object is found. |
void |
registerFormat(PropertyType type,
PropertyFormat format)
Registers a specific PropertyFormat object for the specified type. |
Methods inherited from class org.progeeks.meta.TypeRegistry |
---|
get, get, get, get, getDefault, getDirectMatch, getValueForObject, put, putDefault |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FormatRegistry()
Method Detail |
---|
public void registerFormat(PropertyType type, PropertyFormat format)
public void registerDefaultFormat(java.lang.Class type, PropertyFormat format)
public boolean hasFormat(PropertyType type)
public boolean hasSpecificFormat(PropertyType type)
public PropertyFormat getFormat(PropertyType type)
protected PropertyFormat getListFormat(ListPropertyType type)
public java.lang.String format(java.lang.Object value, PropertyType type)
public java.lang.String format(MetaObject value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |