code: public static Object getValueFromBeanInfoPropertyEditor(
          Class attrClass,
          String attrName,
          String attrValue,
          Class propertyEditorClass)
          throws JspCoreException {
          try {
              PropertyEditor pe = (PropertyEditor) propertyEditorClass.newInstance();
              pe.setAsText(attrValue);
              return pe.getValue();
          }
          catch (Exception ex) {
              throw new JspCoreException(
                  "Unable to convert string '"
                      + attrValue
                      + "' to class "
                      + attrClass.getName()
                      + " for attribute "
                      + attrName
                      + ": "
                      + ex);
          }
      }
docs: PropertyEditor Support