Package xjavadoc

Examples of xjavadoc.XClass


     * @doc.param    name="prefixWithPackage" optional="true" values="true,false" description="Whether to prefix the
     *      filename with the package hierarchy."
     */
    public String wsdlFilename(Properties props)
    {
        XClass clazz = getCurrentClass();
        String wsdlPattern = getWsdlFilePattern();

        String packageName = null;
        String file = null;

        if (isWsdlPerClass()) {

            boolean prefixWithPackage = false;
            String hasPrefix = props.getProperty("prefixWithPackage");

            if (hasPrefix != null && !"".equals(hasPrefix)) {
                prefixWithPackage = Boolean.getBoolean(hasPrefix);
            }

            if (prefixWithPackage) {
                packageName = PackageTagsHandler.packageNameAsPathWithoutSubstitutionFor(clazz.getContainingPackage());
            }

            String serviceName = getCurrentClass().getDoc().getTagAttributeValue(WseeTagsHandler.PORT_COMPONENT, "name");

            file = new File(packageName, serviceName).toString();
        }

        // assume our wsdl files will start in WEB-INF/ unless the current class has an ejb.bean tag
        String prefix = "WEB-INF/";

        if (clazz != null && clazz.getDoc().hasTag("ejb.bean")) {
            prefix = "META-INF/";
        }
        return prefix + MessageFormat.format(wsdlPattern, new Object[]{file});
    }
View Full Code Here


     * @doc.param    name="prefixWithPackage" optional="true" values="true,false" description="Whether to prefix the
     *      filename with the package hierarchy."
     */
    public String jaxrpcMappingFilename(Properties props)
    {
        XClass clazz = getCurrentClass();
        String jaxrpcPattern = getJaxrpcFilePattern();

        String packageName = null;
        String file = null;

        if (isJaxrpcPerClass()) {

            boolean prefixWithPackage = true;
            String hasPrefix = props.getProperty("prefixWithPackage");

            if (hasPrefix != null && !"".equals(hasPrefix)) {
                prefixWithPackage = Boolean.getBoolean(hasPrefix);
            }

            if (prefixWithPackage) {
                packageName = PackageTagsHandler.packageNameAsPathWithoutSubstitutionFor(clazz.getContainingPackage());
            }

            file = new File(packageName, getCurrentClass().getName()).toString();
        }


        // assume our wsdl files will start in WEB-INF/ unless the current class has an ejb.bean tag
        String prefix = "WEB-INF/";

        if (clazz != null && clazz.getDoc().hasTag("ejb.bean")) {
            prefix = "META-INF/";
        }
        return prefix + MessageFormat.format(jaxrpcPattern, new Object[]{file});
    }
View Full Code Here

        // all fields carrying @struts:form-field form-name="<bla>" where <bla> is current
        // form name, or all persistent fields if  include-all="true" is set
        // pk fields are included implicitly, unless include-pk="false" is specified.

        Log log = LogUtil.getLog(StrutsFormTagsHandler.class, "forAllFormFields");
        XClass currentClass = getCurrentClass();
        Map foundFields = new HashMap();

        if (log.isDebugEnabled()) {
            log.debug("BEGIN-----------------------------------------");
        }

        do {
            pushCurrentClass(currentClass);

            if (log.isDebugEnabled()) {
                log.debug("-----CLASS=" + getCurrentClass().getName() + "----------------");
            }

            Collection methods = getCurrentClass().getMethods();

            for (Iterator j = methods.iterator(); j.hasNext(); ) {
                setCurrentMethod((XMethod)j.next());
                // We are interested in persistent fields and fields marked as a form-field.
                if (MethodTagsHandler.isGetter(getCurrentMethod().getName()) &&
                    !foundFields.containsKey(getCurrentMethod().getName()) &&
                    useMethodInForm(getCurrentMethod())) {
                    if (useMethodInForm(getCurrentMethod())) {
                        if (log.isDebugEnabled()) {
                            log.debug("METHOD(I=" + getCurrentMethod().getName());
                        }
                        // Store that we found this field so we don't add it twice
                        foundFields.put(getCurrentMethod().getName(), getCurrentMethod().getName());

                        generate(template);
                    }
                }
            }

            // Add super class info
            if (getCurrentClass().getSuperclass().getQualifiedName().equals("java.lang.Object")) {
                popCurrentClass();
                break;
            }

            popCurrentClass();
            currentClass = currentClass.getSuperclass();
        } while (true);

        if (log.isDebugEnabled()) {
            log.debug("END-------------------------------------------");
        }
