java/sql-dk/src/main/java/info/globalcode/sql/dk/configuration/CommandArgument.java
author František Kučera <franta-hg@frantovo.cz>
Thu, 24 Oct 2019 21:43:08 +0200
branchv_0
changeset 250 aae5009bd0af
parent 238 4a1864c3e867
permissions -rw-r--r--
fix license version: GNU GPLv3
franta-hg@203
     1
/**
franta-hg@203
     2
 * SQL-DK
franta-hg@203
     3
 * Copyright © 2015 František Kučera (frantovo.cz)
franta-hg@203
     4
 *
franta-hg@203
     5
 * This program is free software: you can redistribute it and/or modify
franta-hg@203
     6
 * it under the terms of the GNU General Public License as published by
franta-hg@250
     7
 * the Free Software Foundation, version 3 of the License.
franta-hg@203
     8
 *
franta-hg@203
     9
 * This program is distributed in the hope that it will be useful,
franta-hg@203
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@203
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@203
    12
 * GNU General Public License for more details.
franta-hg@203
    13
 *
franta-hg@203
    14
 * You should have received a copy of the GNU General Public License
franta-hg@203
    15
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
franta-hg@203
    16
 */
franta-hg@203
    17
package info.globalcode.sql.dk.configuration;
franta-hg@203
    18
franta-hg@203
    19
import javax.xml.bind.annotation.XmlAttribute;
franta-hg@203
    20
import javax.xml.bind.annotation.XmlEnum;
franta-hg@203
    21
import javax.xml.bind.annotation.XmlEnumValue;
franta-hg@203
    22
import javax.xml.bind.annotation.XmlValue;
franta-hg@203
    23
franta-hg@203
    24
/**
franta-hg@203
    25
 *
franta-hg@203
    26
 * @author Ing. František Kučera (frantovo.cz)
franta-hg@203
    27
 */
franta-hg@203
    28
public class CommandArgument {
franta-hg@203
    29
franta-hg@203
    30
	private String value;
franta-hg@203
    31
	private TYPE type;
franta-hg@203
    32
franta-hg@203
    33
	@XmlEnum
franta-hg@203
    34
	public static enum TYPE {
franta-hg@203
    35
franta-hg@203
    36
		/**
franta-hg@203
    37
		 * value = literal (text) argument
franta-hg@203
    38
		 */
franta-hg@203
    39
		@XmlEnumValue("literal")
franta-hg@203
    40
		LITERAL,
franta-hg@203
    41
		/**
franta-hg@203
    42
		 * value will be substituted by hostname or IP address of the DB server
franta-hg@203
    43
		 */
franta-hg@203
    44
		@XmlEnumValue("host")
franta-hg@203
    45
		HOST,
franta-hg@203
    46
		/**
franta-hg@203
    47
		 * value will be substituted by the port of the DB server
franta-hg@203
    48
		 */
franta-hg@203
    49
		@XmlEnumValue("port")
franta-hg@203
    50
		PORT,
franta-hg@203
    51
		/**
franta-hg@203
    52
		 * value will be substituted by environmental variable of given name
franta-hg@203
    53
		 */
franta-hg@203
    54
		@XmlEnumValue("env")
franta-hg@203
    55
		ENVIRONMENT_VARIABLE,
franta-hg@203
    56
		/**
franta-hg@203
    57
		 * value will be substituted by database property of given name
franta-hg@203
    58
		 */
franta-hg@203
    59
		@XmlEnumValue("dbProperty")
franta-hg@203
    60
		DB_PROPERTY;
franta-hg@203
    61
	}
franta-hg@203
    62
franta-hg@203
    63
	@XmlValue
franta-hg@203
    64
	public String getValue() {
franta-hg@203
    65
		return value;
franta-hg@203
    66
	}
franta-hg@203
    67
franta-hg@203
    68
	public void setValue(String value) {
franta-hg@203
    69
		this.value = value;
franta-hg@203
    70
	}
franta-hg@203
    71
franta-hg@203
    72
	@XmlAttribute(name = "type")
franta-hg@203
    73
	public TYPE getType() {
franta-hg@203
    74
		return type;
franta-hg@203
    75
	}
franta-hg@203
    76
franta-hg@203
    77
	public void setType(TYPE type) {
franta-hg@203
    78
		this.type = type;
franta-hg@203
    79
	}
franta-hg@203
    80
franta-hg@203
    81
}