/* Generated By:JJTree: Do not edit this line. ASTMySet.java Version 4.3 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package eu.dnetlib.data.collective.transformation.rulelanguage.parser;

import java.util.LinkedList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import eu.dnetlib.data.collective.transformation.rulelanguage.Rules;

/**
 * This class is primarily designed to assign values to the element and attributes of the element
 * @author jochen
 *
 */
public class ASTMySet extends AbstractNode {
	
	private static final Log log = LogFactory.getLog(ASTMySet.class);
	private List<Rules> rulesList = new LinkedList<Rules>();
	private String expressionValue;
	private String constValue;
	private boolean isExpressionValue = false;
	
	
  public ASTMySet(int id) {
    super(id);
  }

  public ASTMySet(FtScript p, int id) {
    super(p, id);
  }

  /** Accept the visitor. **/
  public Object jjtAccept(FtScriptVisitor visitor, Object data) {
    return visitor.visit(this, data);
  }
  
  public void addAttributeRule(Rules aRule){
	  log.debug("called method:  ASTMySet.addRule " + aRule.getUniqueName()+
			  " attribute: " + aRule.getAttribute() + " defines variable?: " + aRule.definesVariable());
	  rulesList.add(aRule);
  }
  
  public List<Rules> getRules(){
	  return this.rulesList;
  }

  public void setValueExpression(String aExpression) {
	  log.debug("expression: " + aExpression);
	this.expressionValue = aExpression;
	this.isExpressionValue = true;
  }
  
  public String getValueExpression(){
	  return this.expressionValue;
  }
  
  public boolean isValueExpression(){
	  return this.isExpressionValue;
  }

  public void setAttribute(String aValue) {
	  this.constValue = aValue;
  }
}
/* JavaCC - OriginalChecksum=1a796456845c74ed0ee62389483ce5a7 (do not edit this line) */
