Class CssPropertyNormalizer

java.lang.Object
com.itextpdf.styledxmlparser.css.util.CssPropertyNormalizer

class CssPropertyNormalizer extends Object
Utilities class with functionality to normalize CSS properties.
  • Field Details

    • URL_PATTERN

      private static final Pattern URL_PATTERN
  • Constructor Details

    • CssPropertyNormalizer

      CssPropertyNormalizer()
  • Method Details

    • normalize

      static String normalize(String str)
      Normalize a property.
      Parameters:
      str - the property
      Returns:
      the normalized property
    • appendQuotedString

      private static int appendQuotedString(StringBuilder buffer, String source, int start)
      Appends quoted string.
      Parameters:
      buffer - the current buffer
      source - a source
      start - where to start in the source. Should point at quote symbol.
      Returns:
      the new position in the source
    • appendUrlContent

      private static int appendUrlContent(StringBuilder buffer, String source, int start)
      Appends url content and end parenthesis if url is correct.
      Parameters:
      buffer - the current buffer
      source - a source
      start - where to start in the source. Should point at first symbol after "url(".
      Returns:
      the new position in the source
    • trimSpaceAfter

      private static boolean trimSpaceAfter(char ch)
      Checks if spaces can be trimmed after a specific character.
      Parameters:
      ch - the character
      Returns:
      true, if spaces can be trimmed after the character
    • trimSpaceBefore

      private static boolean trimSpaceBefore(char ch)
      Checks if spaces can be trimmed before a specific character.
      Parameters:
      ch - the character
      Returns:
      true, if spaces can be trimmed before the character