Package org.apache.ws.jaxme.generator.sg

Examples of org.apache.ws.jaxme.generator.sg.SimpleContentSG


  public JavaMethod getXMLGetMethod(TypeSG pController, JavaSource pSource,
                                     String pFieldName, String pMethodName) throws SAXException {
    JavaQName runtimeType;
    if (pController.isComplex() && pFieldName.equals("value") && pController.getComplexTypeSG().hasSimpleContent()) {
      SimpleContentSG obj = pController.getComplexTypeSG().getSimpleContentSG();
      runtimeType = obj.getContentTypeSG().getRuntimeType();
      if (pController.isRestriction()) {
        if (pController.getRestrictedType().isExtension()) {
          runtimeType = pController.getRestrictedType().getExtendedType().getRuntimeType();
        }
      }
View Full Code Here


    if (pController.isComplex()) {
      String pName = "p" + Character.toUpperCase(pFieldName.charAt(0)) + pFieldName.substring(1);
      JavaMethod jm = pSource.newJavaMethod(pMethodName, JavaQNameImpl.VOID, JavaSource.PUBLIC);
      JavaQName runtimeType;
      if (pFieldName.equals("value") && pController.getComplexTypeSG().hasSimpleContent()) {
        SimpleContentSG obj = pController.getComplexTypeSG().getSimpleContentSG();
        runtimeType = obj.getContentTypeSG().getRuntimeType();
        if (pController.isRestriction()) {
          if (pController.getRestrictedType().isExtension()) {
            runtimeType = pController.getRestrictedType().getExtendedType().getRuntimeType();
          }
        }
View Full Code Here

  public JavaMethod newEndElementMethod() throws SAXException {
    JavaMethod result = super.newEndElementMethod();
    JavaQName elementInterface = ctSG.getClassContext().getXMLInterfaceName();
    LocalJavaField element = result.newJavaField(elementInterface);
    element.addLine("(", elementInterface, ") result");
    SimpleContentSG scSG = ctSG.getSimpleContentSG();
    Object v = getParamResult();
    v = new Object[]{"(", String.class, ") ", v};
    TypedValue tv = scSG.getContentTypeSG().getSimpleTypeSG().getCastFromString(result, v, "getHandler()");
    scSG.getPropertySG().addValue(result, element, tv, null);
    return result;
  }
View Full Code Here

    Parameter paramController = getParamController();
    JavaQName elementInterface = ctSG.getClassContext().getXMLInterfaceName();
      LocalJavaField element = jm.newJavaField(elementInterface);
      element.addLine("(", elementInterface, ") ", paramElement);
      LocalJavaField chars = jm.newJavaField(String.class);
      SimpleContentSG simpleContent = ctSG.getSimpleContentSG();
      Object value = simpleContent.getPropertySG().getValue(element);
      chars.addLine(simpleContent.getContentTypeSG().getSimpleTypeSG().getCastToString(jm, value, paramController));
        jm.addIf(chars, " != null  &&  ", chars, ".length() > 0");
      LocalJavaField charArray = jm.newJavaField(char[].class);
      charArray.addLine(chars, ".toCharArray()");
      jm.addLine(paramController, ".getTarget().characters(", charArray, ", 0, ", charArray, ".length);");
        jm.addEndIf();
View Full Code Here

      Parameter pElement = jm.addParam(Object.class, "pElement");
      JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
      LocalJavaField element = jm.newJavaField(elementInterface);
      element.addLine("(", elementInterface, ") ", pElement);
      LocalJavaField chars = jm.newJavaField(String.class);
      SimpleContentSG simpleContent = pController.getSimpleContentSG();
      Object value = simpleContent.getPropertySG().getValue(element);
      chars.addLine(simpleContent.getContentTypeSG().getSimpleTypeSG().getCastToString(jm, value, pData));
      LocalJavaField charArray = jm.newJavaField(char[].class);
      charArray.addLine(chars, ".toCharArray()");
      jm.addLine(pData, ".getContentHandler().characters(", charArray, ", 0, ", charArray, ".length);");
      return jm;
  }
View Full Code Here

      if (pController.hasSimpleContent()) {
          JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
          LocalJavaField element = jm.newJavaField(elementInterface);
          element.addLine("(", elementInterface, ") getResult()");

          SimpleContentSG simpleContent = pController.getSimpleContentSG();
          Object value = simpleContent.getContentTypeSG().getSimpleTypeSG().getCastFromString(jm, "__content.toString()", "getData()");
          simpleContent.getPropertySG().setValue(jm, element, value, null);
      }
      jm.addBreak();
      if (pController.hasSimpleContent()) {
          jm.addDefault();
          jm.addLine("super.endElement(pNamespaceURI, pLocalName, pQName);");
View Full Code Here

    if (pSource.isInterface()) {
      return null;
    } else {
      JavaQName runtimeType;
      if (pController.isComplex() && pFieldName.equals("value") && pController.getComplexTypeSG().hasSimpleContent()) {
        SimpleContentSG obj = pController.getComplexTypeSG().getSimpleContentSG();
        runtimeType = obj.getContentTypeSG().getRuntimeType();
        if (pController.isRestriction()) {
          if (pController.getRestrictedType().isExtension()) {
            runtimeType = pController.getRestrictedType().getExtendedType().getRuntimeType();
          }
        }
View Full Code Here

  public JavaMethod getXMLGetMethod(TypeSG pController, JavaSource pSource,
                                     String pFieldName, String pMethodName) throws SAXException {
    JavaQName runtimeType;
    if (pController.isComplex() && pFieldName.equals("value") && pController.getComplexTypeSG().hasSimpleContent()) {
      SimpleContentSG obj = pController.getComplexTypeSG().getSimpleContentSG();
      runtimeType = obj.getContentTypeSG().getRuntimeType();
      if (pController.isRestriction()) {
        if (pController.getRestrictedType().isExtension()) {
          runtimeType = pController.getRestrictedType().getExtendedType().getRuntimeType();
        }
      }
View Full Code Here

    if (pController.isComplex()) {
      String pName = "p" + Character.toUpperCase(pFieldName.charAt(0)) + pFieldName.substring(1);
      JavaMethod jm = pSource.newJavaMethod(pMethodName, JavaQNameImpl.VOID, JavaSource.PUBLIC);
      JavaQName runtimeType;
        if (pFieldName.equals("value") && pController.getComplexTypeSG().hasSimpleContent()) {
          SimpleContentSG obj = pController.getComplexTypeSG().getSimpleContentSG();
          runtimeType = obj.getContentTypeSG().getRuntimeType();
          if (pController.isRestriction()) {
            if (pController.getRestrictedType().isExtension()) {
              runtimeType = pController.getRestrictedType().getExtendedType().getRuntimeType();
            }
          }
View Full Code Here

    if (pSource.isInterface()) {
      return null;
    } else {
      JavaQName runtimeType;
      if (pController.isComplex() && pFieldName.equals("value") && pController.getComplexTypeSG().hasSimpleContent()) {
        SimpleContentSG obj = pController.getComplexTypeSG().getSimpleContentSG();
        runtimeType = obj.getContentTypeSG().getRuntimeType();
        if (pController.isRestriction()) {
          if (pController.getRestrictedType().isExtension()) {
            runtimeType = pController.getRestrictedType().getExtendedType().getRuntimeType();
          }
        }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.generator.sg.SimpleContentSG

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.