Package org.apache.ws.jaxme.js

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


    jm.addLine("super.addAttribute(", pURI, ", ", pLocalName, ", ", pValue, ");");
    return jm;
  }

  protected JavaMethod getXMLHandlersNewResultMethod(ComplexTypeSG pController, JavaSource pSource) {
    JavaQName elementInterfaceClass = pController.getClassContext().getXMLInterfaceName();
    JavaMethod jm = pSource.newJavaMethod("newResult", elementInterfaceClass, JavaSource.PROTECTED);
    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, "();");
    }
    return jm;
  }
View Full Code Here


    Object result = new Object[]{"new ", itemType.getSimpleTypeSG().getRuntimeType(), "[]{", list, "}"};
    String collectionType = pController.getCollectionType();
    if ("indexed".equals(collectionType)) {
      return result;
    } else {
      JavaQName myListType = JavaQNameImpl.getInstance(collectionType, true);
      return new Object[]{"(new ", myListType, "(", Arrays.class, ".asList(", result, ")))"};
    }
  }
View Full Code Here

    pMethod.addLine(list, ".add(", itemType.getSimpleTypeSG().getCastFromString(pMethod, new Object[]{st, ".nextToken()"}, pData),
                    ");");
    pMethod.addEndFor();

    if ("indexed".equals(collectionType)) {
      JavaQName iType = itemType.getSimpleTypeSG().getRuntimeType();
      return new Object[]{"((", iType, ") ", list, ".toArray(new ", iType, "[", list, ".size()]))"};
    } else {
      return list;
    }
  }
View Full Code Here

    throw new IllegalStateException("Not implemented");
  }

  public Object getInitialValue(SimpleTypeSG pController, JavaSource p0) throws SAXException {
    String s = pController.getCollectionType();
    JavaQName listClass = "indexed".equals(s) ? ARRAYLIST_TYPE : JavaQNameImpl.getInstance(s, true);
    return new Object[]{"new ", listClass, "()"};
  }
View Full Code Here

      JavaSource js = pMethod.getJavaSource();
      while (js.isInnerClass()) {
        js = ((JavaInnerClass) js).getOuterClass();
      }
      JavaField[] fields = js.getFields();
      JavaQName qName = JavaQNameImpl.getInstance(DatatypeConverterInterface.class);
      JavaField converter = null;
      for (int i = 0;  i < fields.length;  i++) {
        if (qName.equals(fields[i].getType())  &&  JavaSource.DEFAULT_PROTECTION.equals(fields[i].getProtection())  &&
            fields[i].isStatic()  &&  fields[i].isFinal()) {
          converter = fields[i];
          break;
        }
      }
View Full Code Here

      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 :
        new Object[]{"((", memberRuntimeType, ") ", value, ")"};
      pMethod.addLine(result, " = ", memberTypes[i].getSimpleTypeSG().getCastToString(pMethod, v, pData), ";");
View Full Code Here

  }

  public JavaQName getRuntimeType(SimpleTypeSG pController) { return qName; }

  public JavaSource getEnumClass(SimpleTypeSG pController) throws SAXException {
    JavaQName valueType = super.getRuntimeType(pController);
    JavaQName qNameArray = JavaQNameImpl.getArray(qName);

    JavaSource js = pController.getSchema().getJavaSourceFactory().newJavaSource(qName, JavaSource.PUBLIC);
    js.addImplements(Serializable.class);

    JavaField name = js.newJavaField("name", String.class, JavaSource.PRIVATE);
View Full Code Here

    if (!pController.getTypeSG().isComplex()) {
      log.finest(mName, "<-", "null");
      return null;
    }

    JavaQName xmlInterfaceName = pController.getClassContext().getXMLInterfaceName();
    JavaSourceFactory jsf = getSchema().getJavaSourceFactory();
    JavaSource js = jsf.newJavaSource(xmlInterfaceName, JavaSource.PUBLIC);
    js.setType(JavaSource.INTERFACE);
    js.addExtends(Element.class);
View Full Code Here

    if (!pController.getTypeSG().isComplex()) {
      log.finest(mName, "<-", "null");
      return null;
    }

    JavaQName xmlImplementationName = pController.getClassContext().getXMLImplementationName();
    JavaSourceFactory jsf = getSchema().getJavaSourceFactory();
    JavaSource js = jsf.newJavaSource(xmlImplementationName, JavaSource.PUBLIC);
    js.addImplements(pController.getClassContext().getXMLInterfaceName());
    js.addImplements(JMElement.class);
View Full Code Here

    if (!myTypeSG.isComplex()  ||  myTypeSG.isGlobalClass()) {
      log.finest(mName, "<-", "null");
      return null;
    }

    JavaQName xmlSerializerName = pController.getClassContext().getXMLSerializerName();
    JavaSourceFactory jsf = getSchema().getJavaSourceFactory();
    JavaSource js = jsf.newJavaSource(xmlSerializerName, JavaSource.PUBLIC);
    js.addImplements(JMXmlSerializer.class);
    myTypeSG.getComplexTypeSG().generateXMLSerializerMethods(js);
    return js;
View Full Code Here

TOP

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

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.