Examples of DirectAccessible


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

  }

  private JavaMethod getXMLSerializersInitMethod(GroupSG pController, JavaSource pSource) throws SAXException {
    ParticleSG[] myParticles = pController.getParticles();
    JavaMethod jm = null;
    DirectAccessible pFactory = null;
    for (int i = 0;  i < myParticles.length;  i++) {
      ParticleSG particle = myParticles[i];
      if (!particle.isElement()) {
        continue;
      }
View Full Code Here

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

        // TODO: Implement handling for wildcards and subgroups
        throw new IllegalStateException("Wildcards and subgroups are not implemented.");
      }
      if (jm == null) {
        jm = pSource.newJavaMethod("marshalChilds", JavaQNameImpl.VOID, JavaSource.PROTECTED);
        DirectAccessible pData = jm.addParam(JavaQNameImpl.getInstance(JMXmlSerializer.Data.class), "pData");
        sgLet = new XMLSerializersMarshalChildsSGlet(pData);
        JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
        DirectAccessible pObject = jm.addParam(Object.class, "pObject");
        pElement = jm.newJavaField(elementInterface);
        pElement.addLine("(", elementInterface, ") ", pObject);
        jm.addThrows(SAXException.class);
      }
View Full Code Here

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

  }
   

  private JavaMethod getXMLHandlersInitMethod(GroupSG pController, JavaSource pSource) throws SAXException {
    JavaMethod jm = null;
    DirectAccessible pData = null;
    ParticleSG[] myParticles = pController.getParticles();
    for (int i = 0;  i < myParticles.length;  i++) {
      ParticleSG particle = myParticles[i];
      if (particle.isElement()) {
        ObjectSG objectSG = particle.getObjectSG();
        TypeSG typeSG = objectSG.getTypeSG();
        if (typeSG.isComplex()) {
          if (jm == null) {
            jm = pSource.newJavaMethod("init", JavaQNameImpl.VOID, JavaSource.PUBLIC);
            pData = jm.addParam(JMHandler.Data.class, "pData");
            jm.addThrows(JAXBException.class);
            jm.addLine("super.init(", pData, ");");
          }

          String f = particle.getPropertySG().getXMLFieldName();
          String handlerFieldName = "__handler_" + f;
          String handlerMethodName = getXMLHandlersMethodName(particle.getPropertySG());

          JavaField jf = pSource.newJavaField(handlerFieldName, JMHandler.class, JavaSource.PRIVATE);
          JavaMethod jm2 = pSource.newJavaMethod(handlerMethodName, JMHandler.class, "protected");
          jm2.addThrows(SAXException.class);
          jm2.addIf(handlerFieldName, " == null");
         
          ComplexTypeSG childSG = typeSG.getComplexTypeSG();
          JavaQName interfaceName = childSG.getClassContext().getXMLInterfaceName();
          JavaQName handlerClassName = childSG.getClassContext().getXMLHandlerName();
          jm2.addTry();
          if (typeSG.isGlobalClass()) {
            jm2.addLine(handlerFieldName, " = getData().getFactory().getJMHandler(",
                        interfaceName, ".class);");
          } else {
            jm2.addLine(jf, " = new ", handlerClassName, "();");
          }
          jm2.addLine(jf, ".init(getData());");
          DirectAccessible e = jm2.addCatch(JAXBException.class);
          jm2.addThrowNew(SAXException.class, e);
          jm2.addEndTry();
          jm2.addEndIf();
          jm2.addLine("return ", jf, ";");
View Full Code Here

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

    if (myParticles.length == 0) {
      return null;
    }

    JavaMethod jm = pSource.newJavaMethod("endElement", JavaQNameImpl.VOID, JavaSource.PUBLIC);
    DirectAccessible pNamespaceURI = jm.addParam(String.class, "pNamespaceURI");
    DirectAccessible pLocalName = jm.addParam(String.class, "pLocalName");
    DirectAccessible pQName = jm.addParam(String.class, "pQName");
    jm.addThrows(SAXException.class);

    jm.addIf(pHandlerVar, " == null");
    jm.addIf(pLevelVar, " != 1");
    jm.addLine("super.endElement(", pNamespaceURI, ", ", pLocalName, ", ", pQName, ");");
View Full Code Here

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

  public JavaMethod getXMLHandlersCharactersMethod(GroupSG pController, JavaSource pSource,
                                                    DirectAccessible pHandlerVar)
      throws SAXException {
    JavaMethod jm = pSource.newJavaMethod("characters", JavaQNameImpl.VOID, JavaSource.PUBLIC);
    DirectAccessible pChars = jm.addParam(char[].class, "pChars");
    DirectAccessible pOffset = jm.addParam(int.class, "pOffset");
    DirectAccessible pLen = jm.addParam(int.class, "pLen");
    jm.addThrows(SAXException.class);
    jm.addIf(pHandlerVar, " == null");
    jm.addLine("super.characters(", pChars,", ", pOffset, ", ", pLen, ");");
    jm.addElse();
    jm.addLine(pHandlerVar, ".characters(", pChars, ", ", pOffset, ", ", pLen, ");");
View Full Code Here

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

  public JavaMethod getXMLSetMethod(TypeSG pController, JavaSource pSource,
                                     String pFieldName, String pMethodName) throws SAXException {
    if (pController.isComplex()) {
      String pName = "p" + Character.toUpperCase(pFieldName.charAt(0)) + pFieldName.substring(1);
      JavaMethod jm = pSource.newJavaMethod(pMethodName, JavaQNameImpl.VOID, JavaSource.PUBLIC);
      DirectAccessible param = jm.addParam(pController.getRuntimeType(), pName);
      if (!pSource.isInterface()) {
        jm.addLine(pFieldName, " = ", param, ";");
        JavaQName checkQName = pController.getRuntimeType();
        boolean isPrimitive = "".equals(checkQName.getPackageName());
        if (isPrimitive) {
View Full Code Here

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

      log.finest(mName, "<-");
      return;
    }

    JavaMethod jm = pSource.newJavaMethod("getAttributes", AttributesImpl.class, "protected");
    DirectAccessible pData = jm.addParam(JavaQNameImpl.getInstance(JMXmlSerializer.Data.class), "pData");
    DirectAccessible pElement = jm.addParam(Object.class, "pElement");
    jm.addThrows(SAXException.class);
    LocalJavaField result = jm.newJavaField(AttributesImpl.class);
    result.addLine("super.getAttributes(", pData, ", ", pElement, ")");
    JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
    LocalJavaField element = jm.newJavaField(elementInterface);
View Full Code Here

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

    if (uris.isEmpty()) {
      return null;
    }
    JavaMethod jm = pSource.newJavaMethod("getPreferredPrefix", String.class, JavaSource.PUBLIC);
    DirectAccessible pURI = jm.addParam(String.class, "pURI");
    jm.addIf(pURI, " == null");
    jm.addLine(pURI, " = \"\";");
    jm.addEndIf();
    boolean first = true;
    for (Iterator iter = uris.entrySet().iterator();  iter.hasNext()) {
View Full Code Here

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

    if (myAttributes.length == 0) {
      return null;
    }

    JavaMethod jm = pSource.newJavaMethod("addAttribute", JavaQNameImpl.VOID, JavaSource.PUBLIC);
    DirectAccessible pURI = jm.addParam(String.class, "pURI");
    DirectAccessible pLocalName = jm.addParam(String.class, "pLocalName");
    DirectAccessible pValue = jm.addParam(String.class, "pValue");
    jm.addThrows(SAXException.class);
    jm.addIf(pURI, " == null");
    jm.addLine(pURI, " = \"\";");
    jm.addEndIf();
View Full Code Here

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

    jm.addThrows(SAXException.class);
    if (pController.getClassContext().isGlobal()) {
      jm.addTry();
      jm.addLine("return (", elementInterfaceClass, ") getData().getFactory().getElement(",
                 elementInterfaceClass, ".class);");
      DirectAccessible e = jm.addCatch(JAXBException.class);
      jm.addThrowNew(SAXException.class, e);
      jm.addEndTry();
    } else {
      JavaQName elementImplClass = pController.getClassContext().getXMLImplementationName();
      jm.addLine("return new ", elementImplClass, "();");
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.