package net.sf.jasperreports.engine.base;

import java.io.Serializable;
import net.sf.jasperreports.engine.JRExpression;
import net.sf.jasperreports.engine.JRHyperlinkParameter;
import net.sf.jasperreports.engine.JRRuntimeException;

public class JRBaseHyperlinkParameter implements JRHyperlinkParameter, Serializable {
  private static final long serialVersionUID = 10200L;
  
  protected String name;
  
  protected JRExpression valueExpression;
  
  protected JRBaseHyperlinkParameter() {}
  
  public JRBaseHyperlinkParameter(JRHyperlinkParameter parameter, JRBaseObjectFactory factory) {
    factory.put(parameter, this);
    this.name = parameter.getName();
    this.valueExpression = factory.getExpression(parameter.getValueExpression());
  }
  
  public String getName() {
    return this.name;
  }
  
  public JRExpression getValueExpression() {
    return this.valueExpression;
  }
  
  public Object clone() {
    JRBaseHyperlinkParameter clone = null;
    try {
      clone = (JRBaseHyperlinkParameter)super.clone();
    } catch (CloneNotSupportedException e) {
      throw new JRRuntimeException(e);
    } 
    if (this.valueExpression != null)
      clone.valueExpression = (JRExpression)this.valueExpression.clone(); 
    return clone;
  }
}
