Package com.thoughtworks.qdox.model

Examples of com.thoughtworks.qdox.model.JavaClass


        if (!shouldGenerate(metadata)) {
            return null;
        }

        JavaMethod method;
        JavaClass retVal = createDynamicJavaClass(getDestinationClassname(metadata), getDestinationPackage(metadata), null, getMetadataProvider());
        retVal.setInterface(true);
        retVal.setModifiers(new String[]{"public"});
        String[] extendz = getExtends(metadata);
        Type[] extendzTypes = new Type[extendz.length];
        for (int j = 0; j < extendz.length; j++) {
            extendzTypes[j] = new Type(extendz[j]);
        }
        retVal.setImplementz(extendzTypes);

        Collection methods = getInterfaceMethods(metadata);
        for (Iterator iter = methods.iterator(); iter.hasNext();) {
            method = new DuplicatedJavaMethod((JavaMethod)iter.next());
            method.setModifiers(new String[0]);
            retVal.addMethod(method);
        }

        return new JavaClass[]{retVal};
    }
View Full Code Here


    public void setFileregex(String fileregex) {
        throw new RuntimeException("Can't set fileregex for plugin. Try setting it in " + EjbConfig.class.getName());
    }

    public boolean shouldGenerate(Object metadata) {
        JavaClass javaClass = (JavaClass) metadata;
        EjbInterfaceTag interfaceTag = (EjbInterfaceTag) javaClass.getTagByName(TagLibrary.EJB_INTERFACE);
        boolean generate = ejbUtils.shouldGenerate(metadata);
        generate = generate && EjbUtils.hasFlag(ejbUtils.getViewType(javaClass), EjbUtils.SERVICE_END_POINT);
        generate = generate && ejbUtils.isStateLess(javaClass);
        generate = generate &&
            ((interfaceTag != null) && Arrays.asList(interfaceTag.getGenerate()).contains("service-endpoint"));
        if (generate) generate = isDestinationDirty(javaClass);
        if (generate && verbose) System.out.println(
                "Generating Service Endpoint for " + javaClass.getName());
        return generate;
    }
View Full Code Here

        if (!shouldGenerate(metadata)) {
            return null;
        }

        JavaMethod method;
        JavaClass retVal = createDynamicJavaClass(getDestinationClassname(metadata), getDestinationPackage(metadata), null, getMetadataProvider());
        retVal.setInterface(true);
        retVal.setModifiers(new String[]{"public"});
        String[] extendz = getExtends(metadata);
        Type[] extendzTypes = new Type[extendz.length];
        for (int j = 0; j < extendz.length; j++) {
            extendzTypes[j] = new Type(extendz[j]);
        }
        retVal.setImplementz(extendzTypes);

        Collection methods = getInterfaceMethods(metadata);
        for (Iterator iter = methods.iterator(); iter.hasNext();) {
            method = new DuplicatedJavaMethod((JavaMethod)iter.next());
            method.setModifiers(new String[0]);
            retVal.addMethod(method);
        }

        return new JavaClass[]{retVal};
    }
View Full Code Here

        return (String[]) extendsLst.toArray(new String[0]);
    }

    public boolean shouldGenerate(Object metadata) {
        JavaClass javaClass = (JavaClass) metadata;
        EjbInterfaceTag interfaceTag = (EjbInterfaceTag) javaClass.getTagByName(TagLibrary.EJB_INTERFACE);
        boolean generate = super.shouldGenerate(metadata);
        generate = generate && ((interfaceTag == null) || Arrays.asList(interfaceTag.getGenerate()).contains("remote"));
        if (generate) generate = isDestinationDirty(javaClass);
        if (generate && verbose) System.out.println(
                "Generating Remote Interface for " + javaClass.getName());
        return generate;
    }
