Java EE 5 SDK

com.sun.appserv.management.util.stringifier
Class StringifierRegistryImpl

java.lang.Object
  extended by com.sun.appserv.management.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
static StringifierRegistry DEFAULT
           
 
Constructor Summary
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
 void add(Class theClass, Stringifier stringifier)
          Add a mapping from a Class to a Stringifier
 Stringifier lookup(Class theClass)
          Lookup a Stringifier from a Class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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: StringifierRegistry
Add a mapping from a Class to a Stringifier

Specified by:
add in interface StringifierRegistry
Parameters:
theClass - the Class to which the Stringifier should be associated
stringifier - the Stringifier for the class

lookup

public Stringifier lookup(Class theClass)
Description copied from interface: StringifierRegistry
Lookup a Stringifier from a Class.

Specified by:
lookup in interface StringifierRegistry
Parameters:
theClass - the Class
Returns:
the Stringifier, or null if not found

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.