StringInterpreter (Apache Tomcat 8.5.94 API Documentation)

Package org.apache.jasper.compiler

## Interface StringInterpreter

- All Known Implementing Classes:
    `StringInterpreterEnum`, `StringInterpreterFactory.DefaultStringInterpreter`

      public interface StringInterpreter

  Defines the interface for the String interpreter. This allows users to provide custom String interpreter implementations that can optimise String processing for an application by performing code generation for a sub-set of Strings.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `convertString​(java.lang.Class<?> c, java.lang.String s, java.lang.String attrName, java.lang.Class<?> propEditorClass, boolean isNamedAttribute)` | Generates the source code that represents the conversion of the string value to the appropriate type.

- - ### Method Detail

    - #### convertString

          java.lang.String convertString​(java.lang.Class<?> c,
                                         java.lang.String s,
                                         java.lang.String attrName,
                                         java.lang.Class<?> propEditorClass,
                                         boolean isNamedAttribute)

      Generates the source code that represents the conversion of the string value to the appropriate type.
      Parameters:
        `c` - The target class to which to coerce the given string
        `s` - The string value
        `attrName` - The name of the attribute whose value is being supplied
        `propEditorClass` - The property editor for the given attribute
        `isNamedAttribute` - true if the given attribute is a named attribute (that is, specified using the jsp:attribute standard action), and false otherwise
      Returns:
        the string representing the code that will be inserted into the source code for the Servlet generated for the JSP.