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 booleanaddBackgroundClipAndBackgroundOriginBoxValues(List<String> boxValues, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) private static CssBackgroundUtils.BackgroundPropertyTypechangePropertyType(CssBackgroundUtils.BackgroundPropertyType propertyType, boolean slashEncountered) private static booleancheckProperties(Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps) private static voidfillMapWithPropertiesTypes(Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps) private static voidfillNotProcessedProperties(Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) private static booleanprocessAllSpecifiedProperties(List<String> props, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) private static booleanprocessProperties(List<String> props, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps) private static booleanprocessValueWithSlash(String value, int slashCharInd, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) private static booleanputPropertyBasedOnType(CssBackgroundUtils.BackgroundPropertyType type, String value, Map<CssBackgroundUtils.BackgroundPropertyType, String> resolvedProps, Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes) Registers a property based on its type.private static voidremoveSpacesAroundSlash(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:IShorthandResolverResolves a shorthand expression.- Specified by:
resolveShorthandin 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
-