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
IShorthandResolverimplementation for backgrounds.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.LoggerLOGGER
-
Constructor Summary
Constructors Constructor Description BackgroundShorthandResolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static booleanaddBackgroundClipAndBackgroundOriginBoxValues(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.BackgroundPropertyTypechangePropertyType(CssBackgroundUtils.BackgroundPropertyType propertyType, boolean slashEncountered)private static booleancheckProperties(java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps)private static voidfillMapWithPropertiesTypes(java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps)private static voidfillNotProcessedProperties(java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps, java.util.Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes)private static booleanprocessAllSpecifiedProperties(java.util.List<java.lang.String> props, java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps, java.util.Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes)private static booleanprocessProperties(java.util.List<java.lang.String> props, java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps)private static booleanprocessValueWithSlash(java.lang.String value, int slashCharInd, java.util.Map<CssBackgroundUtils.BackgroundPropertyType,java.lang.String> resolvedProps, java.util.Set<CssBackgroundUtils.BackgroundPropertyType> usedTypes)private static booleanputPropertyBasedOnType(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 voidremoveSpacesAroundSlash(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:IShorthandResolverResolves a shorthand expression.- Specified by:
resolveShorthandin 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
-
-