Package java.text

Examples of java.text.Format.parseObject()


    }

    Format formatter = columnFormatter();
    if (formatter != null && value instanceof String) {
      try {
        value = formatter.parseObject((String) value);
      }
      catch (ParseException e) {
        throw new NSForwardException(e);
      }
    }
View Full Code Here


          }
        } else {
          Format formatter = null;
          try {
            formatter = ERXRestUtils.timestampFormat(spaces, context);
            parsedValue = formatter.parseObject(strValue);   
          }
          catch (Throwable t) {
            String msg = "Failed to parse '" + strValue + "' as a timestamp";
            if (formatter != null) {
              msg += " (example: " + formatter.format(new NSTimestamp()) + ")";
View Full Code Here

        String strValue = (String) value;
        Format formatter = null;
        try {
          boolean spaces = strValue.indexOf(' ') != -1;
          formatter = ERXRestUtils.dateFormat(spaces, context);
          parsedValue = formatter.parseObject(strValue);
        }
        catch (Throwable t) {
          String msg = "Failed to parse '" + strValue + "' as a timestamp";
          if (formatter != null) {
            msg += " (example: " + formatter.format(new Date()) + ")";
View Full Code Here

        QueryPlan plan = pstmt.optimizeQuery();
        Scan scan = plan.getContext().getScan();
        Filter filter = scan.getFilter();

        Format format = DateUtil.getDateParser(DateUtil.DEFAULT_DATE_FORMAT);
        Object date = format.parseObject(dateStr);

        assertEquals(
            singleKVFilter(constantComparison(
                CompareOp.GREATER_OR_EQUAL,
                BaseConnectionlessQueryTest.A_DATE,
View Full Code Here

                NSTimeZone parseZone = tsFormat.defaultParseTimeZone();
                NSTimeZone formatZone = tsFormat.defaultFormatTimeZone();
                tsFormat.setDefaultFormatTimeZone(zone);
                tsFormat.setDefaultParseTimeZone(zone);
                try {
                  Object parsedObject = format.parseObject(stringValue);
                  String reformatedObject = format.format(parsedObject);
                  result = format.parseObject(reformatedObject);
                } catch(ParseException parseexception) {
                  String keyPath = _value.keyPath();
                  ERXValidationException validationexception = new ERXValidationException(ERXValidationException.InvalidValueException, parseexception, keyPath, stringValue);
View Full Code Here

                tsFormat.setDefaultFormatTimeZone(zone);
                tsFormat.setDefaultParseTimeZone(zone);
                try {
                  Object parsedObject = format.parseObject(stringValue);
                  String reformatedObject = format.format(parsedObject);
                  result = format.parseObject(reformatedObject);
                } catch(ParseException parseexception) {
                  String keyPath = _value.keyPath();
                  ERXValidationException validationexception = new ERXValidationException(ERXValidationException.InvalidValueException, parseexception, keyPath, stringValue);
                  component.validationFailedWithException(validationexception, stringValue, keyPath);
                  return;
View Full Code Here

                  tsFormat.setDefaultParseTimeZone(parseZone);
                }
              }
            } else {
              try {
                Object parsedObject = format.parseObject(stringValue);
                String reformatedObject = format.format(parsedObject);
                result = format.parseObject(reformatedObject);
              } catch(ParseException parseexception) {
                String keyPath = _value.keyPath();
                ERXValidationException validationexception = new ERXValidationException(ERXValidationException.InvalidValueException, parseexception, keyPath, stringValue);
View Full Code Here

              }
            } else {
              try {
                Object parsedObject = format.parseObject(stringValue);
                String reformatedObject = format.format(parsedObject);
                result = format.parseObject(reformatedObject);
              } catch(ParseException parseexception) {
                String keyPath = _value.keyPath();
                ERXValidationException validationexception = new ERXValidationException(ERXValidationException.InvalidValueException, parseexception, keyPath, stringValue);
                component.validationFailedWithException(validationexception, stringValue, keyPath);
                return;
View Full Code Here

            NSTimeZone formatZone = tsFormat.defaultFormatTimeZone();
            tsFormat.setDefaultFormatTimeZone(zone);
            tsFormat.setDefaultParseTimeZone(zone);
            try {
              String formatedValue = format.format(valueInComponent);
              Object reparsedObject = format.parseObject(formatedValue);
              stringValue = format.format(reparsedObject);
            } catch(IllegalArgumentException illegalargumentexception) {
              NSLog._conditionallyLogPrivateException(illegalargumentexception);
              stringValue = null;
            } catch(ParseException parseexception) {
View Full Code Here

            }
          }
        } else {
          try {
            String formatedValue = format.format(valueInComponent);
            Object reparsedObject = format.parseObject(formatedValue);
            stringValue = format.format(reparsedObject);
          } catch(IllegalArgumentException illegalargumentexception) {
            NSLog._conditionallyLogPrivateException(illegalargumentexception);
            stringValue = null;
          } catch(ParseException parseexception) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.