Package org.apache.ws.jaxme.js

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


    /** For tests
     */
    public static void main(String[] args) throws Exception {
      for (int i = 0;  i < args.length;  i++) {
        new JavaParser(new JavaSourceFactory()).parse(new File(args[i]));
        }
    }
View Full Code Here


  /** Reads the interface methods and converts them
   * into an instance of {@link JavaSource}.
   */
  public JavaSource getJavaSource(JavaSourceFactory pFactory) {
        Class c = getCompiledClass();
    JavaSource js = new JavaSourceFactory().newJavaSource(JavaQNameImpl.getInstance(c.getName()));
    Method[] methods = c.getMethods();
    for (int i = 0;  i < methods.length;  i++) {
      Method m = methods[i];
      getMethod(js, m);
    }
View Full Code Here

                          continue;
                      }
                     
                      Class c = cls[i].loadClass(getInterface());
                      if (c != null) {
                          return new CompiledClassReflector(c).getJavaSource(new JavaSourceFactory());
                      }
                  }
              } catch (Exception e) {
                  if (ex == null) {
                    ex = e;
                  }
              }
          }
          if (mode == null  ||  "Source".equals(mode)) {
              ClassLoader[] cls = getClassLoaders();
              for (int i = 0;  i < cls.length;  i++) {
                  if (cls[i] == null) {
                      continue;
                  }
                  URL url = cls[i].getResource(getInterface().replace('.', '/') + ".java");
                  if (url != null) {
                      SourceReflector reflector = new SourceReflector(url);
                      return reflector.getJavaSource(new JavaSourceFactory());
                  }
              }
          }
          if (ex == null) {
            throw new IllegalStateException("Failed to locate Java class "
View Full Code Here

    public abstract void generate(JavaSourceFactory pFactory, JavaQName pTargetClass)
        throws Exception;
    public void doExecute() {
       finish();
       try {
        JavaSourceFactory factory = new JavaSourceFactory();
        generate(factory, targetClass);
        factory.write(getDestDir());
       } catch (Exception e) {
         throw new BuildException(e, getLocation());
       }
    }
View Full Code Here

    sr.setGenerator(this);

    SchemaSG s = sr.parse(pSource);
    s.generate();
    File targetDir = getTargetDirectory();
    JavaSourceFactory jsf = s.getJavaSourceFactory();
    for (Iterator iter = jsf.getJavaSources();  iter.hasNext()) {
        ((JavaSource) iter.next()).setForcingFullyQualifiedName(true);
    }
    s.getJavaSourceFactory().write(targetDir);

    return s;
View Full Code Here

      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);

    TypeSG myTypeSG = pController.getTypeSG();
    ComplexTypeSG complexTypeSG = myTypeSG.getComplexTypeSG();
View Full Code Here

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

    JavaQName xmlImplementationName = pController.getClassContext().getXMLImplementationName();
    JavaSourceFactory jsf = getSchema().getJavaSourceFactory();
    JavaSource js = jsf.newJavaSource(xmlImplementationName, JavaSource.PUBLIC);
    SerializableSG.makeSerializable(pController.getSchema(), js);
    js.addImplements(pController.getClassContext().getXMLInterfaceName());
    js.addImplements(JMElement.class);

    TypeSG myTypeSG = pController.getTypeSG();
View Full Code Here

 
  public JavaSource getXMLInterface(ComplexTypeSG pController) throws SAXException {
    final String mName = "getXMLInterface";
    log.finest(mName, "->");
    JavaQName qName = pController.getClassContext().getXMLInterfaceName();
    JavaSourceFactory jsf = pController.getTypeSG().getSchema().getJavaSourceFactory();
    JavaSource js = jsf.newJavaSource(qName, JavaSource.PUBLIC);
    js.setType(JavaSource.INTERFACE);
    createXMLBean(pController, js);
    log.finest(mName, "<-", js.getQName());
    return js;
  }
View Full Code Here

  }
 
  public JavaSource getXMLImplementation(ComplexTypeSG pController) throws SAXException {
    final String mName = "getXMLImplementation(JavaQName)";
    log.finest(mName, "->", typeSG.getName());
    JavaSourceFactory jsf = pController.getTypeSG().getSchema().getJavaSourceFactory();
    JavaSource js = jsf.newJavaSource(pController.getClassContext().getXMLImplementationName(), JavaSource.PUBLIC);
    js.addImplements(pController.getClassContext().getXMLInterfaceName());
    createXMLBean(pController, js);
    log.finest(mName, "<-", js.getQName());
    return js;
  }
View Full Code Here

  public JavaSource getXMLSerializer(ComplexTypeSG pController) throws SAXException {
    final String mName = "getXMLSerializer";
    log.finest(mName, "->", typeSG.getName());
    JavaQName xmlSerializerName = pController.getClassContext().getXMLSerializerName();
    JavaSourceFactory jsf = typeSG.getSchema().getJavaSourceFactory();
    JavaSource js = jsf.newJavaSource(xmlSerializerName, JavaSource.PUBLIC);
    createXMLSerializer(pController, js);
    log.finest(mName, "<-", js.getQName());
    return js;
  }
View Full Code Here

TOP

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

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.