// Path: src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralException.java
// public class KoralException extends Exception{
// 	
// 	private static final long serialVersionUID = 5463242042200109417L;
// 	private int statusCode;
// 	
// 	public KoralException(int code, String message) {
// 		super(message);
// 		this.statusCode = code;
// 	}
// 	
// 	public KoralException(int code, String message, Throwable cause) {
//         super(message, cause);
//         this.statusCode = code;
//     }
// 
// 	public int getStatusCode() {
// 		return statusCode;
// 	}
// 
// 	public void setStatusCode(int statusCode) {
// 		this.statusCode = statusCode;
// 	}
// 
// 	
// }
// 
// Path: src/main/java/de/ids_mannheim/korap/query/serialize/util/StatusCodes.java
// public class StatusCodes {
//     public final static int NO_QUERY = 301;
//     public final static int MALFORMED_QUERY = 302;
//     public final static int DEPRECATED_QUERY_ELEMENT = 303;
//     public final static int INVALID_CLASS_REFERENCE = 304;
//     public final static int INCOMPATIBLE_OPERATOR_AND_OPERAND = 305;
//     public final static int UNKNOWN_QUERY_ELEMENT = 306;
// 	public final static int UNKNOWN_QUERY_LANGUAGE = 307;
//     public final static int UNBOUND_ANNIS_RELATION = 308;
// 	public final static int MISSING_VERSION = 309;
// 	public final static int UNSUPPORTED_VERSION = 310;
// 	public final static int QUERY_TOO_COMPLEX = 311;
// 	public final static int UNKNOWN_QUERY_ERROR = 399;
// 	public final static int SERIALIZATION_FAILED = 300;
// }
// 
// Path: src/main/java/de/ids_mannheim/korap/query/object/KoralMatchOperator.java
// public enum KoralMatchOperator {
//     EQUALS("eq"), NOT_EQUALS("ne");
// 
//     String value;
// 
//     KoralMatchOperator (String value) {
//         this.value = value;
//     }
// 
//     @Override
//     public String toString() {
//         return "match:" + value;
//     };
// }
// 
// Path: src/main/java/de/ids_mannheim/korap/query/object/KoralType.java
// public enum KoralType {
//     TERMGROUP("koral:termGroup"), TERM("koral:term"), TOKEN("koral:token"), 
//     SPAN("koral:span"), GROUP("koral:group"), BOUNDARY("koral:boundary"), 
//     RELATION("koral:relation"), DISTANCE("koral:distance"), REFERENCE(
//     "koral:reference"), DOCUMENT("koral:doc"), DOCUMENT_GROUP("koral:docGroup"),
//     DOCUMENT_GROUP_REF("koral:docGroupRef"),
//     QUERY_REF("koral:queryRef"),
//     COSMAS_DISTANCE("cosmas:distance");
// 
//     String value;
// 
// 
//     KoralType (String value) {
//         this.value = value;
//     }
// 
// 
//     @Override
//     public String toString () {
//         return value;
//     }
// }


import java.util.LinkedHashMap;
import java.util.Map;
import de.ids_mannheim.korap.query.serialize.util.KoralException;
import de.ids_mannheim.korap.query.serialize.util.StatusCodes;
import de.ids_mannheim.korap.query.object.KoralMatchOperator;
import de.ids_mannheim.korap.query.object.KoralType;
package de.ids_mannheim.korap.query.object;



/** Definition of koral:term in KoralQuery.
 * 
 * @author margaretha
 * 
 */
public class KoralTerm implements KoralObject {

    private static final KoralType koralType = KoralType.TERM;
  
    private final String key;
    private String value;
    private String layer;
    private String foundry;
    private KoralMatchOperator operator; // match
    
    private KoralTermType type;
    
