Class CssDeclarationValueTokenizer
java.lang.Object
com.itextpdf.styledxmlparser.css.parse.CssDeclarationValueTokenizer
- Direct Known Subclasses:
-
CssDeclarationVarParser
Tokenizer for CSS declaration values.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The Token class.static enum
Enumeration of the different token types. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
The depth.protected int
The current index.protected boolean
Indicates if we're inside a string.protected final String
The source string.protected char
The quote string, either "'" or "\"". -
Constructor Summary
ConstructorsConstructorDescriptionCssDeclarationValueTokenizer
(String propertyValue) Creates a newCssDeclarationValueTokenizer
instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected CssDeclarationValueTokenizer.Token
Gets the next token.Gets the next valid token.protected CssDeclarationValueTokenizer.Token
parseFunctionToken
(CssDeclarationValueTokenizer.Token token, int funcDepth) Parse internal function token to full function token, e.g.
-
Field Details
-
src
The source string. -
index
protected int indexThe current index. -
stringQuote
protected char stringQuoteThe quote string, either "'" or "\"". -
inString
protected boolean inStringIndicates if we're inside a string. -
functionDepth
protected int functionDepthThe depth.
-
-
Constructor Details
-
CssDeclarationValueTokenizer
Creates a newCssDeclarationValueTokenizer
instance.- Parameters:
-
propertyValue
- the property value
-
-
Method Details
-
getNextValidToken
Gets the next valid token.- Returns:
- the next valid token
-
parseFunctionToken
protected CssDeclarationValueTokenizer.Token parseFunctionToken(CssDeclarationValueTokenizer.Token token, int funcDepth) Parse internal function token to full function token, e.g.calc(calc(
tocalc(calc(50px + 5px) + 20px)
- Parameters:
-
token
- function token to expand -
funcDepth
- function depth for resolving, e.g. if you want to resolve only nested function, not the whole declaration - Returns:
- expanded function token
-
getNextToken
Gets the next token.- Returns:
- the next token
-