Package org.apache.ws.jaxme.impl

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


  protected boolean isUnsigned() { return true; }
  protected String getDatatypeName() { return "UnsignedShort"; }

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


  protected String getDatatypeName() { return "Integer"; }
  protected JavaQName getDatatypeType() { return INTEGER_TYPE; }

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

  protected String getDatatypeName() { return "Decimal"; }
  protected JavaQName getDatatypeType() { return DECIMAL_TYPE; }

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

  protected String getDatatypeName() { return "Date"; }
  protected Class getFormatClass() { return XsDateFormat.class; }
 
  public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new TypedValueImpl(new DatatypeConverterImpl().parseDate(pValue),
                  getDatatypeType());
    } catch (RuntimeException e) {
      throw new LocSAXException("Failed to convert string value to date instance: " + pValue, getLocator());
    }
  }
View Full Code Here

  protected boolean isUnsigned() { return true; }
  protected String getDatatypeName() { return "UnsignedInt"; }

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

  protected String getDatatypeName() { return "Time"; }
  protected Class getFormatClass() { return XsTimeFormat.class; }
 
  public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new TypedValueImpl(new DatatypeConverterImpl().parseTime(pValue), getDatatypeType());
    } catch (RuntimeException e) {
      throw new LocSAXException("Failed to convert string value to time instance: " + pValue, getLocator());
    }
  }
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)), getDatatypeType());
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert string value to double: " + pValue, getLocator());
    }
  }
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 (NumberFormatException e) {
      throw new LocSAXException("Failed to convert byte value to integer: " + pValue, getLocator());
    }
  }
View Full Code Here

      return new TypedValueImpl(new Object[]{DURATION_TYPE, ".valueOf(", pValue, ")"}, DURATION_TYPE);
  }

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

  protected String getDatatypeName() { return "Float"; }
  protected JavaQName getDatatypeType() { return FLOAT_TYPE; }

  public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new TypedValueImpl(new Float(new DatatypeConverterImpl().parseFloat(pValue)) + "f", FLOAT_TYPE);
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert string value to float: " + pValue, getLocator());
    }
  }
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.