Tabnine Logo
StrLookup.lookup
Code IndexAdd Tabnine to your IDE (free)

How to use
lookup
method
in
org.apache.commons.lang.text.StrLookup

Best Java code snippets using org.apache.commons.lang.text.StrLookup.lookup (Showing top 13 results out of 315)

origin: commons-lang/commons-lang

/**
 * Internal method that resolves the value of a variable.
 * <p>
 * Most users of this class do not need to call this method. This method is
 * called automatically by the substitution process.
 * <p>
 * Writers of subclasses can override this method if they need to alter
 * how each substitution occurs. The method is passed the variable's name
 * and must return the corresponding value. This implementation uses the
 * {@link #getVariableResolver()} with the variable's name as the key.
 *
 * @param variableName  the name of the variable, not null
 * @param buf  the buffer where the substitution is occurring, not null
 * @param startPos  the start position of the variable including the prefix, valid
 * @param endPos  the end position of the variable including the suffix, valid
 * @return the variable's value or <b>null</b> if the variable is unknown
 */
protected String resolveVariable(String variableName, StrBuilder buf, int startPos, int endPos) {
  StrLookup resolver = getVariableResolver();
  if (resolver == null) {
    return null;
  }
  return resolver.lookup(variableName);
}
origin: org.apache.marmotta/marmotta-core

  @Override
  public String lookup(String key) {
    try {
      return URLEncoder.encode(_int.getDefaultLookup().lookup(key), "utf8");
    } catch (UnsupportedEncodingException e) {
      return _int.getDefaultLookup().lookup(key);
    }
  }
});
origin: org.apache.marmotta/marmotta-core

  @Override
  public String lookup(String key) {
    return Pattern.quote(_int.getDefaultLookup().lookup(key));
  }
});
origin: apache/marmotta

  @Override
  public String lookup(String key) {
    return Pattern.quote(_int.getDefaultLookup().lookup(key));
  }
});
origin: apache/marmotta

  @Override
  public String lookup(String key) {
    try {
      return URLEncoder.encode(_int.getDefaultLookup().lookup(key), "utf8");
    } catch (UnsupportedEncodingException e) {
      return _int.getDefaultLookup().lookup(key);
    }
  }
});
origin: org.apache.directory.api/api-ldap-client-all

/**
 * Internal method that resolves the value of a variable.
 * <p>
 * Most users of this class do not need to call this method. This method is
 * called automatically by the substitution process.
 * <p>
 * Writers of subclasses can override this method if they need to alter
 * how each substitution occurs. The method is passed the variable's name
 * and must return the corresponding value. This implementation uses the
 * {@link #getVariableResolver()} with the variable's name as the key.
 *
 * @param variableName  the name of the variable, not null
 * @param buf  the buffer where the substitution is occurring, not null
 * @param startPos  the start position of the variable including the prefix, valid
 * @param endPos  the end position of the variable including the suffix, valid
 * @return the variable's value or <b>null</b> if the variable is unknown
 */
protected String resolveVariable(String variableName, StrBuilder buf, int startPos, int endPos) {
  StrLookup resolver = getVariableResolver();
  if (resolver == null) {
    return null;
  }
  return resolver.lookup(variableName);
}
origin: org.apache.commons/com.springsource.org.apache.commons.lang

/**
 * Internal method that resolves the value of a variable.
 * <p>
 * Most users of this class do not need to call this method. This method is
 * called automatically by the substitution process.
 * <p>
 * Writers of subclasses can override this method if they need to alter
 * how each substitution occurs. The method is passed the variable's name
 * and must return the corresponding value. This implementation uses the
 * {@link #getVariableResolver()} with the variable's name as the key.
 *
 * @param variableName  the name of the variable, not null
 * @param buf  the buffer where the substitution is occurring, not null
 * @param startPos  the start position of the variable including the prefix, valid
 * @param endPos  the end position of the variable including the suffix, valid
 * @return the variable's value or <b>null</b> if the variable is unknown
 */
