Package org.apache.ws.jaxme.js

Examples of org.apache.ws.jaxme.js.DirectAccessible


  }

  public JavaMethod newStartElementMethod() throws SAXException {
    JavaSource js = getJavaSource();
    JavaMethod jm = js.newJavaMethod("startElement", boolean.class, JavaSource.PUBLIC);
    DirectAccessible pNamespaceURI = jm.addParam(String.class, "pNamespaceURI");
    DirectAccessible pLocalName = jm.addParam(String.class, "pLocalName");
    DirectAccessible pQName = jm.addParam(String.class, "pQName");
    DirectAccessible pAttr = jm.addParam(Attributes.class, "pAttr");
    setParamNamespaceURI(pNamespaceURI);
    setParamLocalName(pLocalName);
    setParamQName(pQName);
    setParamAttrs(pAttr);
    setParamResult(null);
View Full Code Here


    return jm;
  }

  public JavaMethod newEndElementMethod() throws SAXException {
    JavaMethod jm = getJavaSource().newJavaMethod("endElement", void.class, JavaSource.PUBLIC);
    DirectAccessible pNamespaceURI = jm.addParam(String.class, "pNamespaceURI");
    DirectAccessible pLocalName = jm.addParam(String.class, "pLocalName");
    DirectAccessible pQName = jm.addParam(String.class, "pQName");
    DirectAccessible pResult = jm.addParam(Object.class, "pResult");
    setParamNamespaceURI(pNamespaceURI);
    setParamLocalName(pLocalName);
    setParamQName(pQName);
    setParamAttrs(null);
    setParamResult(pResult);
View Full Code Here

    Object s = new Object[]{"(", StringSG.STRING_TYPE, ") ", pValue};
    TypedValue result = new TypedValueImpl(pType.getSimpleTypeSG().getCastFromString(pJm, s, "getHandler()"),
                            pType.getSimpleTypeSG().getRuntimeType());
    pPropertySG.addValue(pJm, pElement, result, null);
    if (causingParseConversionEvent) {
      DirectAccessible e = pJm.addCatch(Exception.class);
      pJm.addLine("getHandler().parseConversionEvent(",
            JavaSource.getQuoted("Failed to convert value of " + pName + ": "),
            " + ", pValue, ", ", e, ");");
      pJm.addEndTry();
    }
View Full Code Here

        }
      }
      else {
        runtimeType = pController.getRuntimeType();
      }
      DirectAccessible param = jm.addParam(runtimeType, pParamName);
      if (!pSource.isInterface()) {
        jm.addLine(pFieldName, " = ", param, ";");
      }
      return jm;
    } else {
View Full Code Here

      Object o = new Object[]{"new ", arrayClass.getInstanceClass(),
                  "[", fieldName, ".size()]"};
      if (isAutoBoxing()) {
        LocalJavaField res = result.newJavaField(getArrayClass());
        res.addLine(o);
        DirectAccessible i = result.addForList(int.class, fieldName);
        result.addLine(res, "[", i, "] = ", asPrimitive(i, fieldName), ";");
        result.addEndFor();
        result.addLine("return ", res, ";");
      } else {
        result.addLine("return (", arrayClass, ") ", fieldName,
View Full Code Here

    JavaMethod result = pSource.newJavaMethod(methodName, "void", JavaSource.PUBLIC);
    Parameter array = result.addParam(arrayClass, "pValue");
    if (!pSource.isInterface()) {
      result.addLine(fieldName, ".clear();");
      result.addIf(array, " != null");
      DirectAccessible i = result.addForArray(int.class, array);
      Object o = new Object[]{array, "[", i, "]"};
      result.addLine(fieldName, ".add(", asObject(o), ");");
      result.addEndFor();
      result.addEndIf();
    }
View Full Code Here

  }

  public void forAllValues(PropertySG pController, JavaMethod pMethod, DirectAccessible pElement, SGlet pSGlet) throws SAXException {
    LocalJavaField array = pMethod.newJavaField(getArrayClass());
    array.addLine(pController.getValue(pElement));
    DirectAccessible i = pMethod.addForArray(array);
    Object v;
    boolean isCasting = !OBJECT_TYPE.equals(getInstanceClass());
    if (isCasting  &&  pSGlet instanceof SGlet.TypedSGlet) {
      isCasting = ((SGlet.TypedSGlet) pSGlet).isCasting();
    }
View Full Code Here

  }

  public void forAllNonNullValues(PropertySG pController, JavaMethod pMethod, DirectAccessible pElement, SGlet pSGlet) throws SAXException {
    LocalJavaField array = pMethod.newJavaField(getArrayClass());
    array.addLine(pController.getValue(pElement));
    DirectAccessible i = pMethod.addForArray(array);
    TypeSG typeSG = getObjectSG().getTypeSG();
    Object v;
    boolean isCasting = !OBJECT_TYPE.equals(typeSG.getRuntimeType());
    JavaQName qName = typeSG.getRuntimeType();
    if (isCasting  &&  pSGlet instanceof SGlet.TypedSGlet) {
View Full Code Here

  public JavaSource getJavaSource() { return javaSource; }
  public ComplexTypeSG getType() { return ctSG; }

  public JavaMethod newGetAttributesMethod() throws SAXException {
    JavaMethod jm = getJavaSource().newJavaMethod("getAttributes", AttributesImpl.class, JavaSource.PUBLIC);
    final DirectAccessible pController = jm.addParam(JMSAXDriverController.class, "pController");
    DirectAccessible pObject = jm.addParam(Object.class, "pObject");
    jm.addThrows(SAXException.class);
    final LocalJavaField result = jm.newJavaField(AttributesImpl.class);
    result.addLine("new ", AttributesImpl.class, "()");
    AttributeSG[] myAttributes = ctSG.getAttributes();
    if (myAttributes.length > 0) {
      JavaQName elementInterface = ctSG.getClassContext().getXMLInterfaceName();
      LocalJavaField element = jm.newJavaField(elementInterface);
      element.addLine("(", elementInterface, ") ", pObject);
     
      for (int i = 0;  i < myAttributes.length;  i++) {
        final AttributeSG attribute = myAttributes[i];
        if (attribute.isWildcard()) {
            LocalJavaField anyAttributes = jm.newJavaField(WildcardAttribute[].class);
            anyAttributes.addLine(element, ".", attribute.getPropertySG().getXMLGetMethodName() + "Array", "()");
            DirectAccessible index = jm.addForArray(anyAttributes);
            LocalJavaField wildcardAttribute = jm.newJavaField(WildcardAttribute.class);
            wildcardAttribute.addLine(anyAttributes, "[", index, "]");
          LocalJavaField qName = jm.newJavaField(QName.class);
          qName.addLine(wildcardAttribute, ".getName()");
          LocalJavaField uri = jm.newJavaField(String.class);
View Full Code Here

        }
      }
    }

    JavaMethod jm = getJavaSource().newJavaMethod("getPreferredPrefix", String.class, JavaSource.PUBLIC);
    DirectAccessible pURI = jm.addParam(String.class, "pURI");
    if (!uris.isEmpty()) {
      jm.addIf(pURI, " == null");
      jm.addLine(pURI, " = \"\";");
      jm.addEndIf();
      boolean first = true;
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.js.DirectAccessible

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.