StringifierRegistryImplpublic class StringifierRegistryImpl extends Object implements StringifierRegistryHolds a lookup table for Stringifiers. Certain Stringifier classes
may use this registry to aid them in producing suitable output. |
Fields Summary |
---|
public static final StringifierRegistry | DEFAULT | private final Map | mLookup | private final StringifierRegistry | mNextRegistry |
Constructors Summary |
---|
public StringifierRegistryImpl()Create a new registry with no next registry.
this( null );
| 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.
mLookup = new HashMap<Class<?>,Stringifier>();
mNextRegistry = registry;
|
Methods Summary |
---|
public void | add(java.lang.Class theClass, Stringifier stringifier)
if ( lookup( theClass ) != null )
{
new Exception().printStackTrace();
}
mLookup.remove( theClass );
mLookup.put( theClass, stringifier );
| public Stringifier | lookup(java.lang.Class theClass)
Stringifier stringifier = (Stringifier)mLookup.get( theClass );
if ( stringifier == null && mNextRegistry != null )
{
stringifier = mNextRegistry.lookup( theClass );
}
return( stringifier );
|
|