Class CssTypesValidationUtils
java.lang.Object
com.itextpdf.styledxmlparser.css.util.CssTypesValidationUtils
Utilities class for CSS types validating operations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Checks if value contains initial, inherit or unset.static boolean
isAngleValue
(String valueArgument) Checks whether a string contains an allowed metric unit in HTML/CSS; rad, deg and grad.static boolean
isBase64Data
(String data) Checks if a data is base 64 encoded.static boolean
isColorProperty
(String value) Checks if a value is a color property.static boolean
Checks whether a string contains an allowed value relative to parent value.static boolean
Checks whether a string contains an allowed value relative to element font height.static boolean
isInitialOrInheritOrUnset
(String value) Checks if value is initial, inherit or unset.static boolean
isMetricValue
(String valueArgument) Checks whether a string contains an allowed metric unit in HTML/CSS; px, in, cm, mm, pc, Q or pt.static boolean
isNegativeValue
(String value) Checks whether a string matches a negative value (e.g.static boolean
Checks whether a string matches a numeric value (e.g.static boolean
isPercentageValue
(String valueArgument) Checks whether a string contains a percentage valuestatic boolean
isRelativeValue
(String valueArgument) Checks whether a string contains an allowed value relative to previously set value.static boolean
isRemValue
(String valueArgument) Checks whether a string contains an allowed value relative to previously set root value.static boolean
isValidNumericValue
(String value) Checks if a string is in a valid format.static boolean
Checks whether a string contains a zero.
-
Method Details
-
isAngleValue
Checks whether a string contains an allowed metric unit in HTML/CSS; rad, deg and grad.- Parameters:
-
valueArgument
- the string that needs to be checked - Returns:
- boolean true if value contains an allowed angle value
-
isBase64Data
Checks if a data is base 64 encoded.- Parameters:
-
data
- the data - Returns:
- true, if the data is base 64 encoded
-
isColorProperty
Checks if a value is a color property.- Parameters:
-
value
- the value - Returns:
- true, if the value contains a color property
-
isEmValue
Checks whether a string contains an allowed value relative to parent value.- Parameters:
-
valueArgument
- the string that needs to be checked - Returns:
- boolean true if value contains a em value
-
isExValue
Checks whether a string contains an allowed value relative to element font height.- Parameters:
-
valueArgument
- the string that needs to be checked - Returns:
- boolean true if value contains a ex value
-
isMetricValue
Checks whether a string contains an allowed metric unit in HTML/CSS; px, in, cm, mm, pc, Q or pt.- Parameters:
-
valueArgument
- the string that needs to be checked - Returns:
- boolean true if value contains an allowed metric value
-
isNegativeValue
Checks whether a string matches a negative value (e.g. -123, -2em, -0.123). All these metric values are allowed in HTML/CSS.- Parameters:
-
value
- the string that needs to be checked - Returns:
- true if value is negative
-
isNumber
Checks whether a string matches a numeric value (e.g. 123, 1.23, .123). All these metric values are allowed in HTML/CSS.- Parameters:
-
value
- the string that needs to be checked - Returns:
- boolean true if value contains an allowed metric value
-
isPercentageValue
Checks whether a string contains a percentage value- Parameters:
-
valueArgument
- the string that needs to be checked - Returns:
- boolean true if value contains an allowed percentage value
-
isRelativeValue
Checks whether a string contains an allowed value relative to previously set value.- Parameters:
-
valueArgument
- the string that needs to be checked - Returns:
- boolean true if value contains an allowed metric value
-
isRemValue
Checks whether a string contains an allowed value relative to previously set root value.- Parameters:
-
valueArgument
- the string that needs to be checked - Returns:
- boolean true if value contains a rem value
-
isValidNumericValue
Checks if a string is in a valid format.- Parameters:
-
value
- the string that needs to be checked - Returns:
- boolean true if value is in a valid format
-
isInitialOrInheritOrUnset
Checks if value is initial, inherit or unset.- Parameters:
-
value
- value to check - Returns:
- true if value is initial, inherit or unset. false otherwise
-
containsInitialOrInheritOrUnset
Checks if value contains initial, inherit or unset.- Parameters:
-
value
- value to check - Returns:
- true if value contains initial, inherit or unset. False otherwise
-
isZero
Checks whether a string contains a zero.- Parameters:
-
value
- the string that needs to be checked - Returns:
- boolean true if value contains a zero
-