    private boolean caseSensitive = true;
    private boolean diacriticSensitive = true; 

// Path: src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralException.java
// public class KoralException extends Exception{
// 	
// 	private static final long serialVersionUID = 5463242042200109417L;
// 	private int statusCode;
// 	
// 	public KoralException(int code, String message) {
// 		super(message);
// 		this.statusCode = code;
// 	}
// 	
// 	public KoralException(int code, String message, Throwable cause) {
//         super(message, cause);
//         this.statusCode = code;
//     }
// 
// 	public int getStatusCode() {
// 		return statusCode;
// 	}
// 
// 	public void setStatusCode(int statusCode) {
// 		this.statusCode = statusCode;
// 	}
// 
// 	
// }
// 
// Path: src/main/java/de/ids_mannheim/korap/query/serialize/util/StatusCodes.java
// public class StatusCodes {
//     public final static int NO_QUERY = 301;
//     public final static int MALFORMED_QUERY = 302;
//     public final static int DEPRECATED_QUERY_ELEMENT = 303;
//     public final static int INVALID_CLASS_REFERENCE = 304;
//     public final static int INCOMPATIBLE_OPERATOR_AND_OPERAND = 305;
//     public final static int UNKNOWN_QUERY_ELEMENT = 306;
// 	public final static int UNKNOWN_QUERY_LANGUAGE = 307;
//     public final static int UNBOUND_ANNIS_RELATION = 308;
// 	public final static int MISSING_VERSION = 309;
// 	public final static int UNSUPPORTED_VERSION = 310;
// 	public final static int QUERY_TOO_COMPLEX = 311;
// 	public final static int UNKNOWN_QUERY_ERROR = 399;
// 	public final static int SERIALIZATION_FAILED = 300;
// }
// 
// Path: src/main/java/de/ids_mannheim/korap/query/object/KoralMatchOperator.java
// public enum KoralMatchOperator {
//     EQUALS("eq"), NOT_EQUALS("ne");
// 
//     String value;
// 
//     KoralMatchOperator (String value) {
//         this.value = value;
//     }
// 
//     @Override
//     public String toString() {
//         return "match:" + value;
//     };
// }
// 
// Path: src/main/java/de/ids_mannheim/korap/query/object/KoralType.java
// public enum KoralType {
//     TERMGROUP("koral:termGroup"), TERM("koral:term"), TOKEN("koral:token"), 
//     SPAN("koral:span"), GROUP("koral:group"), BOUNDARY("koral:boundary"), 
//     RELATION("koral:relation"), DISTANCE("koral:distance"), REFERENCE(
//     "koral:reference"), DOCUMENT("koral:doc"), DOCUMENT_GROUP("koral:docGroup"),
//     DOCUMENT_GROUP_REF("koral:docGroupRef"),
//     QUERY_REF("koral:queryRef"),
//     COSMAS_DISTANCE("cosmas:distance");
// 
//     String value;
// 
// 
//     KoralType (String value) {
//         this.value = value;
//     }
// 
// 
//     @Override
//     public String toString () {
//         return value;
//     }
// }


// Path: src/main/java/de/ids_mannheim/korap/query/object/KoralTerm.java
import java.util.LinkedHashMap;
import java.util.Map;
import de.ids_mannheim.korap.query.serialize.util.KoralException;
import de.ids_mannheim.korap.query.serialize.util.StatusCodes;
import de.ids_mannheim.korap.query.object.KoralMatchOperator;
import de.ids_mannheim.korap.query.object.KoralType;

package de.ids_mannheim.korap.query.object;



/** Definition of koral:term in KoralQuery.
 * 
 * @author margaretha
 * 
 */
public class KoralTerm implements KoralObject {

    private static final KoralType koralType = KoralType.TERM;
  
    private final String key;
    private String value;
    private String layer;
    private String foundry;
    private KoralMatchOperator operator; // match
    
    private KoralTermType type;
    
    private boolean caseSensitive = true;
    private boolean diacriticSensitive = true; 

    public KoralTerm(String key) throws KoralException {