Example usage for java.lang Boolean parseBoolean

List of usage examples for java.lang Boolean parseBoolean

Introduction

In this page you can find the example usage for java.lang Boolean parseBoolean.

Prototype

public static boolean parseBoolean(String s) 

Source Link

Document

Parses the string argument as a boolean.

Usage

From source file:com.antonjohansson.svncommit.core.config.Configuration.java

/**
 * Constructs a new {@link Configuration} with properties read from the given file.
 *
 * @param configurationFile The file to read properties from.
 *///  w  w  w  . ja va  2 s .c  o m
public Configuration(File configurationFile) {
    try {
        Properties properties = new Properties();
        properties.load(FileUtils.openInputStream(configurationFile));

        this.replicationEnabled = Boolean.parseBoolean(properties.getProperty("replication-enabled"));
    } catch (IOException e) {
        throw new RuntimeException("Could not read configuration file", e);
    }
}

From source file:com.haulmont.cuba.gui.xml.layout.loaders.OptionsListLoader.java

protected void loadNullOptionVisible(OptionsList resultComponent, Element element) {
    String nullOptionVisible = element.attributeValue("nullOptionVisible");
    if (StringUtils.isNotEmpty(nullOptionVisible)) {
        resultComponent.setNullOptionVisible(Boolean.parseBoolean(nullOptionVisible));
    }/*from   w  w  w.  j a v  a 2 s . c  o m*/
}

From source file:com.clican.pluto.dataprocess.spring.parser.TimerProcessorParser.java

@SuppressWarnings("unchecked")

public void customiseBeanDefinition(BeanDefinition beanDef, Element element, ParserContext parserContext) {
    String cronExpression = element.getAttribute("cronExpression");
    String startTime = element.getAttribute("startTime");
    String endTime = element.getAttribute("endTime");
    String taskScheduler = element.getAttribute("taskScheduler");
    String concurrent = element.getAttribute("concurrent");
    if (StringUtils.isEmpty(taskScheduler)) {
        taskScheduler = "taskScheduler";
    }/*ww  w  . j  a v  a 2s  .  c  om*/
    String stepCommit = element.getAttribute("stepCommit");
    if (StringUtils.isNotEmpty(stepCommit)) {
        beanDef.getPropertyValues().addPropertyValue("stepCommit", Boolean.parseBoolean(stepCommit));
    }
    beanDef.getPropertyValues().addPropertyValue("cronExpression", cronExpression);
    beanDef.getPropertyValues().addPropertyValue("startTime", startTime);
    beanDef.getPropertyValues().addPropertyValue("endTime", endTime);
    beanDef.getPropertyValues().addPropertyValue("taskScheduler", new RuntimeBeanReference(taskScheduler));
    if (StringUtils.isNotEmpty(concurrent)) {
        beanDef.getPropertyValues().addPropertyValue("concurrent", Boolean.parseBoolean(concurrent));
    }
    String[] timerProcessors = element.getAttribute("timerProcessors").split(",");
    List partitionProcessorList = new ManagedList();
    for (String timerProcessor : timerProcessors) {
        partitionProcessorList.add(new RuntimeBeanReference(timerProcessor.trim()));
    }
    beanDef.getPropertyValues().addPropertyValue("timerProcessors", partitionProcessorList);

}

From source file:com.haulmont.cuba.gui.xml.layout.loaders.TimeFieldLoader.java

@Override
public void loadComponent() {
    super.loadComponent();

    String timeFormat = element.attributeValue("timeFormat");
    if (StringUtils.isNotEmpty(timeFormat)) {
        timeFormat = loadResourceString(timeFormat);
        resultComponent.setFormat(timeFormat);
    }//ww w  .jav  a2  s  .  c o  m

    String showSeconds = element.attributeValue("showSeconds");
    if (StringUtils.isNotEmpty(showSeconds)) {
        resultComponent.setShowSeconds(Boolean.parseBoolean(showSeconds));
    }

    loadTabIndex(resultComponent, element);
    loadBuffered(resultComponent, element);
}

From source file:org.auraframework.test.configuration.JettyTestServletConfig.java

