Package java.text

Examples of java.text.Format.parseObject()


        } catch (ParseException e) {
          f = getSecondaryFormat(object); // allow money to parse as number too
          boolean secondOK = false;
          if (f != null) {
            try {
              value = f.parseObject(textValue);
              secondOK = true;
            } catch (ParseException e1) {
            }
          }
          if (!secondOK)
View Full Code Here


    Object value = preprocessText(object, textValue, context);
    if (value == textValue) {
      Format f = getFormat(object);
      if (f != null) {
        try {
          value = f.parseObject(textValue);
        } catch (ParseException e) {
          throw new FieldParseException(e);
        }
      } else {
        value = FieldConverter.convert(textValue, hasExternalType() ? externalType : internalType, context); // converts
View Full Code Here

            boolean haveArgResult = false;
            Object argResult = null;
            if(cachedFormatters!=null && (formatter=cachedFormatters.get(i - 2))!=null) {
                // Just parse using the formatter.
                tempStatus.setIndex(sourceOffset);
                argResult = formatter.parseObject(source, tempStatus);
                if (tempStatus.getIndex() == sourceOffset) {
                    pos.setErrorIndex(sourceOffset);
                    return; // leave index as is to signal error
                }
                haveArgResult = true;
View Full Code Here

    /** Tests, whether e zero as suffix matters in milliseconds.
     */
    public void testZeroSuffix() throws Exception {
        Format format = new XsDateTimeFormat();
        Calendar c1 = (Calendar) format.parseObject("2006-05-03T15:29:17.15Z");
        Calendar c2 = (Calendar) format.parseObject("2006-05-03T15:29:17.150Z");
        assertEquals(c1, c2);

        format = new XsTimeFormat();
        c1 = (Calendar) format.parseObject("15:29:17.15Z");
View Full Code Here

    /** Tests, whether e zero as suffix matters in milliseconds.
     */
    public void testZeroSuffix() throws Exception {
        Format format = new XsDateTimeFormat();
        Calendar c1 = (Calendar) format.parseObject("2006-05-03T15:29:17.15Z");
        Calendar c2 = (Calendar) format.parseObject("2006-05-03T15:29:17.150Z");
        assertEquals(c1, c2);

        format = new XsTimeFormat();
        c1 = (Calendar) format.parseObject("15:29:17.15Z");
        c2 = (Calendar) format.parseObject("15:29:17.150Z");
View Full Code Here

        Calendar c1 = (Calendar) format.parseObject("2006-05-03T15:29:17.15Z");
        Calendar c2 = (Calendar) format.parseObject("2006-05-03T15:29:17.150Z");
        assertEquals(c1, c2);

        format = new XsTimeFormat();
        c1 = (Calendar) format.parseObject("15:29:17.15Z");
        c2 = (Calendar) format.parseObject("15:29:17.150Z");
        assertEquals(c1, c2);
    }
}
View Full Code Here

        Calendar c2 = (Calendar) format.parseObject("2006-05-03T15:29:17.150Z");
        assertEquals(c1, c2);

        format = new XsTimeFormat();
        c1 = (Calendar) format.parseObject("15:29:17.15Z");
        c2 = (Calendar) format.parseObject("15:29:17.150Z");
        assertEquals(c1, c2);
    }
}
View Full Code Here

      if (strValue.length() != 0) {
        format = WOFormatterRepository.formatterForComponent(component, _dateFormat, _numberFormat, _formatter);
      }
      if (format != null) {
        try {
          Object parsedValue = format.parseObject(strValue);
          String formattedValue = format.format(parsedValue);
          objValue = format.parseObject(formattedValue);
        }
        catch (ParseException parseexception) {
          String valueKeyPath = _valueAssociation.keyPath();
View Full Code Here

      }
      if (format != null) {
        try {
          Object parsedValue = format.parseObject(strValue);
          String formattedValue = format.format(parsedValue);
          objValue = format.parseObject(formattedValue);
        }
        catch (ParseException parseexception) {
          String valueKeyPath = _valueAssociation.keyPath();
          ValidationException validationexception = new ValidationException(parseexception.getMessage(), strValue, valueKeyPath);
          component.validationFailedWithException(validationexception, strValue, valueKeyPath);
View Full Code Here

      String strValue = null;
      Format format = WOFormatterRepository.formatterForInstance(objValue, component, _dateFormat, _numberFormat, _formatter);
      if (format != null) {
        try {
          String formattedStrValue = format.format(objValue);
          Object parsedValue = format.parseObject(formattedStrValue);
          strValue = format.format(parsedValue);
        }
        catch (IllegalArgumentException illegalargumentexception) {
          NSLog._conditionallyLogPrivateException(illegalargumentexception);
        }
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.