Package org.xdoclet.plugin.ejb.qtags

Examples of org.xdoclet.plugin.ejb.qtags.EjbPkTag


            retVal = (PkMetadata) pkHierarchyCache.get(javaClass);
        } else {
            List hierarchyLst = getHierarchy(javaClass);
            Collections.reverse(hierarchyLst); // Top down scan
            PkClass current = new PkClass();
            EjbPkTag pkTag;

            for (Iterator iter = hierarchyLst.iterator(); iter.hasNext();) {
                JavaClass clazz = (JavaClass) iter.next();
                pkTag = (EjbPkTag) clazz.getTagByName(TagLibrary.EJB_PK);

                if (pkTag != null) {
                    String pkExtends = pkTag.getExtends();

                    if (pkExtends != null) {
                        // We need to test if so far we haven't collected any properties to allow to set top class
                        // If we don't check this, we could be loosing primary key's properties
                        // NOTE: xdoclet1 allowed this, although it generates non compiling class
                        if (current.isEmpty() && current.getParent() == null) {
                            current.setType(new EjbJavaType(pkExtends));
                            current = new PkClass(current);
                        } else {
                            throw ejbUtils.getErrorWithTagLocation(pkTag,
                                "Can't set \"extends\" property without loosing current primary key properties: " +
                                current);
                        }
                    }

                    String[] implementz = pkTag.getImplements();

                    if (implementz != null) {
                        current.addImplements(implementz);
                    }
                }

                current.addProperties(getPkProperties(clazz));

                if (!current.isSimpleProperty() && !current.isEmpty() && ((pkTag == null) || pkTag.isGenerate())) {
                    current.setType(getVirtualType(clazz));
                    current = new PkClass(current);
                }
            }
View Full Code Here


            }
        }
    }

    protected String getLocalyDefinedFullClassName(JavaClass clazz) {
        EjbPkTag pkTag = (EjbPkTag) clazz.getTagByName(TagLibrary.EJB_PK);
        return (pkTag != null) ? pkTag.getClass_() : null;
    }
View Full Code Here

        EjbPkTag pkTag = (EjbPkTag) clazz.getTagByName(TagLibrary.EJB_PK);
        return (pkTag != null) ? pkTag.getClass_() : null;
    }

    protected String getPatternBasedUnqualifiedName(JavaClass clazz) {
        EjbPkTag pkTag = (EjbPkTag) clazz.getTagByName(TagLibrary.EJB_PK);
        return (pkTag != null && pkTag.getPattern() != null) ? ejbUtils.expandPattern(pkTag.getPattern(), clazz) : null;
    }
View Full Code Here

        EjbPkTag pkTag = (EjbPkTag) clazz.getTagByName(TagLibrary.EJB_PK);
        return (pkTag != null && pkTag.getPattern() != null) ? ejbUtils.expandPattern(pkTag.getPattern(), clazz) : null;
    }

    protected String getLocalyDefinedPackageName(JavaClass clazz) {
        EjbPkTag pkTag = (EjbPkTag) clazz.getTagByName(TagLibrary.EJB_PK);
        return (pkTag != null) ? pkTag.getPackage() : null;
    }
View Full Code Here

                    retLst.addAll(MethodPermission.unroll(permType, getFinderMethodBySignature(finderTag.getSignature()),
                            finderTag.getRoleNames()));
                }
            }

            EjbPkTag pkTag = (EjbPkTag) javaClass.getTagByName(TagLibrary.EJB_PK);

            if (pkTag != null) {
                // -------------------------------------------------------
                // We are generating an method permission if there is at least
                // one role or unchecked is true
                // NOTE: unchecked is only valid for EJB 2.0+
                boolean canContinue = (pkTag.getRoleNames() != null && pkTag.getRoleNames().length > 0);

                if (version.greaterOrEquals(EjbVersion.EJB_2_0)) {
                    canContinue |= pkTag.isUnchecked();
                }

                // We'll not continue this if we do not have to check a security method for
                // "findByPrimaryKey"
                if (canContinue) {
                    int permType = getViewType(javaClass) & (REMOTE_HOME | LOCAL_HOME);

                    // -------------------------------------------------------
                    // Let's "bitwise and" to get only the specied masks
                    // that are compatible with the bean
                    // HUMM: Is this valid ?
                    if (pkTag.getMethodIntf() != null) {
                        permType &= getInterfaceType(pkTag.getMethodIntf());
                    }

                    if (permType == 0) {
                        throw getErrorWithTagLocation(pkTag,
                            "Couldn't resolve a compatible interface type reference. Maybe bean/view-type/version doesn't support it!");
                    }

                    // Lets expand by permission for interface type
                    // Method signature should maybe be unrolled by permType, but it's not really relevant
                    // the return type, soo..
                    retLst.addAll(MethodPermission.unroll(permType,
                            getFinderMethodBySignature("void findByPrimaryKey()"), pkTag.getRoleNames()));
                }
            }
        }

        return retLst;
View Full Code Here

TOP

Related Classes of org.xdoclet.plugin.ejb.qtags.EjbPkTag

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.