Examples of SimpleContentSG


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

      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

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

  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();
    TypedValue tv = createSimpleTypeConversion(result, scSG.getContentTypeSG(),
                           getParamResult(), scSG.getPropertySG().getPropertyName());
    scSG.getPropertySG().addValue(result, element, tv, null);
    return result;
  }
View Full Code Here

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

    ObjectSG e4 = elements[3];
    assertTrue(e4.getTypeSG().isComplex());
    ComplexTypeSG ct4 = e4.getTypeSG().getComplexTypeSG();
    assertTrue(ct4.hasSimpleContent());
    SimpleContentSG sct4 = ct4.getSimpleContentSG();
    assertTrue(!sct4.getContentTypeSG().isComplex());
    assertEquals(JavaQNameImpl.getInstance(int.class), sct4.getContentTypeSG().getRuntimeType());
    assertEquals(1, ct4.getAttributes().length);
    assertEquals(new XsQName((String) null, "g"), ct4.getAttributes()[0].getName());
    assertEquals(JavaQNameImpl.getInstance(boolean.class), ct4.getAttributes()[0].getTypeSG().getRuntimeType());
  }
View Full Code Here

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

  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();
    createSimpleTypeConversion(result, scSG.getContentTypeSG(),
                   getParamResult(),
                   scSG.getPropertySG().getPropertyName(),
                   scSG.getPropertySG(), element);
    return result;
  }
View Full Code Here

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

  public void simpleContent(ComplexTypeSG pType) throws SAXException {
    JavaQName elementInterface = pType.getClassContext().getXMLInterfaceName();
    castedElement = jm.newJavaField(elementInterface);
      castedElement.addLine("(", elementInterface, ") ", element);
      LocalJavaField chars = jm.newJavaField(String.class);
      SimpleContentSG simpleContent = pType.getSimpleContentSG();
      Object value = simpleContent.getPropertySG().getValue(castedElement);
      chars.addLine(simpleContent.getContentTypeSG().getSimpleTypeSG().getCastToString(jm, value, controller));
      jm.addIf(chars, " != null  &&  ", chars, ".length() > 0");
      LocalJavaField charArray = jm.newJavaField(char[].class);
      charArray.addLine(chars, ".toCharArray()");
      jm.addLine(handler, ".characters(", charArray, ", 0, ", charArray, ".length);");
      jm.addEndIf();
View Full Code Here

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

    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

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

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

                                    boolean pSetIsSet) throws SAXException {
    if (pController.isComplex()) {
      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

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

    ObjectSG e4 = elements[3];
    assertTrue(e4.getTypeSG().isComplex());
    ComplexTypeSG ct4 = e4.getTypeSG().getComplexTypeSG();
    assertTrue(ct4.hasSimpleContent());
    SimpleContentSG sct4 = ct4.getSimpleContentSG();
    assertTrue(!sct4.getContentTypeSG().isComplex());
    assertEquals(JavaQNameImpl.getInstance(int.class), sct4.getContentTypeSG().getRuntimeType());
    assertEquals(1, ct4.getAttributes().length);
    assertEquals(new XsQName((String) null, "g"), ct4.getAttributes()[0].getName());
    assertEquals(JavaQNameImpl.getInstance(boolean.class), ct4.getAttributes()[0].getTypeSG().getRuntimeType());
  }
View Full Code Here

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

    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
Copyright © 2018 www.massapi.com. 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.