protected String resolveVariable(String variableName, StrBuilder buf, int startPos, int endPos) {
  StrLookup resolver = getVariableResolver();
  if (resolver == null) {
    return null;
  }
  return resolver.lookup(variableName);
}
origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Internal method that resolves the value of a variable.
 * <p>
 * Most users of this class do not need to call this method. This method is
 * called automatically by the substitution process.
 * <p>
 * Writers of subclasses can override this method if they need to alter
 * how each substitution occurs. The method is passed the variable's name
 * and must return the corresponding value. This implementation uses the
 * {@link #getVariableResolver()} with the variable's name as the key.
 *
 * @param variableName  the name of the variable, not null
 * @param buf  the buffer where the substitution is occurring, not null
 * @param startPos  the start position of the variable including the prefix, valid
 * @param endPos  the end position of the variable including the suffix, valid
 * @return the variable's value or <b>null</b> if the variable is unknown
 */
protected String resolveVariable(String variableName, StrBuilder buf, int startPos, int endPos) {
  StrLookup resolver = getVariableResolver();
  if (resolver == null) {
    return null;
  }
  return resolver.lookup(variableName);
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Internal method that resolves the value of a variable.
 * <p>
 * Most users of this class do not need to call this method. This method is
 * called automatically by the substitution process.
 * <p>
 * Writers of subclasses can override this method if they need to alter
 * how each substitution occurs. The method is passed the variable's name
 * and must return the corresponding value. This implementation uses the
 * {@link #getVariableResolver()} with the variable's name as the key.
 *
 * @param variableName  the name of the variable, not null
 * @param buf  the buffer where the substitution is occurring, not null
 * @param startPos  the start position of the variable including the prefix, valid
 * @param endPos  the end position of the variable including the suffix, valid
 * @return the variable's value or <b>null</b> if the variable is unknown
 */
protected String resolveVariable(String variableName, StrBuilder buf, int startPos, int endPos) {
  StrLookup resolver = getVariableResolver();
  if (resolver == null) {
    return null;
  }
  return resolver.lookup(variableName);
}
origin: at.bestsolution.efxclipse.eclipse/org.apache.commons.lang

/**
 * Internal method that resolves the value of a variable.
 * <p>
 * Most users of this class do not need to call this method. This method is
 * called automatically by the substitution process.
 * <p>
 * Writers of subclasses can override this method if they need to alter
 * how each substitution occurs. The method is passed the variable's name
 * and must return the corresponding value. This implementation uses the
 * {@link #getVariableResolver()} with the variable's name as the key.
 *
 * @param variableName  the name of the variable, not null
 * @param buf  the buffer where the substitution is occurring, not null
 * @param startPos  the start position of the variable including the prefix, valid
 * @param endPos  the end position of the variable including the suffix, valid
 * @return the variable's value or <b>null</b> if the variable is unknown
 */
protected String resolveVariable(String variableName, StrBuilder buf, int startPos, int endPos) {
  StrLookup resolver = getVariableResolver();
  if (resolver == null) {
    return null;
  }
  return resolver.lookup(variableName);
}
origin: stackoverflow.com

 final LoggerContext loggerContext = (LoggerContext) LogManager.getContext(true);
final Configuration config = loggerContext.getConfiguration();
final StrSubstitutor strSubstitutor = config.getStrSubstitutor();
final StrLookup variableResolver = strSubstitutor.getVariableResolver();
final String propertyValue = variableResolver.lookup("propertyName");
origin: org.apache.commons/org.motechproject.org.apache.commons.configuration

  String value = fetchLookupForPrefix(prefix).lookup(name);
  if (value == null && getParentInterpolator() != null)
    value = getParentInterpolator().fetchLookupForPrefix(prefix).lookup(name);
String value = fetchNoPrefixLookup().lookup(var);
if (value == null && getParentInterpolator() != null)
  value = getParentInterpolator().fetchNoPrefixLookup().lookup(var);
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-configuration

  String value = fetchLookupForPrefix(prefix).lookup(name);
  if (value == null && getParentInterpolator() != null)
String value = fetchNoPrefixLookup().lookup(var);
if (value == null && getParentInterpolator() != null)
org.apache.commons.lang.textStrLookuplookup

Javadoc

Looks up a String key to a String value.

The internal implementation may use any mechanism to return the value. The simplest implementation is to use a Map. However, virtually any implementation is possible.

For example, it would be possible to implement a lookup that used the key as a primary key, and looked up the value on demand from the database Or, a numeric based implementation could be created that treats the key as an integer, increments the value and return the result as a string - converting 1 to 2, 15 to 16 etc.

The #lookup(String) method always returns a String, regardless of the underlying data, by converting it as necessary. For example:

 
Map map = new HashMap(); 
map.put("number", new Integer(2)); 
assertEquals("2", StrLookup.mapLookup(map).lookup("number")); 

Popular methods of StrLookup

  • mapLookup
    Returns a lookup which looks up values using a map. If the map is null, then null will be returned f
  • systemPropertiesLookup
    Returns a lookup which uses System#getProperties()to lookup the key to value. If a security manager
  • noneLookup
    Returns a lookup which always returns null.

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onRequestPermissionsResult (Fragment)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JLabel (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now