Package com.thoughtworks.qdox.model

Examples of com.thoughtworks.qdox.model.DocletTag


     */
    public String getReturnJavaDoc() {
        if (isMethod()) {
            JavaMethod jm = (JavaMethod)getItemSource();
            if (jm != null) {
                DocletTag tag = jm.getTagByName("return");
                if (tag != null) {
                    return docText(tag.getValue());
                }
            }
            return null;
        } else {
            throw new IllegalStateException("Internal error: not a method");
View Full Code Here


            JavaMethod jm = (JavaMethod)getItemSource();
            if (jm != null) {
                String name = jm.getParameters()[index].getName();
                DocletTag[] tags = jm.getTagsByName("param");
                for (int i = 0; i < tags.length; i++) {
                    DocletTag tag = tags[i];
                    String[] parms = tag.getParameters();
                    if (parms != null && parms.length > 0 && name.equals(parms[0])) {
                        String text = tag.getValue().trim();
                        if (text.startsWith(name)) {
                            text = text.substring(name.length()).trim();
                        }
                        return docText(text);
                    }
View Full Code Here

            JavaMethod jm = (JavaMethod)getItemSource();
            if (jm != null) {
                String name = getExceptions()[index];
                DocletTag[] tags = jm.getTagsByName("throws");
                for (int i = 0; i < tags.length; i++) {
                    DocletTag tag = tags[i];
                    String[] parms = tag.getParameters();
                    if (parms != null && parms.length > 0 && name.equals(parms[0])) {
                        return docText(tag.getValue());
                    }
                }
            }
            return null;
        } else {
View Full Code Here

                DocletTag[] tags = newClass.getTags();
                List newTags = new ArrayList();
                int tagIdx = 0;

                for (int j = 0; j < tags.length; j++) {
                    DocletTag tag = tags[j];

                    if (TagLibrary.EJB_VALUE_OBJECT.equals(tag.getName())) {
                        if (tagIdx++ == i) {
                            newTags.add(tag);
                        }
                    } else {
                        newTags.add(tag);
View Full Code Here

     * @return The metadata bits
     */
    public int getMethodMetadata(JavaClass javaClass, JavaMethod method) {
        int retVal = getMethodType(method);
        EjbBeanTag beanTag = (EjbBeanTag) javaClass.getTagByName(TagLibrary.EJB_BEAN);
        DocletTag tag;

        if ((tag = method.getTagByName(TagLibrary.EJB_PERSISTENCE_FIELD)) != null) {
            if ((method.isPropertyAccessor() /*|| method.isPropertyMutator()*/)) {
                retVal |= METADATA_METHOD_PERSISTENCE_FIELD;
            } else {
View Full Code Here

        Type wrapperType = (Type) wrappers.get(type.toString());
        return wrapperType != null ? wrapperType : type;
    }

    public String refType(TagReference reference) {
        DocletTag tag = reference.getTag();
        String refType = null;
        String paramName = null;

        if (tag instanceof EjbEjbServiceRefTag) {
            refType = ((EjbEjbServiceRefTag) tag).getInterface();
            paramName = "interface";
        } else if (tag instanceof EjbResourceRefTag) {
            refType = ((EjbResourceRefTag) tag).getResType();
            paramName = "res-type";
        } else if (tag instanceof EjbResourceEnvRefTag) {
            refType = ((EjbResourceEnvRefTag) tag).getType();
            paramName = "type";
        } else {
            throw getErrorWithTagLocation(tag, "Unexpected tag type");
        }

        if (reference.getClazz() != null) {
            // Class level tag
            if (refType == null) {
                throw getErrorWithTagLocation(tag, "'" + paramName + "' is mandatory for class level tag");
            }
        } else if (reference.getField() != null) {
            // Field level tag
            refType = wrapType(reference.getField().getType()).toString();
        } else if (reference.getMethod() != null) {
            // Method level tag
            if (reference.getMethod().getReturns().isVoid()) {
                throw getErrorWithTagLocation(tag,
                    "Cannot set @" + tag.getName() + " on a method with a void return type");
            }

            refType = wrapType(reference.getMethod().getReturns()).toString();
        }
View Full Code Here

        retBuf.append(")");
        return retBuf.toString();
    }

    public String refName(TagReference reference) {
        DocletTag tag = reference.getTag();
        String refName = null;
        String paramName = null;

        if (tag instanceof EjbEjbServiceRefTag) {
            refName = ((EjbEjbServiceRefTag) tag).getName_();
View Full Code Here

    public String ejbRefName(TagReference reference) {
        return ejbRefName(reference, null);
    }

    public String ejbRefName(TagReference reference, JavaClass refClass) {
        DocletTag tag = reference.getTag();
        String ejbRefName = null;
        String viewType = null;
        String paramName = null;

        if (tag instanceof EjbEjbRefTag) {
View Full Code Here

    private List children;

    static ClassDescriptor fromClass(Log log, JavaClass javaClass) {

        DocletTag tag = javaClass.getTagByName(TAG_CLASS_DESCRIPTOR);
        if (tag == null) {
            return null;
        }

        ClassDescriptor cd = new ClassDescriptor(log, tag);
        cd.className = javaClass.getFullyQualifiedName();
        cd.isInterface = javaClass.isInterface();
        cd.isAbstract = !cd.isInterface && javaClass.isAbstract();

        cd.extend = tag.getNamedParameter(EXTEND);
        if (cd.extend == null) {
            if (javaClass.getSuperJavaClass() != null) {
                cd.extend = javaClass.getSuperJavaClass().getFullyQualifiedName();

                // do not declare extending Object :-)
                if (Object.class.getName().equals(cd.extend)) {
                    cd.extend = null;
                }
            }
        } else if (cd.extend.length() == 0) {
            // explicit empty extend value prevents extend attribute from being
            // set
            cd.extend = null;
        }

        String interfaceList = tag.getNamedParameter(INTERFACES);
        if (interfaceList == null) {
            if (javaClass.getImplementedInterfaces() != null) {
                JavaClass[] implInterfaces = javaClass.getImplementedInterfaces();
                cd.interfaces = new HashSet();
                for (int i = 0; i < implInterfaces.length; i++) {
                    cd.interfaces.add(implInterfaces[i].getFullyQualifiedName());
                }
            }
        } else if (interfaceList.length() == 0) {
            // empty interface list prevents creation of interface element
            cd.interfaces = null;
        } else {
            // split list and create set for interface elements
            StringTokenizer tokener = new StringTokenizer(interfaceList, ",");
            cd.interfaces = new HashSet();
            while (tokener.hasMoreTokens()) {
                String iface = tokener.nextToken().trim();
                if (iface.length() > 0) {
                    cd.interfaces.add(iface);
                }
            }
        }

        cd.jcrType = tag.getNamedParameter(JCR_TYPE);
        cd.jcrSuperTypes = tag.getNamedParameter(JCR_SUPER_TYPES);
        cd.jcrMixinTypes = tag.getNamedParameter(JCR_MIXIN_TYPES);

        // only reset default if explicitly stated
        if (tag.getNamedParameter(DISCRIMINATOR) != null) {
            cd.discriminator = Boolean.valueOf(
                tag.getNamedParameter(DISCRIMINATOR)).booleanValue();
        }

        return cd;
    }
View Full Code Here

        accumulatePropertiesRecursive(clazz, null, true, ALLOWED_IN_PROPERTIES_TAGS, retval);
        CollectionUtils.filter(retval,
            new Predicate() {
                public boolean evaluate(Object object) {
                    HibernateProperty prop = (HibernateProperty) object;
                    DocletTag tag = getTagByNameList(prop.getEntity(), ALLOWED_IN_PROPERTIES_TAGS);

                    return tag != null && propertiesName.equalsIgnoreCase(tag.getNamedParameter("properties-name"));

                    }
            });
        return retval;
    }
View Full Code Here

TOP

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

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.