⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmsmodule.java

📁 cms是开源的框架
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
    /**
     * Two instances of a module are considered equal if their name is equal.<p>
     *
     * @param obj the object to compare
     * 
     * @return true if the objects are equal
     *  
     * @see java.lang.Object#equals(java.lang.Object)
     * @see #isIdentical(CmsModule)
     */
    public boolean equals(Object obj) {

        if (obj == this) {
            return true;
        }
        if (obj instanceof CmsModule) {
            return ((CmsModule)obj).m_name.equals(m_name);
        }
        return false;
    }

    /**
     * Returns the class name of this modules (optional) action class.<p>
     *
     * If this module does not use an action class,
     * <code>null</code> is returned.<p>
     *
     * @return the class name of this modules (optional) action class
     */
    public String getActionClass() {

        return m_actionClass;
    }

    /**
     * Returns the module action instance of this module, or <code>null</code>
     * if no module action instance is configured.<p>
     * 
     * @return the module action instance of this module
     */
    public I_CmsModuleAction getActionInstance() {

        return m_actionInstance;
    }

    /**
     * Returns the email of the module author.<p>
     *
     * @return the email of the module author
     */
    public String getAuthorEmail() {

        return m_authorEmail;
    }

    /**
     * Returns the name of the author of this module.<p>
     *
     * @return the name of the author of this module
     */
    public String getAuthorName() {

        return m_authorName;
    }

    /**
     * Returns the date this module was created by the author.<p>
     *
     * @return the date this module was created by the author
     */
    public long getDateCreated() {

        return m_dateCreated;
    }

    /**
     * Returns the date this module was uploaded.<p>
     *
     * @return the date this module was uploaded
     */
    public long getDateInstalled() {

        return m_dateInstalled;
    }

    /**
     * Returns the list of dependencies of this module.<p>
     *
     * @return the list of dependencies of this module
     */
    public List getDependencies() {

        return m_dependencies;
    }

    /**
     * Returns the description of this module.<p>
     *
     * @return the description of this module
     */
    public String getDescription() {

        return m_description;
    }

    /**
     * Returns the list of explorer resource types that belong to this module.<p>
     *
     * @return the list of explorer resource types that belong to this module
     */
    public List getExplorerTypes() {

        return m_explorerTypeSettings;
    }

    /**
     * Returns the list of export point added by this module.<p>
     *
     * @return the list of export point added by this module
     */
    public List getExportPoints() {

        return m_exportPoints;
    }

    /**
     * Returns the group name of this module.<p>
     *
     * @return the group name of this module
     */
    public String getGroup() {

        return m_group;
    }

    /**
     * Returns the name of this module.<p>
     * 
     * The module name must be a valid java package name.<p>
     *
     * @return the name of this module
     */
    public String getName() {

        return m_name;
    }

    /**
     * Returns the "nice" display name of this module.<p>
     *
     * @return the "nice" display name of this module
     */
    public String getNiceName() {

        return m_niceName;
    }

    /**
     * Returns a parameter value from the module parameters.<p>
     * 
     * @param key the parameter to return the value for
     * @return the parameter value from the module parameters
     */
    public String getParameter(String key) {

        return (String)m_parameters.get(key);
    }

    /**
     * Returns a parameter value from the module parameters,
     * or a given default value in case the parameter is not set.<p>
     * 
     * @param key the parameter to return the value for
     * @param defaultValue the default value in case there is no value stored for this key
     * @return the parameter value from the module parameters
     */
    public String getParameter(String key, String defaultValue) {

        String value = (String)m_parameters.get(key);
        return (value != null) ? value : defaultValue;
    }

    /**
     * Returns the configured (immutable) module parameters.<p>
     * 
     * @return the configured (immutable) module parameters
     */
    public SortedMap getParameters() {

        return m_parameters;
    }

    /**
     * Returns the list of VFS resources that belong to this module.<p>
     *
     * @return the list of VFS resources that belong to this module
     */
    public List getResources() {

        return m_resources;
    }

    /**
     * Returns the list of additional resource types that belong to this module.<p>
     *
     * @return the list of additional resource types that belong to this module
     */
    public List getResourceTypes() {

        return m_resourceTypes;
    }

    /**
     * Returns the name of the user who uploaded this module.<p>
     *
     * @return the name of the user who uploaded this module
     */
    public String getUserInstalled() {

        return m_userInstalled;
    }

    /**
     * Returns the version of this module.<p>
     *
     * @return the version of this module
     */
    public CmsModuleVersion getVersion() {

        return m_version;
    }

    /**
     * @see java.lang.Object#hashCode()
     */
    public int hashCode() {

        return m_name.hashCode();
    }

    /**
     * Returns the createClassesFolder flag.<p>
     *
     * @return the createClassesFolder flag
     */
    public boolean isCreateClassesFolder() {

        return m_createClassesFolder;
    }

    /**
     * Returns the createElementsFolder flag.<p>
     *
     * @return the createElementsFolder flag
     */
    public boolean isCreateElementsFolder() {

        return m_createElementsFolder;
    }

    /**
     * Returns the createLibFolder flag.<p>
     *
     * @return the createLibFolder flag
     */
    public boolean isCreateLibFolder() {

        return m_createLibFolder;
    }

    /**
     * Returns the createModuleFolder flag.<p>
     *
     * @return the createModuleFolder flag
     */
    public boolean isCreateModuleFolder() {

        return m_createModuleFolder;
    }

    /**
     * Returns the createResourcesFolder flag.<p>
     *
     * @return the createResourcesFolder flag
     */
    public boolean isCreateResourcesFolder() {

        return m_createResourcesFolder;
    }

    /**
     * Returns the createTemplateFolder flag.<p>
     *
     * @return the createTemplateFolder flag
     */
    public boolean isCreateTemplateFolder() {

        return m_createTemplateFolder;
    }

    /**
     * Checks if this module is identical with another module.<p>
     * 
     * Modules A, B are <b>identical</b> if <i>all</i> values of A are equal to B.
     * The values from {@link #getUserInstalled()} and {@link #getDateInstalled()} 
     * are ignored for this test.<p>
     *  
     * Modules A, B are <b>equal</b> if just the name of A is equal to the name of B.<p>
     * 
     * @param other the module to compare with
     * 
     * @return if the modules are identical
     * 
     * @see #equals(Object)
     */
    public boolean isIdentical(CmsModule other) {

        // some code redundancy here but this is easier to debug 
        if (!isEqual(m_name, other.m_name)) {
            return false;
        }
        if (!isEqual(m_niceName, other.m_niceName)) {
            return false;
        }
        if (!isEqual(m_version, other.m_version)) {
            return false;
        }
        if (!isEqual(m_actionClass, other.m_actionClass)) {
            return false;
        }
        if (!isEqual(m_description, other.m_description)) {
            return false;
        }
        if (!isEqual(m_authorName, other.m_authorName)) {
            return false;
        }
        if (!isEqual(m_authorEmail, other.m_authorEmail)) {
            return false;
        }
        if (m_dateCreated != other.m_dateCreated) {
            return false;
        }
        return true;
    }

    /**
     * Sets the class name of this modules (optional) action class.<p>
     * 
     * Providing <code>null</code> as a value indicates that this module does not use an action class.<p>
     * 
     * <i>Please note:</i>It's not possible to set the action class name once the module
     * configuration has been frozen.<p> 
     * 
     * @param value the class name of this modules (optional) action class to set
     */
    public void setActionClass(String value) {

        checkFrozen();
        if (CmsStringUtil.isEmpty(value)) {
            m_actionClass = null;
        } else {
            if (!CmsStringUtil.isValidJavaClassName(value)) {
                throw new CmsIllegalArgumentException(Messages.get().container(
                    Messages.ERR_MODULE_ACTION_CLASS_2,
                    value,
                    getName()));
            }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -