Package org.apache.cxf.tools.util

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


        String namespace = xmlTypeName.getNamespaceURI();
        String type = resolvePartType(part, context, true);
        String userPackage = context.mapPackageName(namespace);

        ClassCollector collector = context.get(ClassCollector.class);
        if (jtype == null) {
            jtype = collector.getTypesFullClassName(parsePackageName(namespace, userPackage), type);
        }

        if (jtype == null) {
            if (!resolvePartType(part).equals(type)) {
                jtype = resolvePartType(part, context, true);
View Full Code Here


            }
        }
    }

    private String mapClassName(String packageName, String name, ToolContext context) {
        ClassCollector collector = context.get(ClassCollector.class);
        int count = 0;
        String checkName = name;
        while (collector.containClientClass(packageName, checkName)) {
            checkName = name + (++count);
        }
        collector.addClientClassName(packageName, checkName,
                                     packageName + "." + checkName);
        return checkName;
    }
View Full Code Here

            }
        }
    }
   
    private String mapClassName(String packageName, String name, ToolContext context) {
        ClassCollector collector = context.get(ClassCollector.class);
        int count = 0;
        String checkName = name;
        while (collector.containServerClass(packageName, checkName)) {
            checkName = name + (++count);
        }
        collector.addServerClassName(packageName, checkName,
                                     packageName + "." + checkName);
        return checkName;
    }
View Full Code Here

    @Test
    public void testAddXmlSeeAlsoAnnotation() throws Exception {
        JavaInterface intf = new JavaInterface();
        assertFalse(intf.getImports().hasNext());

        ClassCollector collector = new ClassCollector();
        collector.getTypesPackages().add(ObjectFactory.class.getPackage().getName());
        intf.annotate(new XmlSeeAlsoAnnotator(collector));

        Iterator iter = intf.getImports();
        assertEquals("javax.xml.bind.annotation.XmlSeeAlso", iter.next());
    
View Full Code Here

                        .equals(simpleName)) {
                        exceptionSuperclassString = exceptionSuperclass;
                    }
                    setAttributes("paraName", ProcessorUtil.mangleNameToVariableName(jf.getName()));
                }
                ClassCollector collector = penv.get(ClassCollector.class);
                for (String pkg : collector.getTypesPackages()) {
                    if (collector.containTypesClass(pkg, simpleName)) {
                        exceptionSuperclassString = exceptionSuperclass;
                    }
                }
                if (expClz.getName().equals(exceptionSuperclassString)) {
                    exceptionSuperclassString = exceptionSuperclass;
View Full Code Here

        setAttributes("implName", name);
        penv.put(ToolConstants.CFG_IMPL_CLASS, name);
        doWrite(IMPL_TEMPLATE, parseOutputName(intf.getPackageName(), name));
    }
    private String mapClassName(String packageName, String name, ToolContext context) {
        ClassCollector collector = context.get(ClassCollector.class);
        int count = 0;
        String checkName = name;
        while (collector.containImplClass(packageName, checkName)) {
            checkName = name + (++count);
        }
        collector.addImplClassName(packageName, checkName,
                                   packageName + "." + checkName);
        return checkName;
    }
View Full Code Here

        }
       
        Map<QName, JavaModel> map = CastUtils.cast((Map)penv.get(WSDLToJavaProcessor.MODEL_MAP));
        for (JavaModel javaModel : map.values()) {
            ClassCollector collector = penv.get(ClassCollector.class);
           
            Map<String, JavaServiceClass> serviceClasses = javaModel.getServiceClasses();
           
            if (serviceClasses.size() == 0) {
                ServiceInfo serviceInfo = (ServiceInfo)env.get(ServiceInfo.class);
                String wsdl = serviceInfo.getDescription().getBaseURI();
                Message msg = new Message("CAN_NOT_GEN_SERVICE", LOG, wsdl);
                if (penv.isVerbose()) {
                    System.out.println(msg.toString());
                }
                return;
            }
           
            for (JavaServiceClass js : serviceClasses.values()) {
                if (js.getHandlerChains() != null) {
                    HandlerConfigGenerator handlerGen = new HandlerConfigGenerator();
                    handlerGen.setJavaInterface(js);
                    handlerGen.generate(getEnvironment());
   
                    JAnnotation annot = handlerGen.getHandlerAnnotation();
                                  
                    if (handlerGen.getHandlerAnnotation() != null) {
                        boolean existHandlerAnno = false;
                        for (JAnnotation jann : js.getAnnotations()) {
                            if (jann.getType() == HandlerChain.class) {
                                existHandlerAnno = true;
                            }
                        }
                        if (!existHandlerAnno) {
                            js.addAnnotation(annot);
                            js.addImport("javax.jws.HandlerChain");
                        }
                    }
                   
                }
   
                for (JavaPort port : js.getPorts()) {
                    if (!port.getPackageName().equals(js.getPackageName())
                        && !port.getInterfaceClass().equals(js.getName())) {
                        js.addImport(port.getFullClassName());
                    }
                }
   
                String url = (String)env.get(ToolConstants.CFG_WSDLURL);
                String location = (String)env.get(ToolConstants.CFG_WSDLLOCATION);
                if (location == null) {
                    location = url;
                }
               
                String serviceSuperclass = "Service";
                for (String s : collector.getGeneratedFileInfo()) {
                    if (s.equals(js.getPackageName() + ".Service")) {
                        serviceSuperclass = "javax.xml.ws.Service";
                    }
                }
                clearAttributes();
View Full Code Here

    }
    private String mapName(String packageName, String name) {
        while (isNameCollision(packageName, name)) {
            name = name + "_Service";
        }
        ClassCollector collector = context.get(ClassCollector.class);
        if (collector.isReserved(packageName, name)) {
            int count = 0;
            String checkName = name;
            while (collector.isReserved(packageName, checkName)) {
                checkName = name + (++count);
            }
            name = checkName;
        }
        return name;
View Full Code Here

    private boolean isNameCollision(String packageName, String className) {
        if (context.optionSet(ToolConstants.CFG_GEN_OVERWRITE)) {
            return false;
        }
        ClassCollector collector = context.get(ClassCollector.class);
        return collector.containTypesClass(packageName, className)
               || collector.containSeiClass(packageName, className)
               || collector.containExceptionClass(packageName, className);
    }
View Full Code Here

                packageName = jaxwsBinding.getPackage();
            }
            sclz.setPackageName(packageName);
            name = mapName(packageName, name);
            sclz.setName(name);
            ClassCollector collector = context.get(ClassCollector.class);
            String checkName = name;
            int count = 0;
            while (collector.containServiceClass(packageName, checkName)) {
                checkName = name + (++count);
            }       
            name = checkName;
            sclz.setName(name);
            collector.addServiceClassName(packageName, name, packageName + "." + name);
   
            Element handler = (Element)context.get(ToolConstants.HANDLER_CHAIN);
            sclz.setHandlerChains(handler);
        }
View Full Code Here

TOP

Related Classes of org.apache.cxf.tools.util.ClassCollector

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.