Class StringifierRegistryImpl
- java.lang.Object
-
- org.glassfish.admin.amx.util.stringifier.StringifierRegistryImpl
-
- All Implemented Interfaces:
StringifierRegistry
public class StringifierRegistryImpl extends Object implements StringifierRegistry
Holds a lookup table for Stringifiers. Certain Stringifier classes may use this registry to aid them in producing suitable output.
-
-
Field Summary
Fields Modifier and Type Field Description static StringifierRegistryDEFAULT
-
Constructor Summary
Constructors Constructor Description StringifierRegistryImpl()Create a new registry with no next registry.StringifierRegistryImpl(StringifierRegistry registry)Create a new registry which is chained to an existing registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Class<?> theClass, Stringifier stringifier)Add a mapping from a Class to a StringifierStringifierlookup(Class<?> theClass)Lookup a Stringifier from a Class.
-
-
-
Field Detail
-
DEFAULT
public static final StringifierRegistry DEFAULT
-
-
Constructor Detail
-
StringifierRegistryImpl
public StringifierRegistryImpl()
Create a new registry with no next registry.
-
StringifierRegistryImpl
public StringifierRegistryImpl(StringifierRegistry registry)
Create a new registry which is chained to an existing registry. When lookup() is called, if it cannot be found in this registry, then the chainee is used.- Parameters:
registry- the registry to use if this registry fails to find a Stringifier
-
-
Method Detail
-
add
public void add(Class<?> theClass, Stringifier stringifier)
Description copied from interface:StringifierRegistryAdd a mapping from a Class to a Stringifier- Specified by:
addin interfaceStringifierRegistry- Parameters:
theClass- the Class to which the Stringifier should be associatedstringifier- the Stringifier for the class
-
lookup
public Stringifier lookup(Class<?> theClass)
Description copied from interface:StringifierRegistryLookup a Stringifier from a Class.- Specified by:
lookupin interfaceStringifierRegistry- Parameters:
theClass- the Class- Returns:
- the Stringifier, or null if not found
-
-