TemplateString (Solr 3.6.2 API)
Keywords: org.apache.solr.handler.dataimport.TemplateString class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr.handler.dataimport
Class TemplateString

    java.lang.Object
      org.apache.solr.handler.dataimport.TemplateString

    public class TemplateString

extends Object

Provides functionality for replacing variables in a templatized string. It can also be used to get the place-holders (variables) in a templatized string.

This API is experimental and may change in the future.

Since:
  solr 1.3
Version:
  $Id: TemplateString.java 826732 2009-10-19 17:47:38Z shalin $

Constructor Summary
`TemplateString()`

Method Summary
`static List<String>` | `getVariables(String s)` Returns the variables in the given string.
`String` | `replaceTokens(String string, VariableResolver resolver)` Returns a string with all variables replaced by the known values.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TemplateString

    public TemplateString()

Method Detail

### replaceTokens

    public String replaceTokens(String string,
                                VariableResolver resolver)

  Returns a string with all variables replaced by the known values. An unknown variable is replaced by an empty string.

  Parameters:
    `string` - the String to be resolved
    `resolver` - the VariableResolver instance to be used for evaluation
  Returns:
    the string with all variables replaced

### getVariables

    public static List<String> getVariables(String s)

  Returns the variables in the given string.

  Parameters:
    `s` - the templatized string
  Returns:
    the list of variables (strings) in the given templatized string.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD