Java Method with Generic Return Type

To create a Java method with a generic return type one can write a method like this.

  protected static <T> T evaluateExpression(String tagName,
      String attributeName, String attributeValue,
      Class<T> expectedType, Tag tagRef,
      PageContext pageContext)

You can learn more at this Java Generics FAQ.

Leave a Reply

Your email address will not be published. Required fields are marked *