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