java.lang.Object
org.jhotdraw8.css.converter.AbstractCssConverter<T>
- All Implemented Interfaces:
Converter<T>,CssConverter<T>
- Direct Known Subclasses:
BooleanCssConverter,DoubleCssConverter,IntegerCssConverter,LongCssConverter,NumberCssConverter,PercentageCssConverter,PseudoClassCssConverter,StringCssConverter,UriCssConverter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Tbooleanfinal @Nullable Tparse(CssTokenizer tt, @Nullable IdResolver idResolver) Parses from the given tokenizer and moves the tokenizer to the next token past the value.abstract TparseNonNull(CssTokenizer tt, @Nullable IdResolver idResolver) Parses from the given tokenizer and moves the tokenizer to the next token past the value.final <TT extends T>
voidproduceTokens(@Nullable TT value, @Nullable IdSupplier idSupplier, Consumer<CssToken> out) Produces tokens for the specified value.protected abstract <TT extends T>
voidproduceTokensNonNull(TT value, @Nullable IdSupplier idSupplier, Consumer<CssToken> out) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.base.converter.Converter
fromString, fromString, fromStringNonNull, fromStringNonNull, fromStringNonNull, fromStringNonNull, needsIdResolver, toString, toStringMethods inherited from interface org.jhotdraw8.css.converter.CssConverter
fromString, fromString, getExamples, getHelpText, toString, toString, toString, toTokens
-
Constructor Details
-
AbstractCssConverter
public AbstractCssConverter(boolean nullable)
-
-
Method Details
-
parse
public final @Nullable T parse(CssTokenizer tt, @Nullable IdResolver idResolver) throws ParseException, IOException Description copied from interface:CssConverterParses from the given tokenizer and moves the tokenizer to the next token past the value.- Specified by:
parsein interfaceCssConverter<T>- Parameters:
tt- tokenizer positioned on the tokenidResolver- the id factory- Returns:
- the parsed value
- Throws:
ParseException- on parse exceptionIOException- on io exception
-
produceTokens
public final <TT extends T> void produceTokens(@Nullable TT value, @Nullable IdSupplier idSupplier, Consumer<CssToken> out) throws IOException Description copied from interface:CssConverterProduces tokens for the specified value.- Specified by:
produceTokensin interfaceCssConverter<T>- Type Parameters:
TT- the value type- Parameters:
value- the valueidSupplier- the id factoryout- the consumer for the tokens- Throws:
IOException- on IO exception
-
parseNonNull
public abstract T parseNonNull(CssTokenizer tt, @Nullable IdResolver idResolver) throws ParseException, IOException Description copied from interface:CssConverterParses from the given tokenizer and moves the tokenizer to the next token past the value.- Specified by:
parseNonNullin interfaceCssConverter<T>- Parameters:
tt- tokenizer positioned on the tokenidResolver- the id factory- Returns:
- the parsed value
- Throws:
ParseException- on parse exceptionIOException- on io exception
-
produceTokensNonNull
protected abstract <TT extends T> void produceTokensNonNull(TT value, @Nullable IdSupplier idSupplier, Consumer<CssToken> out) throws IOException - Throws:
IOException
-
getDefaultValue
- Specified by:
getDefaultValuein interfaceConverter<T>
-
isNullable
public boolean isNullable()- Specified by:
isNullablein interfaceCssConverter<T>
-