Class CssPropertyNormalizer
java.lang.Object
com.itextpdf.styledxmlparser.css.util.CssPropertyNormalizer
Utilities class with functionality to normalize CSS properties.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
appendQuotedString
(StringBuilder buffer, String source, int start) Appends quoted string.private static int
appendUrlContent
(StringBuilder buffer, String source, int start) Appends url content and end parenthesis if url is correct.(package private) static String
Normalize a property.private static boolean
trimSpaceAfter
(char ch) Checks if spaces can be trimmed after a specific character.private static boolean
trimSpaceBefore
(char ch) Checks if spaces can be trimmed before a specific character.
-
Field Details
-
URL_PATTERN
-
-
Constructor Details
-
CssPropertyNormalizer
CssPropertyNormalizer()
-
-
Method Details
-
normalize
Normalize a property.- Parameters:
str
- the property- Returns:
- the normalized property
-
appendQuotedString
Appends quoted string.- Parameters:
buffer
- the current buffersource
- a sourcestart
- where to start in the source. Should point at quote symbol.- Returns:
- the new position in the source
-
appendUrlContent
Appends url content and end parenthesis if url is correct.- Parameters:
buffer
- the current buffersource
- a sourcestart
- 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
-