Class StringLookupAdapter

  • All Implemented Interfaces:
    Lookup

    final class StringLookupAdapter
    extends java.lang.Object
    implements Lookup
    Wraps an Apache Commons Text StringLookup as an Apache Commons Configuration Lookup.
    Since:
    2.4
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.commons.text.lookup.StringLookup stringLookup
      The StringLookup delegate.
    • Constructor Summary

      Constructors 
      Constructor Description
      StringLookupAdapter​(org.apache.commons.text.lookup.StringLookup stringLookup)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object lookup​(java.lang.String key)
      Looks up the value of the specified variable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • stringLookup

        private final org.apache.commons.text.lookup.StringLookup stringLookup
        The StringLookup delegate.
    • Constructor Detail

      • StringLookupAdapter

        StringLookupAdapter​(org.apache.commons.text.lookup.StringLookup stringLookup)
    • Method Detail

      • lookup

        public java.lang.Object lookup​(java.lang.String key)
        Description copied from interface: Lookup
        Looks up the value of the specified variable. This method is called by ConfigurationInterpolator with the variable name extracted from the expression to interpolate (i.e. the prefix name has already been removed). A concrete implementation has to return the value of this variable or null if the variable name is unknown.
        Specified by:
        lookup in interface Lookup
        Parameters:
        key - the name of the variable to be resolved
        Returns:
        the value of this variable or null