Package org.apache.ws.jaxme.impl

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


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

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


  public JavaQName getRuntimeType(SimpleTypeSG pController) { return BYTE_ARRAY_TYPE; }
  protected String getDatatypeName() { return "HexBinary"; }

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

  public JavaQName getRuntimeType(SimpleTypeSG pController) { return BYTE_ARRAY_TYPE; }
  protected String getDatatypeName() { return "Base64Binary"; }

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

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

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

  protected JavaQName getObjectRuntimeType(SimpleTypeSG pController) { return LONG_OBJECT_TYPE; }
  protected String getDatatypeName() { return "Long"; }

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

  protected String getDatatypeName() { return "Time"; }

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

  protected JavaQName getObjectRuntimeType(SimpleTypeSG pController) { return DOUBLE_OBJECT_TYPE; }
  protected String getDatatypeName() { return "Double"; }

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

  protected JavaQName getObjectRuntimeType(SimpleTypeSG pController) { return BYTE_OBJECT_TYPE; }
  protected String getDatatypeName() { return "Byte"; }

  public Object getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new Object[]{"((", BYTE_TYPE, ") ", new Byte(new DatatypeConverterImpl().parseByte(pValue)), ")"};
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert byte value to integer: " + pValue, getLocator());
    }
  }
View Full Code Here

public class BooleanGetterPluginTest {

    @Test
    public void testBooleanGetter() throws Exception {

        DatatypeConverter.setDatatypeConverter(new DatatypeConverterImpl());

        Foo foo = new org.apache.cxf.configuration.foo.ObjectFactory().createFoo();

        foo.getBooleanAttr();
    }
View Full Code Here

  protected JavaQName getObjectRuntimeType(SimpleTypeSG pController) { return BYTE_OBJECT_TYPE; }
  protected String getDatatypeName() { return "Byte"; }

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