Class CssTypesValidationUtils
java.lang.Object
com.itextpdf.styledxmlparser.css.util.CssTypesValidationUtils
Utilities class for CSS types validating operations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if value contains initial, inherit or unset.static booleanisAngleValue(String valueArgument) Checks whether a string contains an allowed metric unit in HTML/CSS; rad, deg and grad.static booleanisBase64Data(String data) Deprecated.static booleanisColorProperty(String value) Checks if a value is a color property.static booleanChecks whether a string contains an allowed value relative to parent value.static booleanChecks whether a string contains an allowed value relative to element font height.static booleanisInitialOrInheritOrUnset(String value) Checks if value is initial, inherit or unset.static booleanisInlineData(String data) Checks if the string represent inline data in format `data:{FORMAT};{ENCODING},{DATA}`.static booleanisIntegerNumber(String value) Checks whether a string matches an integer numeric value (e.g.static booleanisMetricValue(String valueArgument) Checks whether a string contains an allowed metric unit in HTML/CSS; px, in, cm, mm, pc, Q or pt.static booleanisNegativeValue(String value) Checks whether a string matches a negative value (e.g.static booleanChecks whether a string matches a numeric value (e.g.static booleanisPercentageValue(String valueArgument) Checks whether a string contains a percentage valuestatic booleanisRelativeValue(String valueArgument) Checks whether a string contains an allowed value relative to previously set value.static booleanisRemValue(String valueArgument) Checks whether a string contains an allowed value relative to previously set root value.static booleanisValidNumericValue(String value) Checks if a string is in a valid format.static booleanChecks 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
Deprecated.useisInlineData(String)instead.Checks if a data is base 64 encoded.- Parameters:
-
data- the data - Returns:
- true, if the data is base 64 encoded
-
isInlineData
Checks if the string represent inline data in format `data:{FORMAT};{ENCODING},{DATA}`.- Parameters:
-
data- the string to check - Returns:
- true, if the string is inline data
-
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
-
isIntegerNumber
Checks whether a string matches an integer numeric value (e.g. 123, 23). 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
-
isInlineData(String)instead.