/** * A String of text to postpend (add to the end) to the instanceId found in the * system property. * * @param postpend * the value to postpend, or null if none is desired. */ public void setPostpend (@Nullable final String postpend) { m_sPostpend = StringHelper.trim (postpend); }
@Nullable public String getValueTrimmed () { return StringHelper.trim (m_sValue); }
/** * A String of text to prepend (add to the beginning) to the instanceId found in * the system property. * * @param prepend * the value to prepend, or null if none is desired. */ public void setPrepend (@Nullable final String prepend) { m_sPrepend = StringHelper.trim (prepend); }
@Nonnull public CSSUnknownRule setBody (@Nullable final String sBody) { m_sBody = StringHelper.trim (sBody); return this; }
@Nonnull public CSSUnknownRule setParameterList (@Nullable final String sParameterList) { m_sParameterList = StringHelper.trim (sParameterList); return this; }
/** * Same as <code>getAsString</code> but with a trimmed return value. * * @param sFieldName * The field name to query. May be <code>null</code>. * @return <code>null</code> if no such parameter name is present. * @since 9.0.2 */ @Nullable default String getAsStringTrimmed (@Nullable final String sFieldName) { return StringHelper.trim (getAsString (sFieldName)); }
/** * Get the concatenated text content of all direct {@link IMicroText} child * nodes of this element. After concatenation, all leading and trailing spaces * are removed. * * @return <code>null</code> if the element contains no text node as child */ @Nullable default String getTextContentTrimmed () { return StringHelper.trim (getTextContent ()); }
/** * Utility method to get all tokens from a single value * * @param sValue * The value to use. May not be <code>null</code>. * @return An array of tokens to use. Never <code>null</code>. */ @Nonnull public static String [] getTokensFromValue (@Nonnull final String sValue) { return RegExHelper.getSplitToArray (StringHelper.trim (sValue), "\\W+"); } }
/** * Utility method to get all tokens from a single value * * @param sValue * The value to use. May not be <code>null</code>. * @return An array of tokens to use. Never <code>null</code>. */ @Nonnull public static String [] getTokensFromValue (@Nonnull final String sValue) { return RegExHelper.getSplitToArray (StringHelper.trim (sValue), "\\W+"); } }
/** * Utility method to get all tokens from a single value * * @param sValue * The value to use. May not be <code>null</code>. * @return An array of tokens to use. Never <code>null</code>. */ @Nonnull public static String [] getTokensFromValue (@Nonnull final String sValue) { return RegExHelper.getSplitToArray (StringHelper.trim (sValue), "\\W+"); } }
public AbstractSVRLMessage (@Nullable final List <DiagnosticReference> aDiagnosticReferences, @Nullable final String sText, @Nullable final String sLocation, @Nullable final String sTest, @Nullable final String sRole, @Nullable final IErrorLevel aFlag) { m_aDiagnosticReferences = new CommonsArrayList <> (aDiagnosticReferences); m_sText = StringHelper.trim (sText); m_sLocation = sLocation; m_sTest = sTest; m_sRole = sRole; m_aFlag = aFlag; }
public AbstractSVRLMessage (@Nullable final List <DiagnosticReference> aDiagnosticReferences, @Nullable final String sText, @Nullable final String sLocation, @Nullable final String sTest, @Nullable final String sRole, @Nullable final IErrorLevel aFlag) { m_aDiagnosticReferences = new CommonsArrayList <> (aDiagnosticReferences); m_sText = StringHelper.trim (sText); m_sLocation = sLocation; m_sTest = sTest; m_sRole = sRole; m_aFlag = aFlag; }
/** * Same as <code>getAsString</code> but with a trimmed return value. * * @param sFieldName * The field name to query. May be <code>null</code>. * @param sDefault * The value to be returned if the retrieved value is <code>null</code> . * @return <code>null</code> if no such parameter name is present. * @since 9.0.2 */ @Nullable default String getAsStringTrimmed (@Nullable final String sFieldName, @Nullable final String sDefault) { return StringHelper.trim (getAsString (sFieldName, sDefault)); } }
@Nullable public static CSSRGBA getParsedRGBAColorValue (@Nullable final String sValue) { final String sRealValue = StringHelper.trim (sValue); if (StringHelper.hasText (sRealValue) && sRealValue.startsWith (CCSSValue.PREFIX_RGBA)) { final String [] aValues = RegExHelper.getAllMatchingGroupValues (PATTERN_RGBA, sRealValue); if (aValues != null) return new CSSRGBA (aValues[0], aValues[1], aValues[2], aValues[3]); } return null; }
@Nullable public static CSSHSL getParsedHSLColorValue (@Nullable final String sValue) { final String sRealValue = StringHelper.trim (sValue); if (StringHelper.hasText (sRealValue) && sRealValue.startsWith (CCSSValue.PREFIX_HSL)) { final String [] aValues = RegExHelper.getAllMatchingGroupValues (PATTERN_HSL, sRealValue); if (aValues != null) return new CSSHSL (aValues[0], aValues[1], aValues[2]); } return null; }
/** * Check if the passed String is valid CSS hex color value. Example value: * <code>#ff0000</code> * * @param sValue * The value to check. May be <code>null</code>. * @return <code>true</code> if it is a CSS hex color value, * <code>false</code> if not */ public static boolean isHexColorValue (@Nullable final String sValue) { final String sRealValue = StringHelper.trim (sValue); return StringHelper.hasText (sRealValue) && sRealValue.charAt (0) == CCSSValue.PREFIX_HEX && RegExHelper.stringMatchesPattern (PATTERN_HEX, sRealValue); }
@Nullable public static CSSHSLA getParsedHSLAColorValue (@Nullable final String sValue) { final String sRealValue = StringHelper.trim (sValue); if (StringHelper.hasText (sRealValue) && sRealValue.startsWith (CCSSValue.PREFIX_HSLA)) { final String [] aValues = RegExHelper.getAllMatchingGroupValues (PATTERN_HSLA, sRealValue); if (aValues != null) return new CSSHSLA (aValues[0], aValues[1], aValues[2], aValues[3]); } return null; }
/** * Check if the passed String is valid CSS HSL color value. Example value: * <code>hsl(255,0%,0%)</code> * * @param sValue * The value to check. May be <code>null</code>. * @return <code>true</code> if it is a CSS HSL color value, * <code>false</code> if not */ public static boolean isHSLColorValue (@Nullable final String sValue) { final String sRealValue = StringHelper.trim (sValue); return StringHelper.hasText (sRealValue) && sRealValue.startsWith (CCSSValue.PREFIX_HSL) && RegExHelper.stringMatchesPattern (PATTERN_HSL, sRealValue); }
/** * Check if the passed value is a pure numeric value without a unit. * * @param sCSSValue * The value to be checked. May be <code>null</code> and is * automatically trimmed inside. * @return <code>true</code> if the passed value is a pure decimal numeric * value after trimming, <code>false</code> otherwise. */ public static boolean isNumberValue (@Nullable final String sCSSValue) { final String sRealValue = StringHelper.trim (sCSSValue); return StringHelper.hasText (sRealValue) && StringParser.isDouble (sRealValue); }
@Override public boolean canConvertToMicroNode (@Nonnull final IHCConversionSettingsToNode aConversionSettings) { if (m_sCachedJSCode == null) m_sCachedJSCode = StringHelper.trim (getJSCode (aConversionSettings.getJSWriterSettings ())); // Don't create script elements with empty content.... return StringHelper.hasText (m_sCachedJSCode); }