java.lang.Object
org.jhotdraw8.css.manager.SimpleCssFunctionProcessor<T>
- Type Parameters:
T- the element type
- All Implemented Interfaces:
CssFunctionProcessor<T>
Takes a list of tokens and evaluates Css functions on them.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String, ImmutableList<CssToken>> protected SelectorModel<T> -
Constructor Summary
ConstructorsConstructorDescriptionSimpleCssFunctionProcessor(List<CssFunction<T>> functions) SimpleCssFunctionProcessor(List<CssFunction<T>> functions, SelectorModel<T> model, Map<String, ImmutableList<CssToken>> customProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoProcessToken(@NonNull T element, @NonNull CssTokenizer tt, @NonNull Consumer<CssToken> out, @NonNull Deque<CssFunction<T>> recursionStack) Returns a localized help text describing the supported functions.intgetModel()final voidprocess(@NonNull T element, @NonNull CssTokenizer tt, @NonNull Consumer<CssToken> out, @NonNull Deque<CssFunction<T>> recursionStack) Processes all tokens.final @NonNull ReadOnlyList<CssToken> final 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) voidsetMaxRecursionDepth(int maxRecursionDepth) voidsetModel(SelectorModel<T> model) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.css.manager.CssFunctionProcessor
process
-
Field Details
-
model
-
customProperties
-
-
Constructor Details
-
SimpleCssFunctionProcessor
-
SimpleCssFunctionProcessor
public SimpleCssFunctionProcessor(List<CssFunction<T>> functions, SelectorModel<T> model, Map<String, ImmutableList<CssToken>> customProperties)
-
-
Method Details
-
getMaxRecursionDepth
public int getMaxRecursionDepth() -
setMaxRecursionDepth
public void setMaxRecursionDepth(int maxRecursionDepth) -
getModel
-
setModel
- Specified by:
setModelin interfaceCssFunctionProcessor<T>
-
getCustomProperties
- Specified by:
getCustomPropertiesin interfaceCssFunctionProcessor<T>
-
setCustomProperties
- Specified by:
setCustomPropertiesin interfaceCssFunctionProcessor<T>
-
process
public final @NonNull ReadOnlyList<CssToken> process(@NonNull T element, @NonNull ImmutableList<CssToken> in) throws ParseException - Throws:
ParseException
-
getHelpText
Description copied from interface:CssFunctionProcessorReturns a localized help text describing the supported functions.- Specified by:
getHelpTextin interfaceCssFunctionProcessor<T>- Returns:
- help text
-
process
public final void process(@NonNull T element, @NonNull CssTokenizer tt, @NonNull Consumer<CssToken> out, @NonNull Deque<CssFunction<T>> recursionStack) throws IOException, ParseException Description copied from interface:CssFunctionProcessorProcesses all tokens.- Specified by:
processin interfaceCssFunctionProcessor<T>- 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
public final void processToken(@NonNull T element, @NonNull CssTokenizer tt, @NonNull Consumer<CssToken> out, @NonNull Deque<CssFunction<T>> recursionStack) throws IOException, ParseException Description copied from interface:CssFunctionProcessorProcesses the next token(s).- Specified by:
processTokenin interfaceCssFunctionProcessor<T>- Throws:
IOExceptionParseException
-
doProcessToken
protected void doProcessToken(@NonNull T element, @NonNull CssTokenizer tt, @NonNull Consumer<CssToken> out, @NonNull Deque<CssFunction<T>> recursionStack) throws IOException, ParseException - Throws:
IOExceptionParseException
-