Class 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.
    • 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