- 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(CharSequence buf, @Nullable IdResolver idResolver) default TfromString(CharBuffer buf, @Nullable IdResolver idResolver) default ImmutableList<String> @Nullable StringGets a help text.boolean@Nullable Tparse(CssTokenizer tt, @Nullable IdResolver idResolver) Parses from the given tokenizer and moves the tokenizer to the next token past the value.default TparseNonNull(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, Consumer<CssToken> out) Produces tokens for the specified value.toString(@Nullable TT value) Converts the value to String.Converts the value to String.default <TT extends T>
voidtoString(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, fromStringNonNull, fromStringNonNull, fromStringNonNull, fromStringNonNull, getDefaultValue, needsIdResolver, toString, toString
-
Method Details
-
parse
@Nullable T parse(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 T parseNonNull(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, 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> 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(Appendable out, @Nullable IdSupplier idSupplier, TT value) throws IOException - Specified by:
toStringin interfaceConverter<T>- Throws:
IOException
-
fromString
- Specified by:
fromStringin interfaceConverter<T>- Throws:
ParseException
-
fromString
- Specified by:
fromStringin interfaceConverter<T>- Throws:
ParseException
-
getHelpText
@Nullable String getHelpText()Gets a help text.- Specified by:
getHelpTextin interfaceConverter<T>- Returns:
- a help text.
-
getExamples
-
isNullable
boolean isNullable()
-