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.haulmont.cuba.gui.xml.layout.loaders.AccordionLoader.java

@Override
public void createComponent() {
    resultComponent = (Accordion) factory.createComponent(Accordion.NAME);
    loadId(resultComponent, element);/*  www. j  a  v a  2s  .  co  m*/

    //noinspection unchecked
    List<Element> tabElements = element.elements("tab");
    for (Element tabElement : tabElements) {
        final String name = tabElement.attributeValue("id");

        boolean lazy = Boolean.parseBoolean(tabElement.attributeValue("lazy"));
        ComponentLoader tabComponentLoader = getLoader(tabElement, TabComponentLoader.class);
        Accordion.Tab tab;
        if (lazy) {
            tab = resultComponent.addLazyTab(name, tabElement, tabComponentLoader);
        } else {
            tabComponentLoader.createComponent();

            Component tabComponent = tabComponentLoader.getResultComponent();

            tab = resultComponent.addTab(name, tabComponent);

            pendingLoadComponents.add(tabComponentLoader);
        }

        pendingLoadTabs.put(tabElement, tab);
    }
}

From source file:io.servicecomb.foundation.common.net.URIEndpointObject.java

public URIEndpointObject(String endpoint) {
    URI uri = URI.create(endpoint);
    setHostOrIp(uri.getHost());/*from w  w w .  j a  v  a  2 s. c o m*/
    if (uri.getPort() < 0) {
        // do not use default port
        throw new IllegalArgumentException("port not specified.");
    }
    setPort(uri.getPort());
    querys = splitQuery(uri);
    sslEnabled = Boolean.parseBoolean(getFirst(SSL_ENABLED_KEY));
}

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

@Override
public void createComponent() {
    resultComponent = (TabSheet) factory.createComponent(TabSheet.NAME);
    loadId(resultComponent, element);//  www  .j  av  a 2  s . co  m

    //noinspection unchecked
    List<Element> tabElements = element.elements("tab");
    for (Element tabElement : tabElements) {
        final String name = tabElement.attributeValue("id");

        boolean lazy = Boolean.parseBoolean(tabElement.attributeValue("lazy"));
        ComponentLoader tabComponentLoader = getLoader(tabElement, TabComponentLoader.class);
        TabSheet.Tab tab;
        if (lazy) {
            tab = resultComponent.addLazyTab(name, tabElement, tabComponentLoader);
        } else {
            tabComponentLoader.createComponent();

            Component tabComponent = tabComponentLoader.getResultComponent();

            tab = resultComponent.addTab(name, tabComponent);

            pendingLoadComponents.add(tabComponentLoader);
        }

        pendingLoadTabs.put(tabElement, tab);
    }
}

From source file:it.geosolutions.geoserver.jms.JMSApplicationListener.java

public static boolean getStatus(final ToggleType type, JMSConfiguration config) {
    Object statusObj;/* ww w . j a va  2s.  c o m*/
    if (type.equals(ToggleType.SLAVE)) {
        statusObj = config.getConfiguration(ToggleConfiguration.TOGGLE_SLAVE_KEY);
        if (statusObj == null) {
            statusObj = ToggleConfiguration.DEFAULT_SLAVE_STATUS;
        }
    } else {
        statusObj = config.getConfiguration(ToggleConfiguration.TOGGLE_MASTER_KEY);
        if (statusObj == null) {
            statusObj = ToggleConfiguration.DEFAULT_MASTER_STATUS;
        }
    }
    return Boolean.parseBoolean(statusObj.toString());
}

From source file:com.qpark.maven.plugin.springconfig.MainApplicationContextXmlGenerator.java

/**
 * @param config/*from ww w. ja v a  2 s.  c  o  m*/
 * @param elementTypes
 */
public MainApplicationContextXmlGenerator(final String basePackageName,
        final String applicationWithoutPersistenceConfig, final File outputDirectory,
        final MavenProject project, final String eipVersion, final Log log) {
    this.basePackageName = basePackageName;
    this.outputDirectory = outputDirectory;
    this.project = project;
    this.eipVersion = eipVersion;
    this.log = log;
    this.applicationWithoutPersistenceConfig = Boolean.parseBoolean(
            applicationWithoutPersistenceConfig != null ? applicationWithoutPersistenceConfig : "false");
}

From source file:edu.jhu.pha.vospace.jobs.JobsProcessorServlet.java

@Override
public void init() throws ServletException {
    String runJobsProc = getServletConfig().getInitParameter("processJobs");
    if (null == runJobsProc || Boolean.parseBoolean(runJobsProc)) {
        processor.start();/*  ww w  . j av  a2  s.co m*/
    }
}

From source file:net.asfun.jangod.base.Application.java

public Application(String configFile) {
    if (configFile == null)
        config = Configuration.getDefault().clone();
    else//from ww w.j  a v a 2 s. c o  m
        config = ConfigInitializer.getConfig(configFile);
    String ima = config.getProperty("isMacroOn", Constants.STR_TRUE);
    try {
        isMacroOn = Boolean.parseBoolean(ima);
    } catch (Exception e) {
        JangodLogger.warning("Config wrong boolean for isMacroOn(use default) >>> " + ima);
    }
    parseResultManager = new ParseResultManager(this);
}

From source file:org.createnet.raptor.models.data.types.BooleanRecord.java

@Override
public Boolean parseValue(Object value) {
    try {/*from w  ww  .j  a v  a 2 s.c o m*/

        if (value instanceof Boolean) {
            return (Boolean) value;
        }

        if (value instanceof JsonNode) {
            JsonNode node = (JsonNode) value;
            if (node.isBoolean()) {
                return node.asBoolean();
            }
        }

        if (value instanceof String) {
            return Boolean.parseBoolean((String) value);
        }

        return (Boolean) value;
    } catch (Exception e) {
        throw new RaptorComponent.ParserException(e);
    }
}

From source file:code.google.nfs.rpc.mina2.client.MinaClientFactory.java

private MinaClientFactory() {
    // only one ioConnector,avoid create too many io processor thread
    ioConnector = new NioSocketConnector(processorCount);
    //        ioConnector.getFilterChain().addLast("executor", new ExecutorFilter(Executors.newCachedThreadPool()));
    ioConnector.getSessionConfig()// w ww.  j a  v a  2  s  . co m
            .setTcpNoDelay(Boolean.parseBoolean(System.getProperty("nfs.rpc.tcp.nodelay", "true")));
    ioConnector.getSessionConfig().setReuseAddress(true);
    ioConnector.getFilterChain().addLast("objectserialize", new MinaProtocolCodecFilter());
}

From source file:jrouter.servlet.filter.SpringJRouterFilter.java

@Override
public void init(FilterConfig filterConfig) {
    String useSpring = filterConfig.getInitParameter("useSpringObjectFactory");
    //default true if not set
    if (useSpring != null)
        useSpringObjectFactory = Boolean.parseBoolean(useSpring);
    super.init(filterConfig);
}