Examples of ClassCollector


Examples of groovy.lang.GroovyClassLoader.ClassCollector

    CompilerConfiguration configuration = this.loader.getConfiguration();

    CompilationUnit compilationUnit = new CompilationUnit(configuration, null,
        this.loader);
    ClassCollector collector = this.loader.createCollector(compilationUnit, null);
    compilationUnit.setClassgenCallback(collector);

    for (String source : sources) {
      List<String> paths = ResourceUtils.getUrls(source, this.loader);
      for (String path : paths) {
        compilationUnit.addSource(new URL(path));
      }
    }

    addAstTransformations(compilationUnit);

    compilationUnit.compile(Phases.CLASS_GENERATION);
    for (Object loadedClass : collector.getLoadedClasses()) {
      classes.add((Class<?>) loadedClass);
    }
    ClassNode mainClassNode = getMainClass(compilationUnit);

    Class<?> mainClass = null;
View Full Code Here

Examples of org.apache.cxf.tools.util.ClassCollector

                    }
                }
            }
            context.put(ToolConstants.SCHEMA_MAP, schemas);
            context.put(ToolConstants.PORTTYPE_MAP, interfaces);
            context.put(ClassCollector.class, new ClassCollector());
            Processor processor = frontend.getProcessor();
            if (processor instanceof ClassNameProcessor) {
                processor.setEnvironment(context);
                for (ServiceInfo service : serviceList) {
View Full Code Here

Examples of org.apache.cxf.tools.util.ClassCollector

                }
            }
        }
        context.put(ToolConstants.SCHEMA_MAP, schemas);
        context.put(ToolConstants.PORTTYPE_MAP, interfaces);
        context.put(ClassCollector.class, new ClassCollector());
        WSDLToJavaScriptProcessor processor = new WSDLToJavaScriptProcessor();

        for (ServiceInfo service : serviceList) {

            context.put(ServiceInfo.class, service);
View Full Code Here

Examples of org.apache.cxf.tools.util.ClassCollector

    public void initialize(ToolContext c) throws ToolException {
        this.context = c;
       
        SchemaCompilerImpl schemaCompiler = (SchemaCompilerImpl)XJC.createSchemaCompiler();
        ClassCollector classCollector = context.get(ClassCollector.class);
       
        ClassNameAllocatorImpl allocator
            = new ClassNameAllocatorImpl(classCollector,
                                         c.optionSet(ToolConstants.CFG_AUTORESOLVE));
View Full Code Here

Examples of org.apache.cxf.tools.util.ClassCollector

            }
        }
    }

    private boolean addedToClassCollector(String packageName) {
        ClassCollector classCollector = context.get(ClassCollector.class);
        List<String> files = (List<String>)classCollector.getGeneratedFileInfo();
        for (String file : files) {
            int dotIndex = file.lastIndexOf(".");
            String sub = file.substring(0, dotIndex - 1);
            if (sub.equals(packageName)) {
                return true;
View Full Code Here

Examples of org.apache.cxf.tools.util.ClassCollector

            TypesCodeWriter fileCodeWriter = new TypesCodeWriter(new File(dir), context.getExcludePkgList());

            if (rawJaxbModelGenCode instanceof S2JJAXBModel) {
                S2JJAXBModel schem2JavaJaxbModel = (S2JJAXBModel)rawJaxbModelGenCode;

                ClassCollector classCollector = context.get(ClassCollector.class);
                for (JClass cls : schem2JavaJaxbModel.getAllObjectFactories()) {
                    classCollector.getTypesPackages().add(cls._package().name());
                }

                JCodeModel jcodeModel = schem2JavaJaxbModel.generateCode(null, null);

                if (!isSuppressCodeGen()) {
View Full Code Here

Examples of org.apache.cxf.tools.util.ClassCollector

        Options opts = null;
        opts = getOptions(schemaCompiler);
        hackInNewInternalizationLogic(schemaCompiler, catalog, opts);

        ClassCollector classCollector = context.get(ClassCollector.class);

        ClassNameAllocatorImpl allocator
            = new ClassNameAllocatorImpl(classCollector,
                                         c.optionSet(ToolConstants.CFG_AUTORESOLVE));
View Full Code Here

Examples of org.apache.cxf.tools.util.ClassCollector

            }
        }
    }

    private boolean addedToClassCollector(String packageName) {
        ClassCollector classCollector = context.get(ClassCollector.class);
        Collection<String> files = classCollector.getGeneratedFileInfo();
        for (String file : files) {
            int dotIndex = file.lastIndexOf(".");
            String sub = dotIndex <= 0 ? "" : file.substring(0, dotIndex - 1);
            if (sub.equals(packageName)) {
                return true;
View Full Code Here

Examples of org.apache.cxf.tools.util.ClassCollector

                                                                 (String)context.get(ToolConstants.CFG_ENCODING),
                                                                 context.get(OutputStreamCreator.class));

            S2JJAXBModel schem2JavaJaxbModel = rawJaxbModelGenCode;

            ClassCollector classCollector = context.get(ClassCollector.class);
            for (JClass cls : schem2JavaJaxbModel.getAllObjectFactories()) {
                classCollector.getTypesPackages().add(cls._package().name());
            }

            JCodeModel jcodeModel = schem2JavaJaxbModel.generateCode(null, null);

            if (!isSuppressCodeGen()) {
View Full Code Here

Examples of org.apache.cxf.tools.util.ClassCollector

        }
        context.put(ToolConstants.CFG_WSDLLOCATION, wsdlLocation);
    }
   
    private void processClientJar(ToolContext context) {
        ClassCollector oldCollector = context.get(ClassCollector.class);
        ClassCollector newCollector = new ClassCollector();
        String oldClassDir = (String)context.get(ToolConstants.CFG_CLASSDIR);
        File tmpDir = FileUtils.createTmpDir();
        context.put(ToolConstants.CFG_CLASSDIR, tmpDir.getAbsolutePath());
       
        newCollector.setTypesClassNames(oldCollector.getTypesClassNames());
        newCollector.setSeiClassNames(oldCollector.getSeiClassNames());
        newCollector.setExceptionClassNames(oldCollector.getExceptionClassNames());
        newCollector.setServiceClassNames(oldCollector.getServiceClassNames());
        context.put(ClassCollector.class, newCollector);
        new ClassUtils().compile(context);

        generateLocalWSDL(context);
       
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.