javax.annotation.RegEx#com.helger.commons.annotation.Nonempty源码实例Demo

下面列出了javax.annotation.RegEx#com.helger.commons.annotation.Nonempty 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: ph-css   文件: CSSSelectorMemberNot.java
@Nonnull
@Nonempty
public String getAsCSSString (@Nonnull final ICSSWriterSettings aSettings, @Nonnegative final int nIndentLevel)
{
  aSettings.checkVersionRequirements (this);

  final boolean bOptimizedOutput = aSettings.isOptimizedOutput ();
  final StringBuilder aSB = new StringBuilder (":not(");
  boolean bFirst = true;
  for (final CSSSelector aNestedSelector : m_aNestedSelectors)
  {
    if (bFirst)
      bFirst = false;
    else
      aSB.append (bOptimizedOutput ? "," : ", ");
    aSB.append (aNestedSelector.getAsCSSString (aSettings, 0));
  }
  return aSB.append (')').toString ();
}
 
源代码2 项目: ph-css   文件: CSSNamespaceRule.java
@Nonnull
@Nonempty
public String getAsCSSString (@Nonnull final ICSSWriterSettings aSettings, @Nonnegative final int nIndentLevel)
{
  // Always ignore namespace rules?
  if (!aSettings.isWriteNamespaceRules ())
    return "";

  final StringBuilder aSB = new StringBuilder ();
  aSB.append ("@namespace ");
  if (StringHelper.hasText (m_sPrefix))
    aSB.append (m_sPrefix).append (' ');
  if (StringHelper.hasText (m_sURL))
    aSB.append (CSSURLHelper.getAsCSSURL (m_sURL, false));
  else
    aSB.append ("\"\"");
  return aSB.append (';').append (aSettings.getNewLineString ()).toString ();
}
 
源代码3 项目: ph-css   文件: LoggingCSSParseErrorHandler.java
/**
 * Create a common string to be used for unexpected rules.
 *
 * @param aCurrentToken
 *        The current token that caused an error. Never <code>null</code>.
 * @param sRule
 *        The name of the rule. Always starts with a '@'. May neither be
 *        <code>null</code> nor empty.
 * @param sMsg
 *        The custom error message. Neither <code>null</code> nor empty.
 * @return The concatenated string with source location, rule and message. May
 *         neither be <code>null</code> nor empty.
 */
@Nonnull
@Nonempty
public static String createLoggingStringUnexpectedRule (@Nonnull final Token aCurrentToken,
                                                        @Nonnull @Nonempty final String sRule,
                                                        @Nonnull @Nonempty final String sMsg)
{
  return "[" +
         aCurrentToken.beginLine +
         ":" +
         aCurrentToken.beginColumn +
         "] Unexpected rule '" +
         sRule +
         "': " +
         sMsg;
}
 
源代码4 项目: ph-css   文件: LoggingCSSParseErrorHandler.java
@Nonnull
@Nonempty
public static String createLoggingStringBrowserCompliantSkip (@Nullable final ParseException ex,
                                                              @Nonnull final Token aFromToken,
                                                              @Nonnull final Token aToToken)
{
  String ret = "Browser compliant mode skipped CSS from [" +
               aFromToken.beginLine +
               ":" +
               aFromToken.beginColumn +
               "] starting at token '" +
               aFromToken.image +
               "' until [" +
               aToToken.endLine +
               ":" +
               aToToken.endColumn +
               "] to token '" +
               aToToken.image +
               "'";
  if (ex != null)
    ret += " (based on " + ex.getClass ().getName () + ": " + ex.getMessage () + ")";
  return ret;
}
 
源代码5 项目: ph-commons   文件: XMLWriterSettings.java
@Nonnull
public final XMLWriterSettings setIndentationString (@Nonnull @Nonempty final String sIndentationString)
{
  m_sIndentationString = ValueEnforcer.notEmpty (sIndentationString, "IndentationString");
  m_sIndentationStringToString = null;
  return this;
}
 
源代码6 项目: ph-commons   文件: MimeTypeInfoManager.java
/**
 * Get all mime types that are associated to the extension of the specified
 * filename.
 *
 * @param sFilename
 *        The filename to search. May neither be <code>null</code> nor empty.
 * @return Never <code>null</code> but maybe empty set if no mime type is
 *         associated with the extension of the passed filename.
 */
