java/sql-dk/src/main/java/info/globalcode/sql/dk/formatting/FormatterContext.java
author František Kučera <franta-hg@frantovo.cz>
Tue, 05 Mar 2019 22:03:02 +0100
branchv_0
changeset 246 277c18b48762
parent 238 4a1864c3e867
child 250 aae5009bd0af
permissions -rw-r--r--
support custom relation names in the XML formatter (added --relation CLI option)
franta-hg@24
     1
/**
franta-hg@24
     2
 * SQL-DK
franta-hg@24
     3
 * Copyright © 2013 František Kučera (frantovo.cz)
franta-hg@24
     4
 *
franta-hg@24
     5
 * This program is free software: you can redistribute it and/or modify
franta-hg@24
     6
 * it under the terms of the GNU General Public License as published by
franta-hg@24
     7
 * the Free Software Foundation, either version 3 of the License, or
franta-hg@24
     8
 * (at your option) any later version.
franta-hg@24
     9
 *
franta-hg@24
    10
 * This program is distributed in the hope that it will be useful,
franta-hg@24
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@24
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@24
    13
 * GNU General Public License for more details.
franta-hg@24
    14
 *
franta-hg@24
    15
 * You should have received a copy of the GNU General Public License
franta-hg@24
    16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
franta-hg@24
    17
 */
franta-hg@24
    18
package info.globalcode.sql.dk.formatting;
franta-hg@24
    19
franta-hg@104
    20
import info.globalcode.sql.dk.configuration.Properties;
franta-hg@24
    21
import java.io.OutputStream;
franta-hg@246
    22
import java.util.List;
franta-hg@24
    23
franta-hg@24
    24
/**
franta-hg@155
    25
 * To be passed from the SQL-DK core to the formatter.
franta-hg@24
    26
 *
franta-hg@24
    27
 * @author Ing. František Kučera (frantovo.cz)
franta-hg@24
    28
 */
franta-hg@24
    29
public class FormatterContext {
franta-hg@24
    30
franta-hg@24
    31
	private OutputStream outputStream;
franta-hg@104
    32
	private Properties properties;
franta-hg@246
    33
	private List<String> relationNames;
franta-hg@24
    34
franta-hg@246
    35
	public FormatterContext(OutputStream outputStream, Properties properties, List<String> relationNames) {
franta-hg@24
    36
		this.outputStream = outputStream;
franta-hg@104
    37
		this.properties = properties;
franta-hg@246
    38
		this.relationNames = relationNames;
franta-hg@24
    39
	}
franta-hg@24
    40
franta-hg@24
    41
	public OutputStream getOutputStream() {
franta-hg@24
    42
		return outputStream;
franta-hg@24
    43
	}
franta-hg@104
    44
franta-hg@104
    45
	public Properties getProperties() {
franta-hg@104
    46
		return properties;
franta-hg@104
    47
	}
franta-hg@104
    48
franta-hg@104
    49
	public void setProperties(Properties properties) {
franta-hg@104
    50
		this.properties = properties;
franta-hg@104
    51
	}
franta-hg@246
    52
franta-hg@246
    53
	public List<String> getRelationNames() {
franta-hg@246
    54
		return relationNames;
franta-hg@246
    55
	}
franta-hg@246
    56
franta-hg@246
    57
	public void setOutputStream(OutputStream outputStream) {
franta-hg@246
    58
		this.outputStream = outputStream;
franta-hg@246
    59
	}
franta-hg@246
    60
franta-hg@24
    61
}