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

📄 defaultpropertydefinition.java

📁 这是linux下ssl vpn的实现程序
💻 JAVA
字号:
/*
 *  SSL-Explorer
 *
 *  Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version 2 of
 *  the License, or (at your option) any later version.
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public
 *  License along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
			
package com.sslexplorer.boot;

import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;


/**
 * Default implementation of a {@link com.sslexplorer.boot.PropertyDefinition}.
 * 
 * @author Brett Smith <a href="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
 * @version $Revision: 1.2 $
 */
public class DefaultPropertyDefinition implements PropertyDefinition {

    // Private instance variables

    private int type, category;
    private String name, typeMeta;
    private String defaultValue;
    private int visibility;
    private int sortOrder;
    private Object typeMetaObject;
    private String messageResourcesKey;
    private boolean hidden;

    /**
     * Constructor.
     * 
     * @param type type
     * @param name name
     * @param typeMeta type meta-data
     * @param category category ID
     * @param defaultValue default value
     * @param visibility visibility
     * @param sortOrder sort order
     * @param hidden hiddem
     */
    public DefaultPropertyDefinition(int type, String name, String typeMeta, int category, String defaultValue, int visibility,
                                     int sortOrder, boolean hidden) {
        this(type, name, typeMeta, category, defaultValue, visibility, sortOrder, "properties", hidden);
    }

    /**
     * Constructor.
     * 
     * @param type type
     * @param name name
     * @param typeMeta type meta-data
     * @param category category ID
     * @param defaultValue default value
     * @param visibility visibility
     * @param sortOrder sort order
     * @param messageResourcesKey message resource bundle bundle
     * @param hidden hiddem
     */
    public DefaultPropertyDefinition(int type, String name, String typeMeta, int category, String defaultValue, int visibility,
                                     int sortOrder, String messageResourcesKey, boolean hidden) {
        this.type = type;
        this.name = name;
        this.typeMeta = typeMeta;
        this.category = category;
        this.defaultValue = defaultValue;
        this.visibility = visibility;
        this.sortOrder = sortOrder;
        this.hidden = hidden;
        this.messageResourcesKey = messageResourcesKey == null ? "properties" : messageResourcesKey;

        switch (type) {
            case TYPE_LIST:
                typeMetaObject = new ArrayList();
                StringTokenizer t = new StringTokenizer(typeMeta, ",");
                while (t.hasMoreTokens()) {
                    ((List) typeMetaObject).add(new TypeMetaListItem(t.nextToken(), this.messageResourcesKey));
                }
                break;
        }
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.boot.PropertyDefinition#getMessageResourcesKey()
     */
    public String getMessageResourcesKey() {
        return messageResourcesKey;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.boot.PropertyDefinition#getCategory()
     */
    public int getCategory() {
        return category;
    }

    /**
     * @param category
     */
    public void setCategory(int category) {
        this.category = category;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.boot.PropertyDefinition#getName()
     */
    public String getName() {
        return name;
    }

    /**
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.boot.PropertyDefinition#getType()
     */
    public int getType() {
        return type;
    }

    /**
     * @param type
     */
    public void setType(int type) {
        this.type = type;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.boot.PropertyDefinition#getTypeMeta()
     */
    public String getTypeMeta() {
        return typeMeta;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.boot.PropertyDefinition#setTypeMeta(java.lang.String)
     */
    public void setTypeMeta(String typeMeta) {
        this.typeMeta = typeMeta;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.boot.PropertyDefinition#getDefaultValue()
     */
    public String getDefaultValue() {
        return defaultValue;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.boot.PropertyDefinition#setDefaultValue(java.lang.String)
     */
    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.boot.PropertyDefinition#getVisibility()
     */
    public int getVisibility() {
        return visibility;
    }

    /**
     * Set the visiblity
     * 
     * @param visibility
     * @see #getVisibility()
     */
    public void setVisibility(int visibility) {
        this.visibility = visibility;        
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.boot.PropertyDefinition#getSortOrder()
     */
    public int getSortOrder() {
        return sortOrder;
    }

    /**
     * Set the sort order
     * 
     * @param sortOrder sort order
     */
    public void setSortOrder(int sortOrder) {
        this.sortOrder = sortOrder;        
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.boot.PropertyDefinition#getTypeMetaObject()
     */
    public Object getTypeMetaObject() {
        return typeMetaObject;
    }

    /* (non-Javadoc)
     * @see com.sslexplorer.boot.PropertyDefinition#isHidden()
     */
    public boolean isHidden() {
        return hidden;
    }
}

⌨️ 快捷键说明

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