parameterinfo.java

来自「一个eclipse插件源代码。用于web开发」· Java 代码 · 共 145 行

JAVA
145
字号
/*
 * $Header: /home/cvs/WEBPUMP2.0/WebPumpIDE_Src/WebPumpIDE/src/com/webpump/ui/bind/data/ParameterInfo.java,v 1.1.1.1 2004/07/01 09:07:41 wang_j Exp $
 * $Revision: 1.1.1.1 $
 * $Date: 2004/07/01 09:07:41 $
 *
 * ====================================================================
 *
 * The NanJing HopeRun(IT-FOREST) Software License, Version 2.0.0
 *
 * Copyright 2003-2004 by NanJing HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and
 *                        IT Forest Corporation
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and IT Forest Corporation.
 * You shall not disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into with
 * HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and IT Forest Corporation.
 */
 
package com.webpump.ui.bind.data;

import java.util.Hashtable;
import org.eclipse.pde.core.*;
import org.w3c.dom.*;
import com.webpump.ui.base.data.BaseObject;
import com.webpump.ui.perspective.WebpumpIDEPlugin;

/**
 * Class for data object of a bind parameter .
 * 
 * @author luo_sa
 * @version 2.0.0 2004-2-11
 */
public class ParameterInfo extends BaseObject {
    
    /** value of RangeName*/
    private String m_strRangeName;
    
    /** value of ObjectName*/
    private String m_strObjectName;
    
    /** value of Type*/
    private String m_strType;
    
    /** value of VariableName*/
    private String m_strVariableName;
    
    /** value of Modifier*/
    private String m_strModifier;
    
    /** value of VariableType*/
    private String m_strVariableType;
    
    /** value of DefaultValue*/
    private String m_strDefaultValue;
    
    /** value of Description*/
    private String m_strDescription;
    
    /** value of filter*/
    private String m_strFilter;

    /**
     * Parse parameter node
     * @param node the parameter node
     * @param lineTable a Hashtable object
     */
    public void parse(Node node, Hashtable lineTable) {
        bindSourceLocation(node, lineTable);
        m_strRangeName = getNodeAttribute(node, "RangeName");
        m_strObjectName = getNodeAttribute(node, "ObjectName");
        m_strType = getNodeAttribute(node, "Type");
        m_strVariableName = getNodeAttribute(node, "VariableName");
        m_strModifier = getNodeAttribute(node, "Modifier");
        m_strVariableType = getNodeAttribute(node, "VariableType");
        m_strDefaultValue = getNodeAttribute(node, "DefaultValue");
        m_strDescription = getNodeAttribute(node, "Description");
        m_strFilter = getNodeAttribute(node, "filter");      
    }


    /**
     * Transform ParameterInfo to a string
     * 
     * @return ParameterString string of ParameterInfo
     */
    public String getParameterString() {
        String ParameterString;
        ParameterString = "   " + "   " + "<parameter RangeName = "    + "\"" + WebpumpIDEPlugin.filterXML(m_strRangeName)    + "\"" + "\n"
                                  + "                 ObjectName = "   + "\"" + WebpumpIDEPlugin.filterXML(m_strObjectName)   + "\"" + "\n"
                                  + "                 Type = "         + "\"" + WebpumpIDEPlugin.filterXML(m_strType)         + "\"" + "\n"
                                  + "                 VariableName = " + "\"" + WebpumpIDEPlugin.filterXML(m_strVariableName) + "\"" + "\n"
                                  + "                 Modifier = "     + "\"" + WebpumpIDEPlugin.filterXML(m_strModifier)     + "\"" + "\n"
                                  + "                 VariableType = " + "\"" + WebpumpIDEPlugin.filterXML(m_strVariableType) + "\"" + "\n"
                                  + "                 DefaultValue = " + "\"" + WebpumpIDEPlugin.filterXML(m_strDefaultValue) + "\"" + "\n"
                                  + "                 Description = "  + "\"" + WebpumpIDEPlugin.filterXML(m_strDescription)  + "\"" + "\n"
                                  + "                 filter = "       + "\"" + WebpumpIDEPlugin.filterXML(m_strFilter)       + "\"" + "/>" + "\n";
                                                                               
        return ParameterString;
    }
   
    /**
     * Get all value of parameter
     * @return strReturn 
     */
    public String[] getParamsInfo() {
        String[] strReturn = new String[9];
        
        strReturn[0] = m_strRangeName;
        strReturn[1] = m_strObjectName;
        strReturn[2] = m_strType;
        strReturn[3] = m_strVariableName;
        strReturn[4] = m_strModifier;
        strReturn[5] = m_strVariableType;
        strReturn[6] = m_strDefaultValue;
        strReturn[7] = m_strDescription;
        strReturn[8] = m_strFilter;
        
        return strReturn;
        
    }
    
    /**
     * Set all value of parameter
     * @param strParamInfo 
     */
    public void setParamsInfo(String[] strParamInfo) {
        m_strRangeName = strParamInfo[0];
        m_strObjectName = strParamInfo[1];
        m_strType = strParamInfo[2];
        m_strVariableName = strParamInfo[3];
        m_strModifier = strParamInfo[4];
        m_strVariableType = strParamInfo[5];
        m_strDefaultValue = strParamInfo[6];
        m_strDescription = strParamInfo[7];
        m_strFilter = strParamInfo[8];
        //  fire structure of the data model changed 
        fireStructureChanged(this, ModelChangedEvent.CHANGE);
       
    }


}

⌨️ 快捷键说明

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