Class BackgroundShorthandResolver
java.lang.Object
com.itextpdf.styledxmlparser.css.resolve.shorthand.impl.BackgroundShorthandResolver
- All Implemented Interfaces:
IShorthandResolver
IShorthandResolver
implementation for backgrounds.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
addBackgroundClipAndBackgroundOriginBoxValues
(List<String> boxValues, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) private static CssBackgroundUtils.BackgroundPropertyType
changePropertyType
(CssBackgroundUtils.BackgroundPropertyType propertyType, boolean slashEncountered) private static boolean
checkProperties
(Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps) private static void
fillMapWithPropertiesTypes
(Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps) private static void
fillNotProcessedProperties
(Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) private static boolean
processAllSpecifiedProperties
(List<String> props, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) private static boolean
processProperties
(List<String> props, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps) private static boolean
processValueWithSlash
(String value, int slashCharInd, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) private static boolean
putPropertyBasedOnType
(CssBackgroundUtils.BackgroundPropertyType type, String value, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) Registers a property based on its type.private static void
removeSpacesAroundSlash
(List<String> props) resolveShorthand
(String shorthandExpression) Resolves a shorthand expression.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
BackgroundShorthandResolver
public BackgroundShorthandResolver()
-
-
Method Details
-
resolveShorthand
Description copied from interface:IShorthandResolver
Resolves a shorthand expression.- Specified by:
resolveShorthand
in interfaceIShorthandResolver
- Parameters:
shorthandExpression
- the shorthand expression- Returns:
- a list of CSS declaration
-
checkProperties
private static boolean checkProperties(Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps) -
removeSpacesAroundSlash
-
fillMapWithPropertiesTypes
private static void fillMapWithPropertiesTypes(Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps) -
processProperties
private static boolean processProperties(List<String> props, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps) -
processAllSpecifiedProperties
private static boolean processAllSpecifiedProperties(List<String> props, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) -
addBackgroundClipAndBackgroundOriginBoxValues
private static boolean addBackgroundClipAndBackgroundOriginBoxValues(List<String> boxValues, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) -
processValueWithSlash
private static boolean processValueWithSlash(String value, int slashCharInd, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) -
fillNotProcessedProperties
private static void fillNotProcessedProperties(Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) -
changePropertyType
private static CssBackgroundUtils.BackgroundPropertyType changePropertyType(CssBackgroundUtils.BackgroundPropertyType propertyType, boolean slashEncountered) -
putPropertyBasedOnType
private static boolean putPropertyBasedOnType(CssBackgroundUtils.BackgroundPropertyType type, String value, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) Registers a property based on its type.- Parameters:
type
- the property typevalue
- the property valueresolvedProps
- the resolved propertiesusedTypes
- already used types- Returns:
- false if the property is invalid. True in all other cases
-