Package org.codehaus.jam

Examples of org.codehaus.jam.JamServiceParams


     * @return Returns XmlSchema.
     * @throws Exception
     */
    public Collection buildWSDLTypes() throws Exception {
        JamServiceFactory factory = JamServiceFactory.getInstance();
        JamServiceParams jam_service_parms = factory.createServiceParams();
        // setting the classLoder
        // jam_service_parms.setParentClassLoader(factory.createJamClassLoader(classLoader));
        // it can posible to add the classLoader as well
        jam_service_parms.addClassLoader(generationParams.getClassLoader());
        jam_service_parms.includeClass(generationParams.getSourceClassName());

        for (int count = 0; count < generationParams.getExtraClasses().size(); ++count) {
            jam_service_parms.includeClass((String)generationParams.getExtraClasses().get(count));
        }

        JamService service = factory.createService(jam_service_parms);
        QName extraSchemaTypeName = null;
        JamClassIterator jClassIter = service.getClasses();
View Full Code Here


        }
        if (brokerFiles == null) {
            throw new BuildException("'clientFiles' must be specified");
        }
        JamServiceFactory jamServiceFactory = JamServiceFactory.getInstance();
        JamServiceParams serviceParams = jamServiceFactory.createServiceParams();
        if (mToolpath != null) {
            File[] tcp = path2files(mToolpath);
            for (int i = 0; i < tcp.length; i++) {
                serviceParams.addToolClasspath(tcp[i]);
            }
        }
        if (mClasspath != null) {
            File[] cp = path2files(mClasspath);
            for (int i = 0; i < cp.length; i++) {
                serviceParams.addClasspath(cp[i]);
            }
        }

        JClass[] classes = null;
        File propertiesFile = scenariosFile;
        try {
            if (srcDir != null) {
                serviceParams.includeSourcePattern(path2files(srcDir), mIncludes);
                JamService jam = jamServiceFactory.createService(serviceParams);
                classes = jam.getAllClasses();
            }
            else {
                // lets try load the properties file
View Full Code Here

            String sourceDir = basedir + "/src/main/java";

            System.out.println("Parsing source files in: " + sourceDir);

            JamServiceFactory jamServiceFactory = JamServiceFactory.getInstance();
            JamServiceParams params = jamServiceFactory.createServiceParams();
            File[] dirs = new File[] {
                new File(sourceDir)
            };
            params.includeSourcePattern(dirs, "**/*.java");
            JamService jam = jamServiceFactory.createService(params);

            {
                JavaMarshallingGenerator script = new JavaMarshallingGenerator();
                script.setJam(jam);
View Full Code Here

          String sourceDir = source+"/src/main/java";
         
            System.out.println("Parsing source files in: " + sourceDir);

            JamServiceFactory jamServiceFactory = JamServiceFactory.getInstance();
            JamServiceParams params = jamServiceFactory.createServiceParams();           
            File[] dirs = new File[]{new File(sourceDir)};           
            params.includeSourcePattern(dirs, "**/*.java");
            JamService jam = jamServiceFactory.createService(params);

            {
              CppClassesGenerator script = new CppClassesGenerator();
            script.setJam(jam);
View Full Code Here

          String sourceDir = source+"/src/main/java";
         
            System.out.println("Parsing source files in: " + sourceDir);

            JamServiceFactory jamServiceFactory = JamServiceFactory.getInstance();
            JamServiceParams params = jamServiceFactory.createServiceParams();           
            File[] dirs = new File[]{new File(sourceDir)};           
            params.includeSourcePattern(dirs, "**/*.java");
            JamService jam = jamServiceFactory.createService(params);

            {
              CHeadersGenerator script = new CHeadersGenerator();
            script.setJam(jam);
View Full Code Here

  public void execute() throws BuildException {
    if (mSrcDir == null) {
      throw new BuildException("'srcDir' must be specified");
    }
    JamServiceFactory jsf = JamServiceFactory.getInstance();
    JamServiceParams p = jsf.createServiceParams();
    if (mToolpath != null) {
     File[] tcp = path2files(mToolpath);
      for(int i=0; i<tcp.length; i++) p.addToolClasspath(tcp[i]);
    }
    if (mClasspath != null) {
     File[] cp = path2files(mClasspath);
      for(int i=0; i<cp.length; i++) p.addClasspath(cp[i]);
    }
    p.includeSourcePattern(path2files(mSrcDir),mIncludes);
    try {
      JamService js = jsf.createService(p);
      JClass[] classes = js.getAllClasses();
      mAnnogen.addAnnotationClasses(classes);
      log("Generating annotation impls for the following classes:");
View Full Code Here

  //FIXME need to clean up and add parameters, add usage statement
  public static void main(String[] args) {
    try {
    JamServiceFactory jsf = JamServiceFactory.getInstance();
    JamServiceParams params = jsf.createServiceParams();
    Annogen ag = new Annogen();
    for(int i=0; i<args.length; i++) {
      if (args[i].equals("-d")) {
        i++;
        ag.setOutputDir(new File(args[i]));
        i++;
      } else {
        File f = new File(args[i]);
        if (f.isDirectory()) {
          File[] fs = f.listFiles();
          for(int j=0; j<fs.length; j++) params.includeSourceFile(fs[j]);
        } else {
          params.includeSourceFile(f);
        }
      }
    }
      JamService js = jsf.createService(params);
      ag.addAnnotationClasses(js.getAllClasses());
View Full Code Here

    return new JamServiceImpl((ElementContext)jsps,
                              getSpecifiedClasses((JamServiceContextImpl)jsps));
  }

  public JamClassLoader createSystemJamClassLoader() {
    JamServiceParams params = createServiceParams();
    params.setUseSystemClasspath(true);
    try {
      JamService service = createService(params);
      return service.getClassLoader();
    } catch(IOException reallyUnexpected) {
      reallyUnexpected.printStackTrace();
View Full Code Here

      throw new IllegalStateException(reallyUnexpected.getMessage());
    }
  }

  public JamClassLoader createJamClassLoader(ClassLoader cl) {
    JamServiceParams params = createServiceParams();
    params.setUseSystemClasspath(false); //?
    params.setPropertyInitializer(null);
    params.addClassLoader(cl);
    try {
      JamService service = createService(params);
      return service.getClassLoader();
    } catch(IOException reallyUnexpected) {
      reallyUnexpected.printStackTrace();
View Full Code Here

  public JamService createService(InputStream in)
    throws IOException, XMLStreamException
  {
    if (in == null) throw new IllegalArgumentException("null stream");
    JamServiceFactory jsf = JamServiceFactory.getInstance();
    JamServiceParams params = jsf.createServiceParams();
    CachedClassBuilder cache = new CachedClassBuilder();
    // finish initalizing the params and create the service
    params.addClassBuilder(cache);
    JamService out = jsf.createService(params);
    // now go view the xml.  we have to do this afterwards so that the
    // classloader has been created and is available for linking.
    JamXmlReader reader = new JamXmlReader(cache,in,(ElementContext)params);
    reader.read();
View Full Code Here

TOP

Related Classes of org.codehaus.jam.JamServiceParams

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.