Class CssPropertyNormalizer
- java.lang.Object
-
- com.itextpdf.styledxmlparser.css.util.CssPropertyNormalizer
-
class CssPropertyNormalizer extends java.lang.ObjectUtilities class with functionality to normalize CSS properties.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.PatternURL_PATTERN
-
Constructor Summary
Constructors Constructor Description CssPropertyNormalizer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static intappendQuotedString(java.lang.StringBuilder buffer, java.lang.String source, int start)Appends quoted string.private static intappendUrlContent(java.lang.StringBuilder buffer, java.lang.String source, int start)Appends url content and end parenthesis if url is correct.(package private) static java.lang.Stringnormalize(java.lang.String str)Normalize a property.private static booleantrimSpaceAfter(char ch)Checks if spaces can be trimmed after a specific character.private static booleantrimSpaceBefore(char ch)Checks if spaces can be trimmed before a specific character.
-
-
-
Method Detail
-
normalize
static java.lang.String normalize(java.lang.String str)
Normalize a property.- Parameters:
str- the property- Returns:
- the normalized property
-
appendQuotedString
private static int appendQuotedString(java.lang.StringBuilder buffer, java.lang.String source, int start)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
private static int appendUrlContent(java.lang.StringBuilder buffer, java.lang.String source, int start)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
-
-