@Nonnull public HCTextNode prependText (@Nullable final String sText) { if (StringHelper.hasText (sText)) m_sText = sText + m_sText; return this; }
@Transient @Nonnull public String getDisplayName () { if (StringHelper.hasText (m_sPersonal)) return m_sPersonal + " <" + m_sAddress + ">"; return m_sAddress; }
/** * Get the first character of the passed character sequence * * @param aCS * The source character sequence * @return {@link CGlobal#ILLEGAL_CHAR} if the passed sequence was empty */ public static char getFirstChar (@Nullable final CharSequence aCS) { return hasText (aCS) ? aCS.charAt (0) : CGlobal.ILLEGAL_CHAR; }
public ComparatorCellString (@Nullable final Locale aParseLocale, @Nullable final String sCommonPrefix, @Nullable final String sCommonSuffix) { super (aParseLocale); m_sCommonPrefix = StringHelper.hasText (sCommonPrefix) ? sCommonPrefix : null; m_sCommonSuffix = StringHelper.hasText (sCommonSuffix) ? sCommonSuffix : null; }
@Nullable public CSSDeclaration getDeclarationOfPropertyName (@Nullable final String sPropertyName) { if (StringHelper.hasText (sPropertyName)) for (final CSSDeclaration aDecl : m_aDeclarations) if (aDecl.getProperty ().equals (sPropertyName)) return aDecl; return null; }
@Nullable public CSSDeclaration getDeclarationOfPropertyNameCaseInsensitive (@Nullable final String sPropertyName) { if (StringHelper.hasText (sPropertyName)) for (final CSSDeclaration aDecl : m_aDeclarations) if (aDecl.getProperty ().equalsIgnoreCase (sPropertyName)) return aDecl; return null; }
public boolean isValidPostalCode (@Nullable final String sPostalCode) { if (StringHelper.hasText (sPostalCode)) for (final PostalCodeFormat aFormat : m_aFormats) if (aFormat.isValidPostalCode (sPostalCode)) return true; return m_aFormats.isEmpty (); }
@Override public void onContentElementWhitespace (@Nullable final CharSequence aWhitespaces) { if (StringHelper.hasText (aWhitespaces)) _append (aWhitespaces.toString ()); }
@Nullable public DataTablesServerDataRow getRowOfID (@Nullable final String sID) { if (StringHelper.hasText (sID)) for (final DataTablesServerDataRow aRow : m_aRows) if (sID.equals (aRow.getRowID ())) return aRow; return null; }
@Nonnull @ReturnsMutableCopy public List <CSSDeclaration> getAllDeclarationsOfPropertyName (@Nullable final String sPropertyName) { final List <CSSDeclaration> ret = new ArrayList <CSSDeclaration> (); if (StringHelper.hasText (sPropertyName)) for (final CSSDeclaration aDecl : m_aDeclarations) if (aDecl.getProperty ().equals (sPropertyName)) ret.add (aDecl); return ret; }
@Nonnull public Collection <? extends IMicroElement> getChildren (@Nullable final IMicroElement aCurrent) { // Not an element? if (aCurrent == null) return new ArrayList <IMicroElement> (); // Namespace URI defined? if (StringHelper.hasText (m_sNamespaceURI)) return aCurrent.getAllChildElements (m_sNamespaceURI, m_sTagName); return aCurrent.getAllChildElements (m_sTagName); } }
private static void _initialFillCache () { for (final Locale aLocale : LocaleCache.getAllLocales ()) { final String sCountry = aLocale.getCountry (); if (StringHelper.hasText (sCountry)) addCountry (sCountry); } }
@Override public boolean canConvertToNode (@Nonnull final IHCConversionSettingsToNode aConversionSettings) { m_sJSCode = StringHelper.trim (getJSCode ()); // Don't create script elements with empty content.... return StringHelper.hasText (m_sJSCode); }
@Nullable public static EPostalCodeFormatElement getFromString (@Nullable final String sString, final int nIndex) { if (StringHelper.hasText (sString)) for (final EPostalCodeFormatElement eElement : values ()) if (sString.substring (nIndex, nIndex + eElement.getTokenLength ()).equals (eElement.getToken ())) return eElement; return null; } }
@Override public void onComment (@Nullable final String sComment) { if (StringHelper.hasText (sComment)) { if (isThrowExceptionOnNestedComments ()) if (sComment.contains (COMMENT_START) || sComment.contains (COMMENT_END)) throw new IllegalArgumentException ("XML comment contains nested XML comment: " + sComment); _append (COMMENT_START)._append (sComment)._append (COMMENT_END); } }
private static String getTrackingOptOutMessage (@Nullable final Locale aDisplayLocale, @Nullable final String sTrackingOptOutMessage) { if (StringHelper.hasText (sTrackingOptOutMessage)) { return sTrackingOptOutMessage; } String sMsg = EText.MSG_TRACKING_OPT_OUT.getTextWithLocaleFallback (aDisplayLocale == null ? TextProvider.EN : aDisplayLocale); return StringHelper.getNotNull (sMsg, EText.MSG_TRACKING_OPT_OUT.getTextWithLocaleFallback (TextProvider.EN)); }
/** * Class to create navigator instance (default: $JssorBulletNavigator$) */ public ArrowNavigatorOptions setClass (final String sClass) { if (StringHelper.hasText (sClass)) { this.m_aOptions.setKeywordProperty (EArrowNavigatorOptions.CLASS.getID (), sClass); } return this; }
@Override public final HCDiv build () { final HCDiv aNode = new HCDiv (); if (StringHelper.hasText (this.m_sUsage)) { aNode.setCustomAttr (ATTRIBUTE_USAGE, this.m_sUsage); } onBuildNode (aNode); return aNode; }
@Override protected void applyProperties (final IMicroElement aElement, final IHCConversionSettingsToNode aConversionSettings) { super.applyProperties (aElement, aConversionSettings); if (StringHelper.hasText (m_sHref)) aElement.setAttribute (CHTMLAttributes.HREF, m_sHref); if (m_aTarget != null) aElement.setAttribute (CHTMLAttributes.TARGET, m_aTarget.getAttrValue ()); }
@Override protected void applyProperties (final IMicroElement aElement, final IHCConversionSettingsToNode aConversionSettings) { super.applyProperties (aElement, aConversionSettings); if (StringHelper.hasText (m_sMediaQuery)) aElement.setAttribute (CHTMLAttributes.MEDIA, m_sMediaQuery); if (m_aSrc != null) aElement.setAttribute (CHTMLAttributes.SRC, m_aSrc.getAsString ()); if (m_aType != null) aElement.setAttribute (CHTMLAttributes.TYPE, m_aType.getAsString ()); } }