View Full Code Here

    public void forAllForms(String template, Properties attributes) throws XDocletException
    {
        Collection classes = getAllClasses();

        for (Iterator i = classes.iterator(); i.hasNext(); ) {
            XClass currentClass = (XClass) i.next();

            setCurrentClass(currentClass);
            if (DocletSupport.isDocletGenerated(getCurrentClass()) || (getCurrentClass().isAbstract())) {
                continue;
            }
            if (currentClass.getDoc().hasTag("struts.dynaform")) {
                XTag tag = currentClass.getDoc().getTag("struts.dynaform");
                String validateAttr = tag.getAttributeValue("validate");

                if ((validateAttr != null) && (validateAttr.equals("true"))) {
                    generate(template);
                }
View Full Code Here

     * @throws XDocletException
     * @doc.tag                  type="block"
     */
    public void forAllFields(String template, Properties attributes) throws XDocletException
    {
        XClass clazz = getCurrentClass();
        Map setters = getFields(clazz);

        for (Iterator iterator = setters.keySet().iterator(); iterator.hasNext(); ) {
            curFieldName = (String) iterator.next();

View Full Code Here

            if (refed_ejb_name == null) {
                throw new XDocletException("No ejb-name attribute found in ejb-ref specified in bean " + getCurrentClass());
            }

            XClass refed_clazz = findEjb(refed_ejb_name);
            String ejb_type = EjbTagsHandler.isLocalEjb(refed_clazz) ? "local" : "remote";

            ejbRefJndiName = HomeTagsHandler.getJndiNameOfTypeFor(ejb_type, refed_clazz);

        }
View Full Code Here

    protected XClass findEjb(String ejbName) throws XDocletException
    {
        Collection classes = getXJavaDoc().getSourceClasses();

        for (Iterator i = classes.iterator(); i.hasNext(); ) {
            XClass clazz = (XClass) i.next();

            if (EjbTagsHandler.isEjb(clazz) && ejbName.equals(EjbTagsHandler.getEjbNameFor(clazz))) {
                return clazz;
            }
        }
View Full Code Here

    public void forAllForms(String template, Properties attributes) throws XDocletException
    {
        Collection classes = getAllClasses();

        for (Iterator i = classes.iterator(); i.hasNext(); ) {
            XClass currentClass = (XClass) i.next();

            setCurrentClass(currentClass);
            if (DocletSupport.isDocletGenerated(getCurrentClass()) || (getCurrentClass().isAbstract())) {
                continue;
            }
View Full Code Here

     * @throws XDocletException
     * @doc.tag                  type="block"
     */
    public void forAllFields(String template, Properties attributes) throws XDocletException
    {
        XClass clazz = getCurrentClass();
        Map setters = getFields(clazz);

        for (Iterator iterator = setters.keySet().iterator(); iterator.hasNext(); ) {
            curFieldName = (String) iterator.next();

View Full Code Here

    {
        Log log = LogUtil.getLog(EjbRefTagsHandler.class, "forAllEjbRefs");

        boolean superclasses = TypeConversionUtil.stringToBoolean(attributes.getProperty("superclasses"), true);

        XClass oldCurClass = getCurrentClass();

        XClass currentClass = getCurrentClass();
        HashMap already = new HashMap();

        do {
            Collection tags = currentClass.getDoc().getTags("ejb.ejb-ref");

            for (Iterator i = tags.iterator(); i.hasNext(); ) {
                XTag tag = (XTag) i.next();

                setCurrentClassTag(tag);

                storeReferringClassId();

                String ejbNameAttribute = tag.getAttributeValue("ejb-name");

                if (ejbNameAttribute == null || ejbNameAttribute.length() < 1) {
                    mandatoryParamNotFound(tag.getDoc(), "ejb-name", "ejb.ejb-ref");
                }

                XClass refedEJBClass = findEjb(ejbNameAttribute);

                setCurrentClass(refedEJBClass);

                String refName = EjbTagsHandler.ejbRefName();
View Full Code Here

TOP

Related Classes of xjavadoc.XClass

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.