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