- Type Parameters:
T- the type of the data that can be converted from/to CSS
- All Superinterfaces:
Converter<T>
- All Known Implementing Classes:
AbstractCssConverter,BooleanCssConverter,DoubleCssConverter,IntegerCssConverter,KebabCaseEnumCssConverter,ListCssConverter,LiteralEnumCssConverter,LongCssConverter,MappedCssConverter,NumberCssConverter,PercentageCssConverter,PseudoClassCssConverter,SetCssConverter,SizeCssConverter,StringCssConverter,UriCssConverter
Converts a data value of type
T from or to a CSS Tokenizer.- Author:
- Werner Randelshofer
-
Method Summary
Modifier and TypeMethodDescriptiondefault TfromString(@NonNull CharSequence buf, @Nullable IdResolver idResolver) default TfromString(@NonNull CharBuffer buf, @Nullable IdResolver idResolver) default @NonNull ImmutableList<String> Gets a help text.booleanparse(@NonNull CssTokenizer tt, @Nullable IdResolver idResolver) Parses from the given tokenizer and moves the tokenizer to the next token past the value.parseNonNull(@NonNull CssTokenizer tt, @Nullable IdResolver idResolver) Parses from the given tokenizer and moves the tokenizer to the next token past the value.<TT extends T>
voidproduceTokens(@Nullable TT value, @Nullable IdSupplier idSupplier, @NonNull Consumer<CssToken> out) Produces tokens for the specified value.Converts the value to String.Converts the value to String.default <TT extends T>
voidtoString(@NonNull Appendable out, @Nullable IdSupplier idSupplier, TT value) toTokens(@Nullable TT value, @Nullable IdSupplier idSupplier) Methods inherited from interface org.jhotdraw8.base.converter.Converter
fromString, fromString, getDefaultValue, needsIdResolver, toString, toString
-
Method Details
-
parse
@Nullable T parse(@NonNull CssTokenizer tt, @Nullable IdResolver idResolver) throws ParseException, IOException Parses from the given tokenizer and moves the tokenizer to the next token past the value.- Parameters:
tt- tokenizer positioned on the tokenidResolver- the id factory- Returns:
- the parsed value
- Throws:
ParseException- on parse exceptionIOException- on io exception
-
parseNonNull
default @NonNull T parseNonNull(@NonNull CssTokenizer tt, @Nullable IdResolver idResolver) throws ParseException, IOException Parses from the given tokenizer and moves the tokenizer to the next token past the value.- Parameters:
tt- tokenizer positioned on the tokenidResolver- the id factory- Returns:
- the parsed value
- Throws:
ParseException- on parse exceptionIOException- on io exception
-
produceTokens
<TT extends T> void produceTokens(@Nullable TT value, @Nullable IdSupplier idSupplier, @NonNull Consumer<CssToken> out) throws IOException Produces tokens for the specified value.- Type Parameters:
TT- the value type- Parameters:
value- the valueidSupplier- the id factoryout- the consumer for the tokens- Throws:
IOException- on IO exception
-
toTokens
default <TT extends T> @NonNull List<CssToken> toTokens(@Nullable TT value, @Nullable IdSupplier idSupplier) throws IOException - Throws:
IOException
-
toString
Converts the value to String. -
toString
Converts the value to String.- Type Parameters:
TT- the value type- Parameters:
value- the valueidFactory- the id factory- Returns:
- a String
-
toString
default <TT extends T> void toString(@NonNull Appendable out, @Nullable IdSupplier idSupplier, TT value) throws IOException - Specified by:
toStringin interfaceConverter<T>- Throws:
IOException
-
fromString
default T fromString(@NonNull CharSequence buf, @Nullable IdResolver idResolver) throws ParseException - Specified by:
fromStringin interfaceConverter<T>- Throws:
ParseException
-
fromString
default T fromString(@NonNull CharBuffer buf, @Nullable IdResolver idResolver) throws ParseException - Specified by:
fromStringin interfaceConverter<T>- Throws:
ParseException
-
getHelpText
Gets a help text.- Specified by:
getHelpTextin interfaceConverter<T>- Returns:
- a help text.
-
getExamples
-
isNullable
boolean isNullable()
-