Package xdoclet

Examples of xdoclet.SubTask


            }
        }

        // now try to guess because it wasn't specifically specified whether
        // it should be generated or not
        SubTask subtask = getSubTaskClassForClass(clazz);

        if (clazz.isAbstract() == true) {
            if (hasANonDocletGeneratedSubClass(clazz) == true) {
                return false;
            }

            // an abstract mdb/etc?
            if (subtask == null) {
                return false;
            }

            // if <entitycmp/bmp/session/> is on, then do the best to guess correctly
            if (DocletContext.getInstance().isSubTaskDefined(subtask.getSubTaskName()) == true) {
                //none of the above guesses worked, assume it's concrete!
                return true;
            }
            else {
                // if <entitycmp/bmp/session/> is off, so if class is abstract then the bean is abstract except for entity cmp beans in ejb2 cmp2
                if (CmpTagsHandler.isEntityCmp(clazz) && CmpTagsHandler.isUsingCmp2Impl(clazz)) {
                    return true;
                }

                return false;
            }
        }
        else {
            // if <entitycmp/bmp/> is on, then it's an error or not specify the class abstract, except for <session/> that non-abstract is also legal
            if (subtask != null && DocletContext.getInstance().isSubTaskDefined(subtask.getSubTaskName())) {
                if (subtask.getSubTaskName().equals(DocletTask.getSubTaskName(SessionSubTask.class))) {
                    return true;
                }

                String currentClassName = clazz.getQualifiedName();
View Full Code Here


        }
    }

    public static NetuiSubTask get()
    {
        SubTask subtask = DocletContext.getInstance().getActiveSubTask();
        assert subtask instanceof NetuiSubTask : subtask.getClass().getName();
        return ( NetuiSubTask ) subtask;
    }
View Full Code Here

    {
        Log log = LogUtil.getLog(ConfigTagsHandler.class, "getConfigParameter");

        paramName = Introspector.decapitalize(paramName);

        SubTask subtask = getDocletContext().getActiveSubTask();

        if (log.isDebugEnabled()) {
            log.debug("subtask=" + subtask.getClass());
            log.debug("currentConfigParamIndex=" + currentConfigParamIndex);
            log.debug("currentConfigParam=" + currentConfigParam);
            log.debug("paramName=" + paramName);
        }

        String configName = paramName;
        Object configValue = null;
        int index = 0;

        index = configName.indexOf('.');

        if (index != -1) {
            // so it's not in global namespace or activesubtask.param

            int index2 = paramName.indexOf('.', index + 1);

            // has one dot. subtaskname.param or activesubtask.element.param format
            if (configValue == null && index2 == -1) {
                // 1. is in subtaskname.param format
                configName = paramName;
                configValue = getDocletContext().getConfigParam(configName);

                // 2. is in activesubtask.element.param format
                if (configValue == null) {
                    String elemname = paramName.substring(0, index);
                    String paramname = paramName.substring(index + 1);

                    configName = subtask.getSubTaskName() + '.' + elemname;
                    configValue = getDocletContext().getConfigParam(configName);

                    // ok we have activesubtask.element value, use reflection to get
                    // the param inside the element
                    if (configValue != null) {
                        // we're in a forAllConfigParams loop for a ArrayList-based config parameter
                        if (currentConfigParamIndex != -1) {
                            log.debug("In a forAllConfigParams loop for an ArrayList-based config parameter.");
                            // param_value = element at currentConfigParamIndex index of the ArrayList
                            configValue = ((java.util.ArrayList) configValue).get(currentConfigParamIndex);
                        }

                        Method getterMethod = ConfigParamIntrospector.findGetterMethod(configValue, paramname);

                        if (getterMethod == null) {
                            configValue = null;
                        }

                        try {
                            configValue = getterMethod.invoke(configValue, null);
                        }
                        catch (Exception e) {
                            log.debug("not found", e);
                        }
                    }
                }
            }
            else {
                // has more than one dot. subtaskname.elem.param format

                // lookup subtaskname.elem
                int lastDotIndex = paramName.lastIndexOf('.');
                String paramname = paramName.substring(lastDotIndex + 1);

                configName = paramName.substring(0, lastDotIndex);
                configValue = getDocletContext().getConfigParam(configName);

                if (configValue != null) {
                    // we're in a forAllConfigParams loop for a ArrayList-based config parameter
                    if (currentConfigParamIndex != -1) {
                        log.debug("In a forAllConfigParams loop for an ArrayList-based config parameter.");

                        // param_value = element at currentConfigParamIndex index of the ArrayList
                        configValue = ((java.util.ArrayList) configValue).get(currentConfigParamIndex);
                    }

                    Method getterMethod = ConfigParamIntrospector.findGetterMethod(configValue, paramname);

                    if (getterMethod == null) {
                        configValue = null;
                    }

                    try {
                        configValue = getterMethod.invoke(configValue, null);
                    }
                    catch (Exception e) {
                        log.debug("not found", e);
                    }
                }
            }
        }
        else {
            // is either in global namespace or activesubtask.param

            // 1. search active subtask
            configName = subtask.getSubTaskName() + '.' + paramName;
            configValue = getDocletContext().getConfigParam(configName);

            // 2. search DocletTask global namespace
            if (configValue == null) {
                configName = paramName;
View Full Code Here

TOP

Related Classes of xdoclet.SubTask

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.