private static int getMaxIterations(XMLConfiguration config) { String maxIterationsString = config.getString("iterations"); if (maxIterationsString == null) maxIterationsString = config.getString("maxIterations"); if (maxIterationsString != null) return (Integer.parseInt(maxIterationsString)); return -1; }
private static PrematureAlgorithmTermination getPrematureTermination(XMLConfiguration config, Set<PrioritizedVRAListener> algorithmListeners) { String basedOn = config.getString("prematureBreak[@basedOn]"); if (basedOn == null) { log.debug("set default prematureBreak, i.e. no premature break at all."); String iter = config.getString("prematureBreak.iterations"); if (iter == null) throw new IllegalStateException("prematureBreak.iterations is missing"); int iterations = Integer.valueOf(iter); String timeString = config.getString("prematureBreak.time"); if (timeString == null) throw new IllegalStateException("prematureBreak.time is missing"); long time = Long.parseLong(timeString); String thresholdString = config.getString("prematureBreak.threshold"); String iterationsString = config.getString("prematureBreak.iterations"); if (thresholdString == null) throw new IllegalStateException("prematureBreak.threshold is missing"); if (iterationsString == null) throw new IllegalStateException("prematureBreak.iterations is missing");
private void readProblemType(XMLConfiguration vrpProblem) { String fleetSize = vrpProblem.getString("problemType.fleetSize"); if (fleetSize == null) vrpBuilder.setFleetSize(FleetSize.INFINITE); else if (fleetSize.toUpperCase().equals(FleetSize.INFINITE.toString())) vrpBuilder.setFleetSize(FleetSize.INFINITE); else vrpBuilder.setFleetSize(FleetSize.FINITE); }
String switchString = config.getString("construction.insertion.allowVehicleSwitch"); final boolean switchAllowed; if (switchString != null) {
/** * Returns a configuration property <b>String</b> value based off the {@link ConfigProperty} * * @param configProperty * String Property Name * @return The configuration property <b>String</b> value. */ public static String getConfigProperty(String configProperty) { checkArgument(configProperty != null, "Config property cannot be null"); return getConfig().getString(configProperty); }
@Override protected void loadChecksummerFromXML(XMLConfiguration xml) { setDisabled(xml.getBoolean("[@disabled]", disabled)); String flds = xml.getString("sourceFields", null); if (StringUtils.isBlank(flds)) { sourceFields = null; } else { sourceFields = flds.split("\\s*,\\s*"); } setSourceFieldsRegex(xml.getString( "sourceFieldsRegex", getSourceFieldsRegex())); }
@Override public void loadFromXML(Reader in) throws IOException { XMLConfiguration xml = XMLConfigurationUtil.newXMLConfiguration(in); setStatusDirectory(xml.getString("statusDir", statusDir)); }
@Override protected void loadCharStreamTaggerFromXML(XMLConfiguration xml) throws IOException { setFieldName(xml.getString("[@fieldName]", getFieldName())); }
@Override protected void loadFilterFromXML(XMLConfiguration xml) throws IOException { setCaseSensitive(xml.getBoolean("[@caseSensitive]", isCaseSensitive())); setSelector(xml.getString("[@selector]", getSelector())); setParser(xml.getString("[@parser]", getParser())); setSourceCharset(xml.getString("[@sourceCharset]", getSourceCharset())); setSourceCharset(xml.getString("[@extract]", getExtract())); setRegex(xml.getString("regex")); }
@Override protected final void loadFilterFromXML( XMLConfiguration xml) throws IOException { setSourceCharset(xml.getString("[@sourceCharset]", getSourceCharset())); loadCharStreamFilterFromXML(xml); } /**
@Override public void loadFromXML(Reader in) { XMLConfiguration xml = XMLConfigurationUtil.newXMLConfiguration(in); setDirectory(xml.getString("directory", directory)); setPretty(xml.getBoolean("pretty", pretty)); setDocsPerFile(xml.getInt("docsPerFile", docsPerFile)); setCompress(xml.getBoolean("compress", compress)); setSplitAddDelete(xml.getBoolean("splitAddDelete", splitAddDelete)); setFileNamePrefix(xml.getString("fileNamePrefix", fileNamePrefix)); setFileNameSuffix(xml.getString("fileNameSuffix", fileNameSuffix)); } @Override
public License getGeneratedCodeLicense() { String text = this.source.getString("code-license", null); List<HierarchicalConfiguration> configs = this.source.configurationsAt("code-license"); for (HierarchicalConfiguration licenseConfig : configs) { String file = licenseConfig.getString("[@file]", null); String name = licenseConfig.getString("[@name]", null); String url = licenseConfig.getString("[@url]", null); return new License(name, url, file, text); } return null; }
public License getApiLicense() { String text = this.source.getString("code-license", null); List<HierarchicalConfiguration> configs = this.source.configurationsAt("api-license"); for (HierarchicalConfiguration licenseConfig : configs) { String file = licenseConfig.getString("[@file]", null); String name = licenseConfig.getString("[@name]", null); String url = licenseConfig.getString("[@url]", null); return text == null && file == null && name == null && url == null ? this.defaultApiLicense : new License(name, url, file, text); } return this.defaultApiLicense; }
public License getApiLicense() { String text = this.source.getString("code-license", null); List<HierarchicalConfiguration> configs = this.source.configurationsAt("api-license"); for (HierarchicalConfiguration licenseConfig : configs) { String file = licenseConfig.getString("[@file]", null); String name = licenseConfig.getString("[@name]", null); String url = licenseConfig.getString("[@url]", null); return text == null && file == null && name == null && url == null ? this.defaultApiLicense : new License(name, url, file, text); } return this.defaultApiLicense; }
@Override public void loadFromXML(Reader in) { XMLConfiguration xml = XMLConfigurationUtil.newXMLConfiguration(in); setExtensions(xml.getString("")); loadFromXML(xml); setCaseSensitive(xml.getBoolean("[@caseSensitive]", false)); } @Override
public License getGeneratedCodeLicense() { String text = this.source.getString("code-license", null); List<HierarchicalConfiguration> configs = this.source.configurationsAt("code-license"); for (HierarchicalConfiguration licenseConfig : configs) { String file = licenseConfig.getString("[@file]", null); String name = licenseConfig.getString("[@name]", null); String url = licenseConfig.getString("[@url]", null); return new License(name, url, file, text); } return null; }
@Override protected void loadHandlerFromXML(XMLConfiguration xml) throws IOException { setLogContent(xml.getBoolean("[@logContent]", isLogContent())); setLogFields(XMLConfigurationUtil.getCSVStringArray( xml, "[@logFields]", getLogFields())); setLogLevel(xml.getString("[@logLevel]", getLogLevel())); }
@Override protected void loadChecksummerFromXML(XMLConfiguration xml) { setDisabled(xml.getBoolean("[@disabled]", disabled)); setCombineFieldsAndContent(xml.getBoolean( "[@combineFieldsAndContent]", isCombineFieldsAndContent())); setSourceFields(XMLConfigurationUtil.getCSVStringArray( xml, "sourceFields", getSourceFields())); setSourceFieldsRegex(xml.getString( "sourceFieldsRegex", getSourceFieldsRegex())); } @Override