public JettyTestServletConfig() throws Exception {
    String host;//from  www.  j a  v a 2  s  . c  o m
    int port;
    boolean spawnJetty = Boolean.parseBoolean(System.getProperty("jetty.spawn", "false"));
    if (spawnJetty) {
        Server server = AuraJettyServer.getInstance();
        Connector connector = server.getConnectors()[0];
        port = connector.getPort();
        host = connector.getHost();
        if (host == null) {
            try {
                host = InetAddress.getLocalHost().getHostName();
            } catch (UnknownHostException e) {
                host = "localhost";
            }
        }
        System.out.println(String.format("Starting Jetty on %s:%s", host, port));
        server.start();
    } else {
        port = Integer.parseInt(System.getProperty("jetty.port", "9090"));
        host = System.getProperty("jetty.host");
        if (host == null) {
            try {
                host = InetAddress.getLocalHost().getHostName();
            } catch (UnknownHostException e) {
                host = "localhost";
            }
        }
    }
    baseUrl = new URL("http", host, port, "/");
    System.out.println(String.format("BaseUrl: %s", baseUrl));
}

From source file:com.amalto.core.servlet.TransactionsGuardFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    throwExceptions.put(Phase.BEFORE,//from  w  w w .  j  a v a2s .com
            Boolean.parseBoolean(filterConfig.getInitParameter(Phase.BEFORE.getFilterConfig())));
    throwExceptions.put(Phase.AFTER,
            Boolean.parseBoolean(filterConfig.getInitParameter(Phase.AFTER.getFilterConfig())));
}

From source file:com.haulmont.cuba.gui.xml.layout.loaders.GroupTableLoader.java

@Override
public void loadComponent() {
    super.loadComponent();

    String fixedGroupingString = element.attributeValue("fixedGrouping");
    if (StringUtils.isNotEmpty(fixedGroupingString)) {
        resultComponent.setFixedGrouping(Boolean.parseBoolean(fixedGroupingString));
    }//  w w  w .j  a v  a2 s  . c  o  m
}

From source file:com.haulmont.cuba.gui.xml.layout.loaders.LabelLoader.java

@Override
public void loadComponent() {
    assignXmlDescriptor(resultComponent, element);
    assignFrame(resultComponent);/*from  w  w  w .j  a v a  2s  .c  om*/

    loadDatasource(resultComponent, element);

    loadVisible(resultComponent, element);
    loadAlign(resultComponent, element);
    loadStyleName(resultComponent, element);

    String htmlEnabled = element.attributeValue("htmlEnabled");
    if (StringUtils.isNotEmpty(htmlEnabled)) {
        resultComponent.setHtmlEnabled(Boolean.parseBoolean(htmlEnabled));
    }

    String caption = element.attributeValue("value");
    if (StringUtils.isNotEmpty(caption)) {
        caption = loadResourceString(caption);
        resultComponent.setValue(caption);
    }

    loadCaption(resultComponent, element);
    loadDescription(resultComponent, element);

    loadIcon(resultComponent, element);

    loadWidth(resultComponent, element, Component.AUTO_SIZE);
    loadHeight(resultComponent, element, Component.AUTO_SIZE);

    loadResponsive(resultComponent, element);

    resultComponent.setFormatter(loadFormatter(element));
}

From source file:org.openmrs.module.mirebalaismetadata.MetadataManager.java

/**
 * Inspired from kenyacore and kenyaemr, this loads metadata bundles.
 * TODO: Extract out classes fron kenyaemr into common classes that can be used by broader implementations
 */// w  w w.j a  v a  2  s .  c  om
public synchronized void refresh() {
    // Allow skipping of metadata refresh - useful for developers
    if (Boolean.parseBoolean(System.getProperty(SYSTEM_PROPERTY_SKIP_REFRESH))) {
        log.warn("Skipping metadata refresh");
        return;
    }

    // Install bundle components
    deployService.installBundles(Context.getRegisteredComponents(MetadataBundle.class));
}

From source file:com.google.blockly.model.FieldCheckbox.java

@Override
public boolean setFromString(String text) {
    setChecked(Boolean.parseBoolean(text));
    return true;
}