@Nonnull
@ReturnsMutableCopy
public ICommonsSet <String> getAllMimeTypeStringsForFilename (@Nonnull @Nonempty final String sFilename)
{
  ValueEnforcer.notEmpty (sFilename, "Filename");

  final String sExtension = FilenameHelper.getExtension (sFilename);
  return getAllMimeTypeStringsForExtension (sExtension);
}
 
源代码7 项目: ph-css   文件: CSSRGBA.java
/**
 * @return opacity part
 */
@Nonnull
@Nonempty
public String getOpacity ()
{
  return m_sOpacity;
}
 
源代码8 项目: ph-css   文件: CSSMediaExpression.java
@Nonnull
@Nonempty
public String getAsCSSString (@Nonnull final ICSSWriterSettings aSettings, @Nonnegative final int nIndentLevel)
{
  aSettings.checkVersionRequirements (this);

  final StringBuilder aSB = new StringBuilder ();
  aSB.append ('(').append (m_sFeature);
  if (m_aValue != null)
    aSB.append (CCSS.SEPARATOR_PROPERTY_VALUE).append (m_aValue.getAsCSSString (aSettings, nIndentLevel));
  return aSB.append (')').toString ();
}
 
源代码9 项目: ph-commons   文件: IURLParameterList.java
@Nonnull
default IMPLTYPE add (@Nonnull @Nonempty final String sName, @Nullable final String sValue)
{
  // Ensure the parameter is kept - maybe without a value
  add (new URLParameter (sName, sValue != null ? sValue : ""));
  return thisAsT ();
}
 
源代码10 项目: ph-css   文件: CSSPropertyCustomizerBorderRadius.java
@Nullable
public ICSSValue createSpecialValue (@Nonnull final ICSSProperty aProperty,
                                     @Nonnull @Nonempty final String sValue,
                                     final boolean bIsImportant)
{
  return new CSSValueMultiProperty (aProperty.getProp (),
                                    new ICSSProperty [] { aProperty,
                                                          aProperty.getClone (ECSSVendorPrefix.MOZILLA),
                                                          aProperty.getClone (ECSSVendorPrefix.WEBKIT),
                                                          aProperty.getClone (ECSSVendorPrefix.KHTML) },
                                    sValue,
                                    bIsImportant);
}
 
源代码11 项目: ph-commons   文件: PDTDisplayHelper.java
@Nonnull
@Nonempty
@Override
public String getYears (@CheckForSigned final int nYears)
{
  // Use "abs" to ensure it is "1 year" and "-1 year"
  return MathHelper.abs (nYears) == 1 ? nYears + " Jahr" : nYears + " Jahre";
}
 
源代码12 项目: ph-commons   文件: Version.java
/**
 * Get the string representation of the version number but only major and
 * minor version number.
 *
 * @return Never <code>null</code>.
 */
@Nonnull
@Nonempty
public String getAsStringMajorMinor ()
{
  return m_nMajor + "." + m_nMinor;
}
 
源代码13 项目: ph-css   文件: CSSPropertyEnumOrRect.java
public CSSPropertyEnumOrRect (@Nonnull final ECSSProperty eProp,
                              @Nullable final ECSSVendorPrefix eVendorPrefix,
                              @Nullable final ICSSPropertyCustomizer aCustomizer,
                              @Nonnull @Nonempty final String... aEnumValues)
{
  super (eProp, eVendorPrefix, aCustomizer, aEnumValues);
}
 
源代码14 项目: ph-css   文件: CSSViewportRule.java
/**
 * @return The rule declaration string used in the CSS. Neither
 *         <code>null</code> nor empty. Always starting with <code>@</code>
 *         and ending with <code>viewport</code>.
 */
@Nonnull
@Nonempty
public String getDeclaration ()
{
  return m_sDeclaration;
}
 
源代码15 项目: ph-css   文件: CSSValue.java
/**
 * @return The property name including an eventually contained vendor prefix.
 *         Neither <code>null</code> nor empty.
 * @since 3.9.0
 */
@Nonnull
@Nonempty
public String getPropertyName ()
{
  return m_aProperty.getPropertyName ();
}
 
