Package org.apache.ws.jaxme.js

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


        typeSG.getSimpleTypeSG().forAllValues(pMethod, pController.getValue(pElement), pSGlet);
      }
      pMethod.addEndIf();
    } else {
      if (typeSG.isComplex()) {
        LocalJavaField f = pMethod.newJavaField(typeSG.getComplexTypeSG().getClassContext().getXMLInterfaceName());
        f.addLine(pController.getValue(pElement));
        pMethod.addIf(f, " != null");
        pSGlet.generate(pMethod, pController.getValue(pElement));
        pMethod.addEndIf();
      } else {
        typeSG.getSimpleTypeSG().forAllNonNullValues(pMethod, pController.getValue(pElement), pSGlet);
View Full Code Here


        pMethod.addLine(pController.getXMLSetMethodName(), "(", pValue, ");");
      } else {
        pMethod.addLine(pElement, ".", pController.getXMLSetMethodName(), "(", pValue, ");");
      }
    } else {
      LocalJavaField list = pMethod.newJavaField(List.class);
      list.addLine(pController.getValue(pElement));
      pMethod.addLine(list, ".clear();");
      pMethod.addLine(list, ".addAll(", pValue, ");");
    }
  }
View Full Code Here

      throw new LocSAXException("Failed to convert string value to Base64Binary: " + pValue, getLocator());
    }
  }

  public void forAllNonNullValues(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, SGlet pSGlet) throws SAXException {
    LocalJavaField f = pMethod.newJavaField(BYTE_ARRAY_TYPE);
    f.addLine(pValue);
    pMethod.addIf(f, " != null");
    pSGlet.generate(pMethod, pValue);
    pMethod.addEndIf();
  }
View Full Code Here

                                   Object pData) throws SAXException {
    DirectAccessible value;
    if (pValue instanceof DirectAccessible) {
      value = (DirectAccessible) pValue;
    } else {
      LocalJavaField v = pMethod.newJavaField(String.class);
      v.addLine(pValue);
      value = v;
    }

    LocalJavaField result = pMethod.newJavaField(pController.getRuntimeType());
    for (int i = 0;  i < memberTypes.length;  i++) {
      pMethod.addTry();
      pMethod.addLine(result, " = ", memberTypes[i].getSimpleTypeSG().getCastFromString(pMethod, value, pData), ";");
      pMethod.addCatch(RuntimeException.class);
    }
View Full Code Here

                                 DirectAccessible pData) throws SAXException {
    DirectAccessible value;
    if (pValue instanceof DirectAccessible) {
      value = (DirectAccessible) pValue;
    } else {
      LocalJavaField v = pMethod.newJavaField(Object.class);
      v.addLine(pValue);
      value = v;
    }

    LocalJavaField result = pMethod.newJavaField(String.class);
    for (int i = 0;  i < memberTypes.length;  i++) {
      JavaQName memberRuntimeType = memberTypes[i].getSimpleTypeSG().getRuntimeType();
      pMethod.addIf(i == 0, value, " instanceof ", memberRuntimeType);
      Object v = OBJECT_TYPE.equals(memberRuntimeType) ?
        (Object) value :
View Full Code Here

  }

  public UnionTypeSG getUnionType(SimpleTypeSG pController) { return unionTypeSG; }

  public void forAllNonNullValues(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, SGlet pSGlet) throws SAXException {
    LocalJavaField f = pMethod.newJavaField(OBJECT_TYPE);
    f.addLine(pValue);
    pMethod.addIf(f, " != null");
    pSGlet.generate(pMethod, pValue);
    pMethod.addEndIf();
  }
View Full Code Here

      throw new LocSAXException("Failed to convert string value to BigInteger: " + pValue, getLocator());
    }
  }

  public void forAllNonNullValues(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, SGlet pSGlet) throws SAXException {
    LocalJavaField f = pMethod.newJavaField(INTEGER_TYPE);
    f.addLine(pValue);
    pMethod.addIf(f, " != null");
    pSGlet.generate(pMethod, pValue);
    pMethod.addEndIf();
  }
View Full Code Here

  public Object getCastToString(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, DirectAccessible pData) {
    return new Object[]{pValue, ".toString()"};
  }

  public void forAllNonNullValues(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, SGlet pSGlet) throws SAXException {
    LocalJavaField f = pMethod.newJavaField(DURATION_TYPE);
    f.addLine(pValue);
    pMethod.addIf(f, " != null");
    pSGlet.generate(pMethod, pValue);
    pMethod.addEndIf();
  }
View Full Code Here

    pSGlet.generate(pMethod, pValue);
  }

  public void forAllNonNullValues(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, SGlet pSGlet) throws SAXException {
    if (pController.isNullable()) {
      LocalJavaField f = pMethod.newJavaField(getObjectRuntimeType(pController));
      f.addLine(pValue);
      pMethod.addIf(f, " != null");
      pSGlet.generate(pMethod, pValue);
      pMethod.addEndIf();
    } else {
      pSGlet.generate(pMethod, pValue);
View Full Code Here

    }
  }

  public Object getCastFromString(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, Object pData)
      throws SAXException {
    LocalJavaField list = pMethod.newJavaField(LIST_TYPE);
    String collectionType = pController.getCollectionType();
    list.addLine("new ", ("indexed".equals(collectionType) ?
                          ARRAYLIST_TYPE : JavaQNameImpl.getInstance(collectionType, true)), "()");
    DirectAccessible st = pMethod.addForEnumeration(StringTokenizer.class, new Object[]{"new ", StringTokenizer.class, "(", pValue, ")"});
    pMethod.addLine(list, ".add(", itemType.getSimpleTypeSG().getCastFromString(pMethod, new Object[]{st, ".nextToken()"}, pData),
                    ");");
    pMethod.addEndFor();
View Full Code Here

TOP

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

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.