List of usage examples for java.lang Boolean parseBoolean
public static boolean parseBoolean(String s)
From source file:org.opencredo.esper.integration.config.xml.EsperWireTapParser.java
private void initialiseSendContextProperty(Element element, BeanDefinitionBuilder builder) { String sendContext = element.getAttribute(EsperIntegrationNamespaceUtils.SEND_CONTEXT_ATTRIBUTE_NAME); if ((sendContext != null) && (!"".equals(sendContext))) { builder.addPropertyValue("sendContext", Boolean.parseBoolean(sendContext)); }// w w w. java2 s .c om }
From source file:com.navercorp.pinpoint.web.dao.ibatis.DefaultBindingLogFormatter.java
@Override public void setProperties(Properties properties) { if (properties == null) { return;//from w ww . j a v a 2s. c om } String removeWhitespace = properties.getProperty("removeWhitespace"); if (removeWhitespace != null) { if (logger.isInfoEnabled()) { logger.info("DefaultBindingLogFormatter removeWhitespace:" + removeWhitespace); } this.removeWhitespace = Boolean.parseBoolean(removeWhitespace); } }
From source file:rest.ShipmentREST.java
private Shipment getFormattedDataSingle(Response response) { String responseJson = response.readEntity(String.class); System.out.println(responseJson); ObjectMapper mapper = new ObjectMapper(); TypeReference<HashMap<String, Object>> typeReference = new TypeReference<HashMap<String, Object>>() { };/*from w w w. j a v a 2 s. c om*/ StringBuilder sb = new StringBuilder(); try { HashMap<String, Object> map = mapper.readValue(responseJson, typeReference); if (Boolean.parseBoolean(map.get("found").toString())) { return Shipment.parseShipment(map); // } else { return null; } } catch (Exception e) { return null; } }
From source file:com.lucidworks.security.authentication.server.PseudoAuthenticationHandler.java
/** * Initializes the authentication handler instance. * <p/>// w w w .jav a2s . c o m * This method is invoked by the {@link AuthenticationFilter#init} method. * * @param config configuration properties to initialize the handler. * * @throws ServletException thrown if the handler could not be initialized. */ @Override public void init(Properties config) throws ServletException { acceptAnonymous = Boolean.parseBoolean(config.getProperty(ANONYMOUS_ALLOWED, "false")); }
From source file:org.whitesource.teamcity.server.GlobalSettingsController.java
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response, Element xmlResponse) { Loggers.SERVER.info(WssUtils.logMsg("GlobalSettingsController", "doPost")); ActionErrors errors = validate(request); if (errors.hasErrors()) { Loggers.SERVER/*from w w w .j ava 2s .c o m*/ .warn(WssUtils.logMsg("GlobalSettingsController", errors.getErrors().size() + " Errors:")); for (ActionErrors.Error error : errors.getErrors()) { Loggers.SERVER.warn(WssUtils.logMsg("GlobalSettingsController", error.getMessage())); } errors.serialize(xmlResponse); return; } final GlobalSettings settings = new GlobalSettings(); settings.setOrgToken(request.getParameter("orgToken")); settings.setCheckPolicies(Boolean.parseBoolean(request.getParameter("checkPolicies"))); settings.setServiceUrl(request.getParameter("serviceUrl")); String proxyHost = request.getParameter("proxyHost"); if (!StringUtil.isEmptyOrSpaces(proxyHost)) { ProxySettings proxy = new ProxySettings(); proxy.setHost(proxyHost); String proxyPort = request.getParameter("proxyPort"); if (StringUtil.isNumber(proxyPort)) { proxy.setPort(Integer.parseInt(proxyPort)); } proxy.setUsername(request.getParameter("proxyUsername")); String encryptedPassword = request.getParameter("encryptedProxyPassword"); if (!StringUtil.isEmptyOrSpaces(encryptedPassword)) { proxy.setPassword(RSACipher.decryptWebRequestData(encryptedPassword)); } settings.setProxy(proxy); } settingsManager.setGlobalSettings(settings); settingsManager.save(); getOrCreateMessages(request).addMessage("settingsSaved", "Settings saved successfully."); }
From source file:rest.ChecklistREST.java
private Checklist getFormattedDataSingle(Response response) { String responseJson = response.readEntity(String.class); System.out.println(responseJson); ObjectMapper mapper = new ObjectMapper(); TypeReference<HashMap<String, Object>> typeReference = new TypeReference<HashMap<String, Object>>() { };/*ww w .j av a2 s .c o m*/ StringBuilder sb = new StringBuilder(); try { HashMap<String, Object> map = mapper.readValue(responseJson, typeReference); if (Boolean.parseBoolean(map.get("found").toString())) { return Checklist.parseChecklist(map); // } else { return null; } } catch (Exception e) { return null; } }
From source file:com.haulmont.cuba.gui.xml.layout.loaders.FilterLoader.java
@Override public void loadComponent() { assignXmlDescriptor(resultComponent, element); assignFrame(resultComponent);//w ww. j a v a 2 s .c o m loadAlign(resultComponent, element); loadVisible(resultComponent, element); loadEnable(resultComponent, element); loadStyleName(resultComponent, element); loadMargin(resultComponent, element); loadIcon(resultComponent, element); loadCaption(resultComponent, element); loadDescription(resultComponent, element); loadWidth(resultComponent, element, "100%"); loadCollapsible(resultComponent, element, true); loadSettingsEnabled(resultComponent, element); loadBorderVisible(resultComponent, element); String useMaxResults = element.attributeValue("useMaxResults"); resultComponent.setUseMaxResults(useMaxResults == null || Boolean.parseBoolean(useMaxResults)); String textMaxResults = element.attributeValue("textMaxResults"); resultComponent.setTextMaxResults(Boolean.parseBoolean(textMaxResults)); final String manualApplyRequired = element.attributeValue("manualApplyRequired"); resultComponent.setManualApplyRequired(BooleanUtils.toBooleanObject(manualApplyRequired)); String editable = element.attributeValue("editable"); resultComponent.setEditable(editable == null || Boolean.parseBoolean(editable)); String columnsCount = element.attributeValue("columnsCount"); if (!Strings.isNullOrEmpty(columnsCount)) { resultComponent.setColumnsCount(Integer.parseInt(columnsCount)); } String folderActionsEnabled = element.attributeValue("folderActionsEnabled"); if (folderActionsEnabled != null) { resultComponent.setFolderActionsEnabled(Boolean.parseBoolean(folderActionsEnabled)); } String datasource = element.attributeValue("datasource"); if (!StringUtils.isBlank(datasource)) { CollectionDatasource ds = (CollectionDatasource) context.getDsContext().get(datasource); if (ds == null) { throw new GuiDevelopmentException("Can't find datasource by name: " + datasource, context.getCurrentFrameId()); } resultComponent.setDatasource(ds); } Frame frame = context.getFrame(); String applyTo = element.attributeValue("applyTo"); if (!StringUtils.isEmpty(applyTo)) { context.addPostInitTask((context1, window) -> { Component c = frame.getComponent(applyTo); if (c == null) { throw new GuiDevelopmentException("Can't apply component to component with ID: " + applyTo, context1.getFullFrameId()); } resultComponent.setApplyTo(c); }); } String modeSwitchVisible = element.attributeValue("modeSwitchVisible"); resultComponent.setModeSwitchVisible(modeSwitchVisible == null || Boolean.parseBoolean(modeSwitchVisible)); context.addPostInitTask((context1, window) -> { ((FilterImplementation) resultComponent).loadFiltersAndApplyDefault(); String defaultMode = element.attributeValue("defaultMode"); if (defaultMode != null && "fts".equals(defaultMode)) { resultComponent.switchFilterMode(FilterDelegate.FilterMode.FTS_MODE); } }); }
From source file:com.searchcode.app.jobs.repository.IndexGitRepoJob.java
public IndexGitRepoJob(SharedService sharedService) { this.GIT_BINARY_PATH = Properties.getProperties().getProperty(Values.GITBINARYPATH, Values.DEFAULTGITBINARYPATH); this.USE_SYSTEM_GIT = Boolean.parseBoolean( Properties.getProperties().getProperty(Values.USESYSTEMGIT, Values.DEFAULTUSESYSTEMGIT)); File f = new File(this.GIT_BINARY_PATH); if (this.USE_SYSTEM_GIT && !f.exists()) { Singleton.getLogger().warning(//w w w. j a v a 2 s. c o m "\n///////////////////////////////////////////////////////////////////////////\n// Property git_binary_path in properties file appears to be incorrect. //\n// Please check the path. Falling back to internal git implementation. //\n///////////////////////////////////////////////////////////////////////////"); this.USE_SYSTEM_GIT = false; } this.sharedService = sharedService; }
From source file:at.amartinz.hardware.knox.KnoxInformation.java
private static boolean getBooleanProp(String property) { String result = getProp(property, "false"); if (TextUtils.isEmpty(result)) { return false; }//from w w w . j av a 2 s.co m result = result.toLowerCase(); return "true".equals(result) || "1".equals(result) || Boolean.parseBoolean(result); }
From source file:com.amazonaws.services.s3.internal.ObjectRestoreHeaderHandler.java
private Boolean parseBoolean(String restoreHeader) { Matcher matcher = ongoingPattern.matcher(restoreHeader); if (matcher.find()) { String ongoingRestore = matcher.group(1); return Boolean.parseBoolean(ongoingRestore); }/*from ww w . j a v a 2 s .c om*/ return null; }