aboutsummaryrefslogtreecommitdiff
path: root/project/JavaCommon/src/com/modulus/dataread/expressions/impl/FormatStatement.java
blob: 8a4b3ad020f0c415895b7e0f37e086078b6c2207 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.modulus.dataread.expressions.impl;

import com.modulus.dataread.expressions.AbstractStatement;
import com.modulus.dataread.expressions.StatementFormatter;

/**
 * This class that extends AbstractStatement will first
 * format its header before it sets the actual header to
 * what the user sends, using a statement formatter.
 * 
 * @author jrahm
 *
 */
public class FormatStatement extends AbstractStatement{
	private static final long serialVersionUID = -4973798175965745298L;
	private StatementFormatter formatter;
	
	/**
	 * This creates a new Statement with <code>formatter</code>
	 * as the default formatter for this Statement.
	 * 
	 * @param formatter the formatter for this statement
	 */
	public FormatStatement(StatementFormatter formatter){
		this.formatter = formatter;
	}
	
	protected FormatStatement(){
	}
	
	@Override
	public void setHeader(String header) {
		this.header = formatter.formatHeader(header);
	}
	
	/**
	 * Returns the formatter for this Statement
	 * @return the formatter for this Statement
	 */
	public StatementFormatter getFormatter(){
		return formatter;
	}
	
	/**
	 * Sets the formatter for this statement
	 * @param formatter the formatter for this statement
	 */
	public void setFormatter(StatementFormatter formatter){
		this.formatter = formatter;
	}
	
}