Variable.java :  » Code-Analyzer » macker » net » innig » macker » rule » Java Open Source

Java Open Source » Code Analyzer » macker 
macker » net » innig » macker » rule » Variable.java
/*______________________________________________________________________________
 *
 * Macker   http://innig.net/macker/
 *
 * Copyright 2002 Paul Cantrell
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License version 2, as published by the
 * Free Software Foundation. See the file LICENSE.html for more information.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the 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. / 59 Temple
 * Place, Suite 330 / Boston, MA 02111-1307 / USA.
 *______________________________________________________________________________
 */
 
package net.innig.macker.rule;

import net.innig.macker.structure.ClassManager;
import net.innig.macker.structure.ClassInfo;
import net.innig.macker.event.MackerIsMadException;

import java.util.*;

public class Variable
    extends Rule
    {
    public Variable(RuleSet parent, String name, String value)
        {
        super(parent);
        setVariableName(name);
        setValue(value);
        }
        
    public String getVariableName()
        { return variableName; }
    
    public void setVariableName(String variableName)
        { this.variableName = variableName; }
    
    public String getValue()
        { return value; }
    
    public void setValue(String value)
        { this.value = value;}

    public void check(
            EvaluationContext context,
            ClassManager classes)
        throws RulesException, MackerIsMadException
        {
        context.setVariableValue(getVariableName(), getValue());
        }
    
    private String variableName, value;
    }
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.