Class BackgroundShorthandResolver
- java.lang.Object
-
- com.itextpdf.styledxmlparser.css.resolve.shorthand.impl.BackgroundShorthandResolver
-
- All Implemented Interfaces:
IShorthandResolver
public class BackgroundShorthandResolver extends java.lang.Object implements IShorthandResolver
IShorthandResolver
implementation for backgrounds.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
LOGGER
-
Constructor Summary
Constructors Constructor Description BackgroundShorthandResolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static boolean
addBackgroundClipAndBackgroundOriginBoxValues(java.util.List<java.lang.String> boxValues, java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps, java.util.Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes)
private static CssBackgroundUtils.BackgroundPropertyType
changePropertyType(CssBackgroundUtils.BackgroundPropertyType propertyType, boolean slashEncountered)
private static boolean
checkProperties(java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps)
private static void
fillMapWithPropertiesTypes(java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps)
private static void
fillNotProcessedProperties(java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps, java.util.Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes)
private static boolean
processAllSpecifiedProperties(java.util.List<java.lang.String> props, java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps, java.util.Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes)
private static boolean
processProperties(java.util.List<java.lang.String> props, java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps)
private static boolean
processValueWithSlash(java.lang.String value, int slashCharInd, java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps, java.util.Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes)
private static boolean
putPropertyBasedOnType(CssBackgroundUtils.BackgroundPropertyType type, java.lang.String value, java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps, java.util.Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes)
Registers a property based on its type.private static void
removeSpacesAroundSlash(java.util.List<java.lang.String> props)
java.util.List<CssDeclaration>
resolveShorthand(java.lang.String shorthandExpression)
Resolves a shorthand expression.
-
-
-
Method Detail
-
resolveShorthand
public java.util.List<CssDeclaration> resolveShorthand(java.lang.String shorthandExpression)
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(java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps)
-
removeSpacesAroundSlash
private static void removeSpacesAroundSlash(java.util.List<java.lang.String> props)
-
fillMapWithPropertiesTypes
private static void fillMapWithPropertiesTypes(java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps)
-
processProperties
private static boolean processProperties(java.util.List<java.lang.String> props, java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps)
-
processAllSpecifiedProperties
private static boolean processAllSpecifiedProperties(java.util.List<java.lang.String> props, java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps, java.util.Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes)
-
addBackgroundClipAndBackgroundOriginBoxValues
private static boolean addBackgroundClipAndBackgroundOriginBoxValues(java.util.List<java.lang.String> boxValues, java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps, java.util.Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes)
-
processValueWithSlash
private static boolean processValueWithSlash(java.lang.String value, int slashCharInd, java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps, java.util.Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes)
-
fillNotProcessedProperties
private static void fillNotProcessedProperties(java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps, java.util.Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes)
-
changePropertyType
private static CssBackgroundUtils.BackgroundPropertyType changePropertyType(CssBackgroundUtils.BackgroundPropertyType propertyType, boolean slashEncountered)
-
putPropertyBasedOnType
private static boolean putPropertyBasedOnType(CssBackgroundUtils.BackgroundPropertyType type, java.lang.String value, java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps, java.util.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
-
-