View Full Code Here

        if (!shouldGenerate(metadata)) {
            return null;
        }

        JavaMethod method;
        JavaClass retVal = createDynamicJavaClass(getDestinationClassname(metadata), getDestinationPackage(metadata), null, getMetadataProvider());
        retVal.setInterface(true);
        retVal.setModifiers(new String[]{"public"});
        String[] extendz = getExtends(metadata);
        Type[] extendzTypes = new Type[extendz.length];
        for (int j = 0; j < extendz.length; j++) {
            extendzTypes[j] = new Type(extendz[j]);
        }
        retVal.setImplementz(extendzTypes);

        Collection methods = getInterfaceMethods(metadata);
        for (Iterator iter = methods.iterator(); iter.hasNext();) {
            method = new DuplicatedJavaMethod((JavaMethod)iter.next());
            method.setModifiers(new String[0]);
            retVal.addMethod(method);
        }

        return new JavaClass[]{retVal};
    }
View Full Code Here

        return (String[]) extendsLst.toArray(new String[0]);
    }

    public boolean shouldGenerate(Object metadata) {
        JavaClass javaClass = (JavaClass) metadata;
        EjbInterfaceTag interfaceTag = (EjbInterfaceTag) javaClass.getTagByName(TagLibrary.EJB_INTERFACE);
        boolean generate = super.shouldGenerate(metadata);
        generate = generate && ((interfaceTag == null) || Arrays.asList(interfaceTag.getGenerate()).contains("local"));
        if (generate) generate = isDestinationDirty(javaClass);
        if (generate && verbose) System.out.println(
                "Generating Local Interface for " + javaClass.getName());
        return generate;
    }
View Full Code Here

                if (meta != null) {
                    List newMetadata = new ArrayList();

                    for (Iterator iter = meta.iterator(); iter.hasNext();) {
                        JavaClass javaClass = (JavaClass) iter.next();
                        newMetadata.addAll(Arrays.asList(expandClass(javaClass)));
                    }

                    // We now have to filter the collection to eliminate duplicate value objects

                    /*
                     * A map cointaining a cache of value objects under generation: It will be used for detect when overlapping
                     * value-objects are trying to be generated
                     */
                    final Map vObjsNames = new HashMap();
                    tamperedMetadata = CollectionUtils.select(newMetadata,
                            new Predicate() {
                                public boolean evaluate(Object arg0) {
                                    JavaClass javaClass = (JavaClass) arg0;
                                    boolean retVal = true;

                                    if (vObjPlugin.shouldGenerate(javaClass)) {
                                        // Let's try to detect if overlapping value-objects are being generated
                                        String vObjectType = vObjPlugin.getVirtualType(javaClass).toString();
View Full Code Here

            return super.getMetadata();
        }

        public String getOriginalFileName(Object meta) {
            JavaClass javaClass = (JavaClass) meta;
            String retVal = super.getOriginalFileName(meta);

            if (log.isTraceEnabled()) {
                log.trace("getOriginalFileName() javaClass=" + javaClass.getFullyQualifiedName() + " ==> " + retVal);
            }

            return retVal;
        }
View Full Code Here

            return retVal;
        }

        public String getOriginalPackageName(Object meta) {
            JavaClass javaClass = (JavaClass) meta;
            String retVal;
            retVal = super.getOriginalPackageName(meta);

            if (log.isTraceEnabled()) {
                log.trace("getOriginalPackageName() javaClass=" + javaClass.getFullyQualifiedName() + " ==> " + retVal);
            }

            return retVal;
        }
View Full Code Here

            return null;
        }

        JavaField field;
        JavaMethod method;
        JavaClass retVal = createDynamicJavaClass(getDestinationClassname(metadata), getDestinationPackage(metadata), null, getMetadataProvider());
        retVal.setModifiers(new String[] { "public" });

        PkMetadata metaPk = getMetaPk(metadata);
        String extendz = getExtends(metadata);

        JavaClass parentBuilded[];
        JavaClass parent = metadata.getSuperJavaClass();
        while (parent != null) {
            parentBuilded = buildFor(parent);
            if ((parentBuilded != null) && (parentBuilded[0].getFullyQualifiedName().equals(extendz))) {
                retVal.setSuperClass(parentBuilded[0].asType());
                break;
            }
            parent = parent.getSuperJavaClass();
        }
        String[] implementz = getImplements(metadata);
        Type[] implementzTypes = new Type[implementz.length];
        for (int i = 0; i < implementz.length; i++) {
            implementzTypes[i] = new Type(implementz[i]);
View Full Code Here

TOP

Related Classes of com.thoughtworks.qdox.model.JavaClass

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.