源代码16 项目: ph-css   文件: CSSPropertyEnumOrColors.java
public CSSPropertyEnumOrColors (@Nonnull final ECSSProperty eProp,
                                @Nonnegative final int nMinNumbers,
                                @Nonnegative final int nMaxNumbers,
                                @Nonnull @Nonempty final String... aEnumValues)
{
  this (eProp, (ICSSPropertyCustomizer) null, nMinNumbers, nMaxNumbers, aEnumValues);
}
 
源代码17 项目: ph-css   文件: CSSDeclarationContainer.java
@Override
@Nonnull
@Nonempty
public String getAsCSSString (@Nonnull final ICSSWriterSettings aSettings, @Nonnegative final int nIndentLevel)
{
  final boolean bOptimizedOutput = aSettings.isOptimizedOutput ();

  final StringBuilder aSB = new StringBuilder ();
  final int nDeclCount = getDeclarationCount ();
  if (nDeclCount == 0)
  {
    aSB.append (bOptimizedOutput ? "{}" : " {}");
  }
  else
  {
    if (nDeclCount == 1)
    {
      // A single declaration
      aSB.append (bOptimizedOutput ? "{" : " { ");
      aSB.append (super.getAsCSSString (aSettings, nIndentLevel));
      aSB.append (bOptimizedOutput ? "}" : " }");
    }
    else
    {
      // More than one declaration
      aSB.append (bOptimizedOutput ? "{" : " {" + aSettings.getNewLineString ());
      aSB.append (super.getAsCSSString (aSettings, nIndentLevel));
      if (!bOptimizedOutput)
        aSB.append (aSettings.getIndent (nIndentLevel));
      aSB.append ('}');
    }
  }
  return aSB.toString ();
}
 
源代码18 项目: ph-commons   文件: SimpleGraph.java
@Nonnull
public IMutableGraphRelation createRelation (@Nonnull @Nonempty final String sRelationID,
                                             @Nonnull final String sFromNodeID,
                                             @Nonnull final String sToNodeID)
{
  final IMutableGraphNode aFromNode = getNodeOfID (sFromNodeID);
  if (aFromNode == null)
    throw new IllegalArgumentException ("Failed to resolve from node ID '" + sFromNodeID + "'");
  final IMutableGraphNode aToNode = getNodeOfID (sToNodeID);
  if (aToNode == null)
    throw new IllegalArgumentException ("Failed to resolve to node ID '" + sToNodeID + "'");
  return createRelation (sRelationID, aFromNode, aToNode);
}
 
源代码19 项目: ph-commons   文件: MimeTypeInfo.java
@Nonnull
@Nonempty
@ReturnsMutableCopy
public ICommonsSet <MimeTypeWithSource> getAllMimeTypesWithSource ()
{
  return m_aMimeTypes.getClone ();
}
 
源代码20 项目: ph-css   文件: CSSParseError.java
/**
 * @return The error message created by {@link LoggingCSSParseErrorHandler} as
 *         a convenience method. Neither <code>null</code> nor empty.
 */
@Nonnull
@Nonempty
public String getErrorMessage ()
{
  return m_sErrorMessage;
}
 
源代码21 项目: ph-commons   文件: Dijkstra.java
public Result (@Nonnull @Nonempty final ICommonsList <N> aResultNodes, @Nonnegative final int nResultDistance)
{
  ValueEnforcer.notEmpty (aResultNodes, "EesultNodes");
  ValueEnforcer.isGE0 (nResultDistance, "Result Distance");
  m_aResultNodes = aResultNodes;
  m_nResultDistance = nResultDistance;
}
 
源代码22 项目: ph-commons   文件: StatisticsManager.java
@Nonnull
public static IMutableStatisticsHandlerSize getSizeHandler (@Nonnull @Nonempty final String sName)
{
  ValueEnforcer.notEmpty (sName, "Name");

  StatisticsHandlerSize aHdl = s_aRWLockSize.readLockedGet ( () -> s_aHdlSize.get (sName));

  if (aHdl == null)
  {
    aHdl = s_aRWLockSize.writeLockedGet ( () -> s_aHdlSize.computeIfAbsent (sName,
                                                                            k -> new StatisticsHandlerSize ()));
  }
  return aHdl;
}
 
