de.julielab.xmlData.config.FieldConfig Maven / Gradle / Ivy
/**
* FieldDefinition.java
*
* Copyright (c) 2011, JULIE Lab.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
*
* Author: faessler
*
* Current version: 1.0
* Since version: 1.0
*
* Creation date: 11.03.2011
**/
package de.julielab.xmlData.config;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ximpleware.AutoPilot;
import com.ximpleware.EOFException;
import com.ximpleware.EncodingException;
import com.ximpleware.EntityException;
import com.ximpleware.NavException;
import com.ximpleware.ParseException;
import com.ximpleware.PilotException;
import com.ximpleware.VTDException;
import com.ximpleware.VTDGen;
import com.ximpleware.VTDNav;
import com.ximpleware.XPathEvalException;
import com.ximpleware.XPathParseException;
import de.julielab.xml.JulieXMLConstants;
import de.julielab.xml.JulieXMLTools;
import de.julielab.xmlData.Constants;
/**
* This class holds the definition of fields for the database table to work
* with. The definition was read from the configuration XML file.
*
* @author faessler
*/
public class FieldConfig extends ConfigBase {
private final static Logger log = LoggerFactory.getLogger(FieldConfig.class);
private static final String XPATH_CONF_SCHEMA_INFO = "//DBSchemaInformation";
private static final String XPATH_CONF_SCHEMES = XPATH_CONF_SCHEMA_INFO + "/tableSchemas";
private static final String XPATH_CONF_SCHEME = XPATH_CONF_SCHEMES + "/tableSchema";
private static final String XPATH_CONF_FIELD_TEMPLATE = XPATH_CONF_SCHEME
+ "[@name='%s']/field";
private static final String XPATH_CONF_ACTIVE_SCHEME_TEMPLATE = XPATH_CONF_SCHEME
+ "[@name='%s']";
private List