package net.sf.jasperreports.engine.base;

import net.sf.jasperreports.engine.JRExpressionCollector;
import net.sf.jasperreports.engine.JRStaticText;
import net.sf.jasperreports.engine.JRTextElement;
import net.sf.jasperreports.engine.JRVisitor;

public class JRBaseStaticText extends JRBaseTextElement implements JRStaticText {
  private static final long serialVersionUID = 10200L;
  
  public static final String PROPERTY_TEXT = "text";
  
  protected String text = null;
  
  protected JRBaseStaticText(JRStaticText staticText, JRBaseObjectFactory factory) {
    super((JRTextElement)staticText, factory);
    this.text = staticText.getText();
  }
  
  public String getText() {
    return this.text;
  }
  
  public void setText(String text) {
    Object old = this.text;
    this.text = text;
    getEventSupport().firePropertyChange("text", old, this.text);
  }
  
  public void collectExpressions(JRExpressionCollector collector) {
    collector.collect(this);
  }
  
  public void visit(JRVisitor visitor) {
    visitor.visitStaticText(this);
  }
}
