- Type Parameters:
T- the element type
- All Known Implementing Classes:
SimpleCssFunctionProcessor
public interface CssFunctionProcessor<T>
Interface for CSS function processors.
This is a macro processor which takes CssTokens from a CssTokenizer and produces processed CssTokens.
References:
-
Method Summary
Modifier and TypeMethodDescriptionReturns a localized help text describing the supported functions.voidprocess(T element, CssTokenizer tt, Consumer<CssToken> out, @NonNull Deque<CssFunction<T>> recursionStack) Processes all tokens.default @NonNull ImmutableList<CssToken> process(T element, @NonNull ReadOnlyList<CssToken> in) Convenience method for processing tokens.voidprocessToken(@NonNull T element, @NonNull CssTokenizer tt, @NonNull Consumer<CssToken> out, @NonNull Deque<CssFunction<T>> recursionStack) Processes the next token(s).voidsetCustomProperties(Map<String, ImmutableList<CssToken>> customProperties) voidsetModel(SelectorModel<T> model)
-
Method Details
-
process
void process(T element, CssTokenizer tt, Consumer<CssToken> out, @NonNull Deque<CssFunction<T>> recursionStack) throws IOException, ParseException Processes all tokens.- Parameters:
element- an element of the DOMtt- the tokenizer providing input tokensout- a consumer for the processed tokensrecursionStack-- Throws:
IOException- in case of IO failureParseException- in case of a parsing failure
-
processToken
void processToken(@NonNull T element, @NonNull CssTokenizer tt, @NonNull Consumer<CssToken> out, @NonNull Deque<CssFunction<T>> recursionStack) throws IOException, ParseException Processes the next token(s).- Throws:
IOExceptionParseException
-
process
default @NonNull ImmutableList<CssToken> process(T element, @NonNull ReadOnlyList<CssToken> in) throws ParseException Convenience method for processing tokens.The default implementation calls
process(Object, CssTokenizer, Consumer, Deque).- Parameters:
element- an element of the DOMin- the input tokens- Returns:
- the processed tokens
- Throws:
ParseException- in case of a parsing failure
-
getHelpText
String getHelpText()Returns a localized help text describing the supported functions.- Returns:
- help text
-
setModel
-
setCustomProperties
-
getCustomProperties
Map<String,ImmutableList<CssToken>> getCustomProperties()
-