源代码23 项目: ph-css   文件: CSSReaderSettings.java
/**
 * @param aFallbackCharset
 *        The charset to be used for reading the CSS file in case neither a
 *        <code>@charset</code> rule nor a BOM is present. May not be
 *        <code>null</code>.
 * @return this
 */
@Nonnull
public CSSReaderSettings setFallbackCharset (@Nonnull @Nonempty final Charset aFallbackCharset)
{
  ValueEnforcer.notNull (aFallbackCharset, "FallbackCharset");
  m_aFallbackCharset = aFallbackCharset;
  return this;
}
 
源代码24 项目: ph-commons   文件: VendorInfo.java
public static void setVendorEmail (@Nonnull @Nonempty final String sVendorEmail)
{
  ValueEnforcer.notEmpty (sVendorEmail, "VendorEmail");
  ValueEnforcer.isTrue (EmailAddressHelper.isValid (sVendorEmail), () -> "Illegal vendor email: " + sVendorEmail);
  s_sVendorEmail = sVendorEmail;
  s_sVendorEmailSuffix = StringHelper.getFromFirstIncl (sVendorEmail, '@');
}
 
@Nullable
public ICSSValue createSpecialValue (@Nonnull final ICSSProperty aProperty,
                                     @Nonnull @Nonempty final String sValue,
                                     final boolean bIsImportant)
{
  return new CSSValueMultiProperty (aProperty.getProp (),
                                    new ICSSProperty [] { aProperty,
                                                          aProperty.getClone (ECSSProperty._MOZ_BORDER_RADIUS_BOTTOMRIGHT),
                                                          aProperty.getClone (ECSSVendorPrefix.WEBKIT),
                                                          aProperty.getClone (ECSSVendorPrefix.KHTML) },
                                    sValue,
                                    bIsImportant);
}
 
源代码26 项目: ph-commons   文件: WritableResourceProviderChain.java
@Nonnull
@Nonempty
@ReturnsMutableCopy
public ICommonsList <IWritableResourceProvider> getAllContainedWritingResourceProviders ()
{
  return m_aWritableResourceProviders.getClone ();
}
 
源代码27 项目: ph-commons   文件: ScopeManager.java
@Nonnull
public static <T extends IRequestScope> T onRequestBegin (@Nonnull @Nonempty final String sScopeID,
                                                          @Nonnull @Nonempty final String sSessionID,
                                                          @Nonnull final BiFunction <? super String, ? super String, T> aFactory)
{
  final T aRequestScope = aFactory.apply (sScopeID, sSessionID);
  internalSetAndInitRequestScope (aRequestScope);
  return aRequestScope;
}
 
源代码28 项目: ph-schematron   文件: PSQueryBindingRegistry.java
public static void registerQueryBinding (@Nonnull @Nonempty final String sName,
                                         @Nonnull final IPSQueryBinding aQueryBinding) throws SchematronBindException
{
  ValueEnforcer.notEmpty (sName, "Name");
  ValueEnforcer.notNull (aQueryBinding, "QueryBinding");

  s_aRWLock.writeLockedThrowing ( () -> {
    if (s_aMap.containsKey (sName))
      throw new SchematronBindException ("A queryBinding with the name '" + sName + "' is already registered!");
    s_aMap.put (sName, aQueryBinding);
  });
}
 
源代码29 项目: ph-css   文件: CSSExpressionMemberTermSimple.java
@Nonnull
public CSSExpressionMemberTermSimple setValue (@Nonnull @Nonempty final String sValue)
{
  ValueEnforcer.notEmpty (sValue, "Value");
  m_sValue = sValue;
  m_sOptimizedValue = CSSExpressionTermOptimizer.getOptimizedValue (sValue);
  return this;
}
 
源代码30 项目: ph-commons   文件: Option.java
/**
 * @return the 'unique' internal Option identifier. Either short or long
 *         option name.
 * @see #getShortOpt()
 * @see #getLongOpt()
 */
@Nonnull
@Nonempty
public final String getKey ()
{
  // if 'opt' is null, then it is a 'long' option
  return hasShortOpt () ? m_sShortOpt : m_sLongOpt;
}