Example usage for org.apache.commons.configuration HierarchicalConfiguration getBoolean

List of usage examples for org.apache.commons.configuration HierarchicalConfiguration getBoolean

Introduction

In this page you can find the example usage for org.apache.commons.configuration HierarchicalConfiguration getBoolean.

Prototype

public boolean getBoolean(String key, boolean defaultValue) 

Source Link

Usage

From source file:com.intuit.tank.vm.settings.DefaultUser.java

@SuppressWarnings("unchecked")
public DefaultUser(HierarchicalConfiguration config) {
    this.name = config.getString("name");
    this.email = config.getString("email");
    this.password = config.getString("password");
    this.admin = config.getBoolean("admin", false);
    for (HierarchicalConfiguration c : (List<HierarchicalConfiguration>) config.configurationsAt("group")) {
        groups.add(c.getString(""));
    }//  ww w .  java  2  s  . co m
}

From source file:com.norconex.importer.handler.tagger.impl.RenameTagger.java

@Override
protected void loadHandlerFromXML(XMLConfiguration xml) throws IOException {
    List<HierarchicalConfiguration> nodes = xml.configurationsAt("rename");
    for (HierarchicalConfiguration node : nodes) {
        addRename(node.getString("[@fromField]", null), node.getString("[@toField]", null),
                node.getBoolean("[@overwrite]", false));
    }/*  w ww.j a  va2s.c o  m*/
}

From source file:com.vangent.hieos.empi.config.EUIDConfig.java

/**
 * // w  ww .ja  v  a2  s .  com
 * @param hc
 * @param empiConfig
 * @throws EMPIException
 */
public void load(HierarchicalConfiguration hc, EMPIConfig empiConfig) throws EMPIException {
    this.euidUniversalId = hc.getString(EUID_UNIVERSAL_ID);
    this.euidUniversalIdType = hc.getString(EUID_UNIVERSAL_ID_TYPE);
    this.euidAssignEnabled = hc.getBoolean(EUID_ASSIGN_ENABLED, true);
}

From source file:com.norconex.importer.handler.tagger.impl.CopyTagger.java

@Override
protected void loadHandlerFromXML(XMLConfiguration xml) throws IOException {
    List<HierarchicalConfiguration> nodes = xml.configurationsAt("copy");
    for (HierarchicalConfiguration node : nodes) {
        addCopyDetails(node.getString("[@fromField]", null), node.getString("[@toField]", null),
                node.getBoolean("[@overwrite]", false));
    }/*ww w . j  a  va  2  s . co m*/
}

From source file:com.norconex.importer.handler.AbstractImporterHandler.java

@Override
public final void loadFromXML(Reader in) throws IOException {
    XMLConfiguration xml = ConfigurationUtil.newXMLConfiguration(in);
    List<HierarchicalConfiguration> nodes = xml.configurationsAt("restrictTo");
    for (HierarchicalConfiguration node : nodes) {
        addRestriction(node.getString("[@field]"), node.getString("", null),
                node.getBoolean("[@caseSensitive]", false));
    }/*from  w  w w .ja v a2  s .c  om*/
    loadHandlerFromXML(xml);
}

From source file:com.norconex.importer.handler.tagger.impl.SplitTagger.java

@Override
protected void loadHandlerFromXML(XMLConfiguration xml) throws IOException {
    List<HierarchicalConfiguration> nodes = xml.configurationsAt("split");
    for (HierarchicalConfiguration node : nodes) {
        addSplit(node.getString("[@fromField]"), node.getString("[@toField]", null),
                node.getString("separator"), node.getBoolean("[@regex]", false));
    }/*from  w  w  w.  j  a v a  2 s. co m*/
}

From source file:com.vangent.hieos.empi.config.FieldConfig.java

/**
 *
 * @param hc//w w w  .ja va2 s .co  m
 * @param empiConfig
 * @throws EMPIException
 */
public void load(HierarchicalConfiguration hc, EMPIConfig empiConfig) throws EMPIException {
    this.name = hc.getString(FIELD_NAME);
    this.sourceObjectPath = hc.getString(SOURCE_OBJECT_PATH);
    this.matchDatabaseColumn = hc.getString(MATCH_DB_COLUMN);
    this.supersedesField = hc.getString(SUPERSEDES_FIELD);
    this.storeField = hc.getBoolean(STORE_FIELD, true);

    // Link up transforms.
    List transformFunctions = hc.configurationsAt(TRANSFORM_FUNCTIONS);
    for (Iterator it = transformFunctions.iterator(); it.hasNext();) {
        HierarchicalConfiguration hcTransformFunction = (HierarchicalConfiguration) it.next();
        String transformFunctionName = hcTransformFunction.getString(TRANSFORM_FUNCTION_NAME);
        TransformFunctionConfig transformFunctionConfig = this.getTransformFunctionConfig(empiConfig,
                hcTransformFunction, transformFunctionName);
        transformFunctionConfigs.add(transformFunctionConfig);
    }
}

From source file:com.norconex.importer.handler.tagger.impl.ReplaceTagger.java

@Override
protected void loadHandlerFromXML(XMLConfiguration xml) throws IOException {
    List<HierarchicalConfiguration> nodes = xml.configurationsAt("replace");
    for (HierarchicalConfiguration node : nodes) {
        addReplacement(node.getString("fromValue"), node.getString("toValue"), node.getString("[@fromField]"),
                node.getString("[@toField]", null), node.getBoolean("[@regex]", false));
    }//from   w  w w .  ja  v  a  2  s .com
}

From source file:banner.tagging.dictionary.DictionaryTagger.java

public void configure(HierarchicalConfiguration config, Tokenizer tokenizer) {
    HierarchicalConfiguration localConfig = config.configurationAt(this.getClass().getName());
    filterContainedMentions = localConfig.getBoolean("filterContainedMentions", false);
    normalizeMixedCase = localConfig.getBoolean("normalizeMixedCase", false);
    normalizeDigits = localConfig.getBoolean("normalizeDigits", false);
    generate2PartVariations = localConfig.getBoolean("generate2PartVariations", false);
    dropEndParentheticals = localConfig.getBoolean("dropEndParentheticals", false);
    stemTokens = localConfig.getBoolean("stemTokens", false);
    if (stemTokens) {
        stemmer = new PorterStemmer();
    }// w  w  w .  j av  a 2 s.c  om
    this.tokenizer = tokenizer;
}

From source file:com.norconex.importer.handler.tagger.impl.HierarchyTagger.java

@Override
protected void loadHandlerFromXML(XMLConfiguration xml) throws IOException {
    List<HierarchicalConfiguration> nodes = xml.configurationsAt("hierarchy");
    for (HierarchicalConfiguration node : nodes) {
        addHierarcyDetails(node.getString("[@fromField]", null), node.getString("[@toField]", null),
                node.getString("[@fromSeparator]", null), node.getString("[@toSeparator]", null),
                node.getBoolean("[@overwrite]", false));
    }/*from   w  w  w. ja  va  2s. c om*/
}