@Nonnull protected static ETriState getTriState (@Nullable final String sAttrValue, final boolean bDefault) { return sAttrValue == null ? ETriState.UNDEFINED : ETriState.valueOf (StringParser.parseBool (sAttrValue, bDefault)); } }
default boolean getAttributeValueAsBool (@Nullable final String sNamespaceURI, @Nullable final String sAttrName, final boolean bDefault) { return StringParser.parseBool (getAttributeValue (sNamespaceURI, sAttrName), bDefault); }
public boolean isUseSystemProxies () { return StringParser.parseBool (SystemProperties.getPropertyValueOrNull (SYSPROP_JAVA_NET_USE_SYSTEM_PROXIES), false); }
default boolean getAttributeValueAsBool (@Nullable final IMicroQName aAttrName, final boolean bDefault) { return StringParser.parseBool (getAttributeValue (aAttrName), bDefault); }
/** * Determine if the file access should be checked upon startup. By default * this is done by evaluating the servlet context init-parameter * {@link #INIT_PARAMETER_NO_CHECK_FILE_ACCESS}. * * @param aSC * The servlet context. Never <code>null</code>. * @return <code>true</code> if file access should be checked, * <code>false</code> otherwise. */ @OverrideOnDemand protected boolean shouldCheckFileAccess (@Nonnull final ServletContext aSC) { return !StringParser.parseBool (aSC.getInitParameter (INIT_PARAMETER_NO_CHECK_FILE_ACCESS)); }
@Override public void init () throws ServletException { super.init (); // encoding final String sEncoding = getFilterConfig ().getInitParameter (INITPARAM_ENCODING); if (StringHelper.hasText (sEncoding)) setEncoding (sEncoding); // force request encoding? String sForce = getFilterConfig ().getInitParameter (INITPARAM_FORCE_REQUEST_ENCODING); if (sForce != null) setForceRequestEncoding (StringParser.parseBool (sForce)); // force response encoding? sForce = getFilterConfig ().getInitParameter (INITPARAM_FORCE_RESPONSE_ENCODING); if (sForce != null) setForceResponseEncoding (StringParser.parseBool (sForce)); // force encoding? sForce = getFilterConfig ().getInitParameter (INITPARAM_FORCE_ENCODING); if (sForce != null) setForceEncoding (StringParser.parseBool (sForce)); }
@Nonnull public SMLInfo convertToNative (@Nonnull final IMicroElement aElement) { final String sID = aElement.getAttributeValue (ATTR_ID); final String sDisplayName = aElement.getAttributeValue (ATTR_DISPLAY_NAME); final String sDNSZone = MicroHelper.getChildTextContent (aElement, ELEMENT_DNS_ZONE); final String sManagementServiceURL = MicroHelper.getChildTextContent (aElement, ELEMENT_MANAGEMENT_SERVICE); final boolean bRequiresClientCert = StringParser.parseBool (aElement.getAttributeValue (ATTR_REQUIRES_CLIENT_CERT), SMLInfo.DEFAULT_CLIENT_CERTIFICATE_REQUIRED); return new SMLInfo (sID, sDisplayName, sDNSZone, sManagementServiceURL, bRequiresClientCert); } }
public static void readFromXML (@Nonnull final IMicroDocument aDoc, @Nonnull final Consumer <GoMappingItem> aCallback) { ValueEnforcer.notNull (aDoc, "Doc"); ValueEnforcer.notNull (aCallback, "Callback"); aDoc.getDocumentElement ().forAllChildElements (eItem -> { final String sTagName = eItem.getTagName (); final String sKey = eItem.getAttributeValue (ATTR_KEY); final String sHref = eItem.getAttributeValue (ATTR_HREF); final String sIsEditable = eItem.getAttributeValue (ATTR_EDITABLE); final boolean bIsEditable = StringParser.parseBool (sIsEditable, DEFAULT_EDITABLE); if (ELEMENT_EXTERNAL.equals (sTagName)) aCallback.accept (new GoMappingItem (sKey, false, sHref, bIsEditable)); else if (ELEMENT_INTERNAL.equals (sTagName)) aCallback.accept (new GoMappingItem (sKey, true, sHref, bIsEditable)); else LOGGER.error ("Unsupported go-mapping tag '" + sTagName + "'"); }); }
@Nonnull @ContainsSoftMigration public SystemMigrationResult convertToNative (@Nonnull final IMicroElement aElement) { final String sID = aElement.getAttributeValue (ATTR_MIGRATION_ID); LocalDateTime aExecLDT = aElement.getAttributeValueWithConversion (ATTR_EXECUTION_LDT, LocalDateTime.class); if (aExecLDT == null) { // Soft migration final ZonedDateTime aExecDT = aElement.getAttributeValueWithConversion ("executiondt", ZonedDateTime.class); if (aExecDT != null) aExecLDT = aExecDT.toLocalDateTime (); else throw new IllegalStateException ("No exceution date time found!"); } final String sSuccess = aElement.getAttributeValue (ATTR_SUCCESS); final boolean bSuccess = StringParser.parseBool (sSuccess); final String sErrorMsg = MicroHelper.getChildTextContent (aElement, ELEMENT_ERROR_MSG); return new SystemMigrationResult (sID, aExecLDT, bSuccess, sErrorMsg); } }
final ESuccess eSuccess = ESuccess.valueOf (StringParser.parseBool (sSuccess)); final String sAction = eItem.getTextContent ();
final boolean bSSLEnabled = StringParser.parseBool (sSSLEnabled, EmailGlobalSettings.isUseSSL ()); final boolean bSTARTTLSEnabled = StringParser.parseBool (sSTARTTLSEnabled, EmailGlobalSettings.isUseSTARTTLS ()); final boolean bDebugSMTP = StringParser.parseBool (sDebugSMTP, EmailGlobalSettings.isDebugSMTP ());
else if (sAttrName.equals (CSchematronXML.ATTR_ABSTRACT)) ret.setAbstract (StringParser.parseBool (sAttrValue)); else if (sAttrName.equals (CSchematronXML.ATTR_CONTEXT))
final String sEndpointReference = aElement.getAttributeValue (ATTR_ENDPOINT_REFERENCE); final String sRequireBusinessLevelSignature = aElement.getAttributeValue (ATTR_REQUIRE_BUSINESS_LEVEL_SIGNATURE); final boolean bRequireBusinessLevelSignature = StringParser.parseBool (sRequireBusinessLevelSignature, SMPEndpoint.DEFAULT_REQUIRES_BUSINESS_LEVEL_SIGNATURE); final String sMinimumAuthenticationLevel = aElement.getAttributeValue (ATTR_MINIMUM_AUTHENTICATION_LEVEL);
else if (sAttrName.equals (CSchematronXML.ATTR_ABSTRACT)) ret.setAbstract (StringParser.parseBool (sAttrValue)); else if (sAttrName.equals (CSchematronXML.ATTR_CONTEXT))
final String sEndpointReference = aElement.getAttributeValue (ATTR_ENDPOINT_REFERENCE); final String sRequireBusinessLevelSignature = aElement.getAttributeValue (ATTR_REQUIRE_BUSINESS_LEVEL_SIGNATURE); final boolean bRequireBusinessLevelSignature = StringParser.parseBool (sRequireBusinessLevelSignature, SMPEndpoint.DEFAULT_REQUIRES_BUSINESS_LEVEL_SIGNATURE); final String sMinimumAuthenticationLevel = aElement.getAttributeValue (ATTR_MINIMUM_AUTHENTICATION_LEVEL);
final boolean bDebugMode = StringParser.parseBool (getInitParameterDebug (aSC)); final boolean bProductionMode = StringParser.parseBool (getInitParameterProduction (aSC)); GlobalDebug.setDebugModeDirect (bDebugMode); GlobalDebug.setProductionModeDirect (bProductionMode); final boolean bNoStartupInfo = StringParser.parseBool (getInitParameterNoStartupInfo (aSC)); if (!bNoStartupInfo)
final LocalDateTime aStartDateTime = aElement.getAttributeValueWithConversion (ATTR_STARTDT, LocalDateTime.class); final LocalDateTime aEndDateTime = aElement.getAttributeValueWithConversion (ATTR_ENDDT, LocalDateTime.class); final ESuccess eExecSuccess = ESuccess.valueOf (StringParser.parseBool (aElement.getAttributeValue (ATTR_EXECSUCCESS))); final String sStartingUserID = aElement.getAttributeValue (ATTR_STARTINGUSERID); final IMultilingualText aJobDescription = MicroTypeConverter.convertToNative (aElement.getFirstChildElement (ELEMENT_DESCRIPTION),
final String sAttrValue = _getAttributeValue (sVal); if (sAttrName.equals (CSchematronXML.ATTR_ABSTRACT)) ret.setAbstract (StringParser.parseBool (sAttrValue)); else if (sAttrName.equals (CSchematronXML.ATTR_ID))
for (final IMicroElement eDetails : eFailedMail.getAllChildElements (ELEMENT_DETAILS)) final boolean bAddressValid = StringParser.parseBool (eDetails.getAttributeValue (ATTR_ADDRESS_VALID)); final String sAddress = eDetails.getAttributeValue (ATTR_ADDRESS); final String sCommand = eDetails.getAttributeValue (ATTR_COMMAND);
final String sAttrValue = _getAttributeValue (sVal); if (sAttrName.equals (CSchematronXML.ATTR_ABSTRACT)) ret.setAbstract (StringParser.parseBool (sAttrValue)); else if (sAttrName.equals (CSchematronXML.ATTR_ID))