Package org.apache.ws.jaxme.js.impl

Examples of org.apache.ws.jaxme.js.impl.TypedValueImpl


  }

  public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    for (int i = 0;  i < values.length;  i++) {
      if (values[i].getValue().equals(pValue)) {
        return new TypedValueImpl(values[i].getName(), qName);
      }
    }
    return super.getCastFromString(pController, pValue);
  }
View Full Code Here


    }
    return super.getCastFromString(pController, pValue);
  }

  public TypedValue getCastToString(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, DirectAccessible pData) {
    return new TypedValueImpl(new Object[]{pValue, ".toString()"}, String.class);
  }
View Full Code Here

            list.add(qName);
        } else {
            addCall(pController, list, parseMethod, type);
        }
        addValues(list, value, pData);
    return new TypedValueImpl(list, type);
    }
View Full Code Here

  public TypedValue getCastToString(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, DirectAccessible pData) {
    return getCastToString(pController, pValue, pData);
  }

  public TypedValue getCastToString(SimpleTypeSG pController, Object pValue, DirectAccessible pData) {
    return new TypedValueImpl(new Object[]{pData, ".getDatatypeConverter().print" + getDatatypeName() + "(", pValue, ")"},
                  String.class);
  }
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 java.math.BigInteger(\"" + pValue + "\")", INTEGER_TYPE);
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert string value to BigInteger: " + pValue, getLocator());
    }
  }
View Full Code Here

  }

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

  public TypedValue getCastFromString(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, Object pData) {
      return new TypedValueImpl(new Object[]{DURATION_TYPE, ".valueOf(", pValue, ")"}, DURATION_TYPE);
  }
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("org.apache.ws.jaxme.util.Duration.valueOf(\"" + pValue + "\")", DURATION_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

    }
  }
  }

  public TypedValue getCastToString(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, DirectAccessible pData) {
    return new TypedValueImpl(new Object[]{pValue, ".toString()"}, String.class);
  }
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 (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 "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

TOP

Related Classes of org.apache.ws.jaxme.js.impl.TypedValueImpl

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.