Package org.apache.ws.jaxme.impl

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


  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 (RuntimeException e) {
    try {
      throw new LocSAXException("Failed to convert string value to "
          + getDatatypeName() + " instance: " + pValue, getLocator());
    } catch (Exception e1) {
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 (RuntimeException e) {
    try {
      throw new LocSAXException("Failed to convert string value to "
          + getDatatypeName() + " instance: " + pValue, getLocator());
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) {
    try {
      throw new LocSAXException("Failed to convert string value to "
          + getDatatypeName() + " instance: " + pValue, getLocator());
View Full Code Here

  protected Class getFormatClass() { return XsTimeFormat.class; }
 
    public TypedValue getCastFromString(SimpleTypeSG pController, String pValue)
      throws SAXException {
    try {
      Calendar calendar = new DatatypeConverterImpl().parseTime(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 "Double"; }
  protected JavaQName getDatatypeType() { return DOUBLE_TYPE; }

  public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new TypedValueImpl(new Double(new DatatypeConverterImpl().parseDouble(pValue)) + "d", getDatatypeType());
  } catch (RuntimeException e) {
    try {
      throw new LocSAXException("Failed to convert string value to "
          + getDatatypeName() + " instance: " + pValue, getLocator());
    } catch (Exception e1) {
View Full Code Here

  protected String getDatatypeName() { return "Byte"; }
  protected JavaQName getDatatypeType() { return BYTE_TYPE; }

  public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new TypedValueImpl(new Object[]{"((", BYTE_TYPE, ") ", new Byte(new DatatypeConverterImpl().parseByte(pValue)), ")"},
                  BYTE_TYPE);
  } catch (RuntimeException e) {
    try {
      throw new LocSAXException("Failed to convert string value to "
          + getDatatypeName() + " instance: " + 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

    public JavaQName getRuntimeType(SimpleTypeSG pController) { return CALENDAR_TYPE; }

    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

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.