package net.sf.jasperreports.crosstabs.base;

import net.sf.jasperreports.crosstabs.JRCrosstabParameter;
import net.sf.jasperreports.engine.JRExpression;
import net.sf.jasperreports.engine.JRParameter;
import net.sf.jasperreports.engine.base.JRBaseObjectFactory;
import net.sf.jasperreports.engine.base.JRBaseParameter;

public class JRBaseCrosstabParameter extends JRBaseParameter implements JRCrosstabParameter {
  private static final long serialVersionUID = 10200L;
  
  protected JRExpression valueExpression;
  
  protected JRBaseCrosstabParameter() {}
  
  public JRBaseCrosstabParameter(JRCrosstabParameter parameter, JRBaseObjectFactory factory) {
    super((JRParameter)parameter, factory);
    this.valueExpression = factory.getExpression(parameter.getExpression());
  }
  
  public JRExpression getExpression() {
    return this.valueExpression;
  }
  
  public Object clone() {
    JRBaseCrosstabParameter clone = (JRBaseCrosstabParameter)super.clone();
    if (this.valueExpression != null)
      clone.valueExpression = (JRExpression)this.valueExpression.clone(); 
    return clone;
  }
}
