class for xmlns constants v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sun, 22 Dec 2013 18:35:50 +0100
branchv_0
changeset 30b7ea47b2d4ca
parent 29 d66858b4b563
child 31 ef2fdb55e8ec
class for xmlns constants
java/sql-dk/src/info/globalcode/sql/dk/Constants.java
java/sql-dk/src/info/globalcode/sql/dk/Xmlns.java
java/sql-dk/src/info/globalcode/sql/dk/configuration/Configuration.java
java/sql-dk/src/info/globalcode/sql/dk/configuration/DatabaseDefinition.java
java/sql-dk/src/info/globalcode/sql/dk/configuration/FormatterDefinition.java
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/Constants.java	Sun Dec 22 18:19:38 2013 +0100
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/Constants.java	Sun Dec 22 18:35:50 2013 +0100
     1.3 @@ -27,7 +27,6 @@
     1.4  	public static final String LICENSE_FILE = "info/globalcode/sql/dk/license.txt";
     1.5  	public static final String VERSION_FILE = "info/globalcode/sql/dk/version.txt";
     1.6  	public static final String HELP_FILE = "info/globalcode/sql/dk/help.txt";
     1.7 -	public static final String XMLNS_CONFIGURATION = "https://sql-dk.globalcode.info/xmlns/configuration";
     1.8  
     1.9  	private Constants() {
    1.10  	}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/Xmlns.java	Sun Dec 22 18:35:50 2013 +0100
     2.3 @@ -0,0 +1,28 @@
     2.4 +/**
     2.5 + * SQL-DK
     2.6 + * Copyright © 2013 František Kučera (frantovo.cz)
     2.7 + *
     2.8 + * This program is free software: you can redistribute it and/or modify
     2.9 + * it under the terms of the GNU General Public License as published by
    2.10 + * the Free Software Foundation, either version 3 of the License, or
    2.11 + * (at your option) any later version.
    2.12 + *
    2.13 + * This program is distributed in the hope that it will be useful,
    2.14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    2.16 + * GNU General Public License for more details.
    2.17 + *
    2.18 + * You should have received a copy of the GNU General Public License
    2.19 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
    2.20 + */
    2.21 +package info.globalcode.sql.dk;
    2.22 +
    2.23 +/**
    2.24 + * XML namespaces
    2.25 + *
    2.26 + * @author Ing. František Kučera (frantovo.cz)
    2.27 + */
    2.28 +public class Xmlns {
    2.29 +
    2.30 +	public static final String CONFIGURATION = "https://sql-dk.globalcode.info/xmlns/configuration";
    2.31 +}
     3.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/Configuration.java	Sun Dec 22 18:19:38 2013 +0100
     3.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/Configuration.java	Sun Dec 22 18:35:50 2013 +0100
     3.3 @@ -17,7 +17,7 @@
     3.4   */
     3.5  package info.globalcode.sql.dk.configuration;
     3.6  
     3.7 -import static info.globalcode.sql.dk.Constants.XMLNS_CONFIGURATION;
     3.8 +import static info.globalcode.sql.dk.Xmlns.CONFIGURATION;
     3.9  import static info.globalcode.sql.dk.Functions.findByName;
    3.10  import info.globalcode.sql.dk.formatting.SilentFormatter;
    3.11  import info.globalcode.sql.dk.formatting.XmlFormatter;
    3.12 @@ -32,7 +32,7 @@
    3.13   *
    3.14   * @author Ing. František Kučera (frantovo.cz)
    3.15   */
    3.16 -@XmlRootElement(name = "configuration", namespace = XMLNS_CONFIGURATION)
    3.17 +@XmlRootElement(name = "configuration", namespace = CONFIGURATION)
    3.18  public class Configuration {
    3.19  
    3.20  	private List<DatabaseDefinition> databases = new ArrayList<>();
    3.21 @@ -50,7 +50,7 @@
    3.22  		buildInFormatters = Collections.unmodifiableCollection(l);
    3.23  	}
    3.24  
    3.25 -	@XmlElement(name = "database", namespace = XMLNS_CONFIGURATION)
    3.26 +	@XmlElement(name = "database", namespace = CONFIGURATION)
    3.27  	public List<DatabaseDefinition> getDatabases() {
    3.28  		return databases;
    3.29  	}
    3.30 @@ -63,7 +63,7 @@
    3.31  		return findByName(databases, name);
    3.32  	}
    3.33  
    3.34 -	@XmlElement(name = "formatter", namespace = XMLNS_CONFIGURATION)
    3.35 +	@XmlElement(name = "formatter", namespace = CONFIGURATION)
    3.36  	public List<FormatterDefinition> getFormatters() {
    3.37  		return formatters;
    3.38  	}
    3.39 @@ -80,7 +80,7 @@
    3.40  	/**
    3.41  	 * @return name of default formatter, is used if name is not specified on CLI
    3.42  	 */
    3.43 -	@XmlElement(name = "defaultFormatter", namespace = XMLNS_CONFIGURATION)
    3.44 +	@XmlElement(name = "defaultFormatter", namespace = CONFIGURATION)
    3.45  	public String getDefaultFormatter() {
    3.46  		return defaultFormatter;
    3.47  	}
     4.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/DatabaseDefinition.java	Sun Dec 22 18:19:38 2013 +0100
     4.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/DatabaseDefinition.java	Sun Dec 22 18:35:50 2013 +0100
     4.3 @@ -17,7 +17,7 @@
     4.4   */
     4.5  package info.globalcode.sql.dk.configuration;
     4.6  
     4.7 -import static info.globalcode.sql.dk.Constants.XMLNS_CONFIGURATION;
     4.8 +import static info.globalcode.sql.dk.Xmlns.CONFIGURATION;
     4.9  import info.globalcode.sql.dk.DatabaseConnection;
    4.10  import java.sql.SQLException;
    4.11  import javax.xml.bind.annotation.XmlElement;
    4.12 @@ -33,7 +33,7 @@
    4.13  	private String userName;
    4.14  	private String password;
    4.15  
    4.16 -	@XmlElement(name = "name", namespace = XMLNS_CONFIGURATION)
    4.17 +	@XmlElement(name = "name", namespace = CONFIGURATION)
    4.18  	@Override
    4.19  	public String getName() {
    4.20  		return name;
    4.21 @@ -43,7 +43,7 @@
    4.22  		this.name = name;
    4.23  	}
    4.24  
    4.25 -	@XmlElement(name = "url", namespace = XMLNS_CONFIGURATION)
    4.26 +	@XmlElement(name = "url", namespace = CONFIGURATION)
    4.27  	public String getUrl() {
    4.28  		return url;
    4.29  	}
    4.30 @@ -52,7 +52,7 @@
    4.31  		this.url = url;
    4.32  	}
    4.33  
    4.34 -	@XmlElement(name = "userName", namespace = XMLNS_CONFIGURATION)
    4.35 +	@XmlElement(name = "userName", namespace = CONFIGURATION)
    4.36  	public String getUserName() {
    4.37  		return userName;
    4.38  	}
    4.39 @@ -61,7 +61,7 @@
    4.40  		this.userName = userName;
    4.41  	}
    4.42  
    4.43 -	@XmlElement(name = "password", namespace = XMLNS_CONFIGURATION)
    4.44 +	@XmlElement(name = "password", namespace = CONFIGURATION)
    4.45  	public String getPassword() {
    4.46  		return password;
    4.47  	}
     5.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/FormatterDefinition.java	Sun Dec 22 18:19:38 2013 +0100
     5.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/FormatterDefinition.java	Sun Dec 22 18:35:50 2013 +0100
     5.3 @@ -17,7 +17,7 @@
     5.4   */
     5.5  package info.globalcode.sql.dk.configuration;
     5.6  
     5.7 -import static info.globalcode.sql.dk.Constants.XMLNS_CONFIGURATION;
     5.8 +import static info.globalcode.sql.dk.Xmlns.CONFIGURATION;
     5.9  import info.globalcode.sql.dk.DKException;
    5.10  import info.globalcode.sql.dk.formatting.Formatter;
    5.11  import info.globalcode.sql.dk.formatting.FormatterContext;
    5.12 @@ -42,7 +42,7 @@
    5.13  		this.className = className;
    5.14  	}
    5.15  
    5.16 -	@XmlElement(name = "name", namespace = XMLNS_CONFIGURATION)
    5.17 +	@XmlElement(name = "name", namespace = CONFIGURATION)
    5.18  	@Override
    5.19  	public String getName() {
    5.20  		return name;
    5.21 @@ -62,7 +62,7 @@
    5.22  	 *
    5.23  	 * @return fully qualified class name
    5.24  	 */
    5.25 -	@XmlElement(name = "class", namespace = XMLNS_CONFIGURATION)
    5.26 +	@XmlElement(name = "class", namespace = CONFIGURATION)
    5.27  	public String getClassName() {
    5.28  		return className;
    5.29  	}