el-spec
  1. el-spec
  2. EL_SPEC-10

API doc errors for javax.el.TypeConverter

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Labels:
      None
    • Environment:

      N/A

      Description

      Here is the Example that we have provided in the API docs.

      ELProcessor elp = new ELProcessor();
      elp.getELManager().addELResolver(new TypeConverter() {
      Object convertToType(ELContext context, Object obj, Class type) {
      if (obj instanceof String) && type == MyDate.class)

      { context.setPropertyResoved(obj, type); return (obj == null)? null: new MyDate(obj.toString()); }

      return null;
      }
      };

      Below I have put the various fixes in spelling and syntax.

      ELProcessor elp = new ELProcessor();
      elp.getELManager().addELResolver(new TypeConverter() {
      Object convertToType(ELContext context, Object obj, Class type) {
      if ((obj instanceof String) && type == MyDate.class)

      { <------ Added missing "(" context.setPropertyResolved(obj, type); <------ Fixed Spelling on Method call. return (obj == null)? null: new MyDate(obj.toString()); }

      return null;
      }
      };

        Activity

        Hide
        kchung added a comment -

        Fixed.

        Show
        kchung added a comment - Fixed.

          People

          • Assignee:
            kchung
            Reporter:
            dougd
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: