code: @Override
     public String getMessage()
     {
        String nl = System.getProperty("line.separator");
        StringBuffer sb = new StringBuffer();
        sb.append(message);
        if (index >= 0) {
           sb.append(" near index ");
           sb.append(index);
        }
        sb.append(nl);
        sb.append(pattern);
        if (index >= 0) {
           sb.append(nl);
           for (int i = 0; i < index; i++)
              sb.append(' ');
           sb.append('^');
        }
        return sb.toString();
     }
docs: Returns a string containing the description of the syntax error and its location, the erroneous parameterized
  pattern string, and a visual location of the error index within the pattern (if possible.)