Package org.apache.ws.jaxme.impl

Examples of org.apache.ws.jaxme.impl.DatatypeConverterImpl


  protected Class getFormatClass() { return XsDateFormat.class; }
 
  public TypedValue getCastFromString(SimpleTypeSG pController, String pValue)
      throws SAXException {
    try {
      Calendar calendar = new DatatypeConverterImpl().parseDate(pValue);
      return new TypedValueImpl(
          new Object[] { "new java.util.GregorianCalendar("
              + calendar.get(Calendar.YEAR) + ","
              + calendar.get(Calendar.MONTH) + ","
              + calendar.get(Calendar.DAY_OF_MONTH) + ")" },
View Full Code Here


  protected String getDatatypeName() { return "Long"; }
  protected JavaQName getDatatypeType() { return LONG_TYPE; }

  public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new TypedValueImpl(new Long(new DatatypeConverterImpl().parseLong(pValue)) + "l", LONG_TYPE);
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert string value to long: " + pValue, getLocator());
    }
  }
View Full Code Here

  protected String getDatatypeName() { return "Short"; }
  protected JavaQName getDatatypeType() { return SHORT_TYPE; }

  public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new TypedValueImpl(new Object[]{"((", SHORT_TYPE, ")", new Short(new DatatypeConverterImpl().parseShort(pValue)), ")"},
                  SHORT_TYPE);
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert string value to short: " + pValue, getLocator());
    }
  }
View Full Code Here

  protected String getDatatypeName() { return "Int"; }
  protected JavaQName getDatatypeType() { return INT_TYPE; }

  public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new TypedValueImpl(new Integer(new DatatypeConverterImpl().parseInt(pValue)), INT_TYPE);
    } catch (NumberFormatException e) {
      Locator locator;
      try {
        locator = getLocator();
      } catch (Exception f) {
View Full Code Here

  public JavaQName getPrimitiveRuntimeType(SimpleTypeSG pController) { return BOOLEAN_TYPE; }
  protected JavaQName getObjectRuntimeType(SimpleTypeSG pController) { return BOOLEAN_OBJECT_TYPE; }

  public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new TypedValueImpl(new DatatypeConverterImpl().parseBoolean(pValue) ? Boolean.TRUE : Boolean.FALSE,
                  BOOLEAN_OBJECT_TYPE);
    } catch (RuntimeException e) {
      throw new LocSAXException("Failed to convert string value to boolean: " + pValue, getLocator());
    }
  }
View Full Code Here

  protected String getDatatypeName() { return "HexBinary"; }
  protected JavaQName getDatatypeType() { return BYTE_ARRAY_TYPE; }

  public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new TypedValueImpl(new DatatypeConverterImpl().parseHexBinary(pValue), BYTE_ARRAY_TYPE);
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert string value to HexBinary: " + pValue, getLocator());
    }
  }
View Full Code Here

  protected String getDatatypeName() { return "Base64Binary"; }
  protected JavaQName getDatatypeType() { return BYTE_ARRAY_TYPE; }

  public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new TypedValueImpl(new DatatypeConverterImpl().parseBase64Binary(pValue), byte[].class);
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert string value to Base64Binary: " + pValue, getLocator());
    }
  }
View Full Code Here

      "<ex:DurationElem>P1Y2M3DT4H5M6.7S</ex:DurationElem>" +
      "<ex:HexBinaryElem>0111234E739DBBFF</ex:HexBinaryElem>" +
      "<ex:Base64BinaryElem>AREjTnOdu/8=</ex:Base64BinaryElem>" +
      "<ex:NmTokenElem>a-name-token</ex:NmTokenElem>" +
      "<ex:NmTokensElem>a-name-token another:name-token</ex:NmTokensElem>" +
      "<ex:DecimalElem>" + new DatatypeConverterImpl().printDecimal(newBigDecimal()) + "</ex:DecimalElem>" +
      "<ex:IntegerElem>-602300000000000000000000</ex:IntegerElem>" +
      "<ex:NonNegativeIntegerElem>101</ex:NonNegativeIntegerElem>" +
      "<ex:PositiveIntegerElem>602300000000000000000000</ex:PositiveIntegerElem>" +
      "<ex:NonPositiveIntegerElem>-21714</ex:NonPositiveIntegerElem>" +
      "<ex:NegativeIntegerElem>-21714</ex:NegativeIntegerElem>" +
View Full Code Here

      sep2 + "<ex:DurationElem>P1Y2M3DT4H5M6.7S</ex:DurationElem>" + lf +
      sep2 + "<ex:HexBinaryElem>0111234E739DBBFF</ex:HexBinaryElem>" + lf +
      sep2 + "<ex:Base64BinaryElem>AREjTnOdu/8=</ex:Base64BinaryElem>" + lf +
      sep2 + "<ex:NmTokenElem>a-name-token</ex:NmTokenElem>" + lf +
      sep2 + "<ex:NmTokensElem>a-name-token another:name-token</ex:NmTokensElem>" + lf +
      sep2 + "<ex:DecimalElem>" + new DatatypeConverterImpl().printDecimal(newBigDecimal()) + "</ex:DecimalElem>" + lf +
      sep2 + "<ex:IntegerElem>-602300000000000000000000</ex:IntegerElem>" + lf +
      sep2 + "<ex:NonNegativeIntegerElem>101</ex:NonNegativeIntegerElem>" + lf +
      sep2 + "<ex:PositiveIntegerElem>602300000000000000000000</ex:PositiveIntegerElem>" + lf +
      sep2 + "<ex:NonPositiveIntegerElem>-21714</ex:NonPositiveIntegerElem>" + lf +
      sep2 + "<ex:NegativeIntegerElem>-21714</ex:NegativeIntegerElem>" + lf +
View Full Code Here

      "<ex:DurationElem>P1Y2M3DT4H5M6.7S</ex:DurationElem>",
      "<ex:HexBinaryElem>0111234E739DBBFF</ex:HexBinaryElem>",
      "<ex:Base64BinaryElem>AREjTnOdu/8=</ex:Base64BinaryElem>",
      "<ex:NmTokenElem>a-name-token</ex:NmTokenElem>",
      "<ex:NmTokensElem>a-name-token another:name-token</ex:NmTokensElem>",
      "<ex:DecimalElem>" + new DatatypeConverterImpl().printDecimal(newBigDecimal()) + "</ex:DecimalElem>",
      "<ex:IntegerElem>-602300000000000000000000</ex:IntegerElem>",
      "<ex:NonNegativeIntegerElem>101</ex:NonNegativeIntegerElem>",
      "<ex:PositiveIntegerElem>602300000000000000000000</ex:PositiveIntegerElem>",
      "<ex:NonPositiveIntegerElem>-21714</ex:NonPositiveIntegerElem>",
      "<ex:NegativeIntegerElem>-21714</ex:NegativeIntegerElem>",
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.impl.DatatypeConverterImpl

Copyright © 2018 www.massapicom. 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.