Top Description Inners Fields Constructors Methods
javafx.css

public final Class CssParser

extends Object
Class Inheritance
Imports
com.sun.javafx.css.Combinator, .CompoundSelector, .FontFaceImpl, .InterpolatorConverter, .ParsedValueImpl, .SimpleSelector, .StyleManager, .TransitionDefinition, .TransitionDefinitionConverter, com.sun.javafx.util.Utils, javafx.animation.Interpolator, javafx.css.converter.BooleanConverter, .DurationConverter, .EffectConverter, .EnumConverter, .FontConverter, .InsetsConverter, .PaintConverter, .SizeConverter, .SizeConverter.SequenceConverter, .StringConverter, .URLConverter, .DeriveColorConverter, .LadderConverter, .StopConverter, com.sun.javafx.css.parser.Token, com.sun.javafx.scene.layout.region.BackgroundPositionConverter, .BackgroundSizeConverter, .BorderImageSliceConverter, .BorderImageSlices, .BorderImageWidthConverter, .BorderImageWidthsSequenceConverter, .BorderStrokeStyleSequenceConverter, .BorderStyleConverter, .CornerRadiiConverter, .LayeredBackgroundPositionConverter, .LayeredBackgroundSizeConverter, .LayeredBorderPaintConverter, .LayeredBorderStyleConverter, .Margins, .RepeatStruct, .RepeatStructConverter, .SliceSequenceConverter, .StrokeBorderPaintConverter, javafx.collections.ObservableList, javafx.geometry.Insets, javafx.scene.effect.BlurType, javafx.scene.layout.BackgroundPosition, .BackgroundRepeat, .BackgroundSize, .BorderStrokeStyle, .BorderWidths, .CornerRadii, javafx.scene.paint.Color, .CycleMethod, .Paint, .Stop, javafx.scene.shape.StrokeLineCap, .StrokeLineJoin, .StrokeType, javafx.scene.text.Font, .FontPosture, .FontWeight, javafx.util.Duration, com.sun.javafx.logging.PlatformLogger, .PlatformLogger.Level, java.io.BufferedReader, .CharArrayReader, .IOException, .InputStreamReader, .Reader, java.net.MalformedURLException, .URI, .URISyntaxException, .URL, java.nio.charset.StandardCharsets, java.text.MessageFormat, java.util.ArrayList, .Arrays, .Collections, .HashMap, .List, .Locale, .Map, .Stack

A parser for a CSS document string.
Since
9

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
CssParser.ParseError

A class that encapsulates information about the source and nature of errors encountered while parsing CSS or applying styles to Nodes.

private static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv Token
private static final ParsedValueImpl<Size, Size>
private static Stack<String>
private static final PlatformLogger
private static final ParsedValueImpl<Size, Size>
private final Map<String, String>
private Styleable
private String
private static final String
private String
private static final ParsedValueImpl<Size, Size>

Constructor Summary

AccessConstructor and Description
public
CssParser()

Constructs a CssParser.

Method Summary

Modifier and TypeMethod and Description
private ParsedValueImpl<String, BlurType>
blurType(final CssParser.Term root)

private ParsedValue<ParsedValue<V, T>[], Number[]>
private double
clamp(double min, double val, double max)

private ParsedValueImpl<Color, Color>
private Combinator
private CssParser.ParseError
private ParsedValueImpl<String, CycleMethod>
private ParsedValue<ParsedValue<V, T>[], Number[]>
dashStyle(final CssParser.Term root)

private Declaration
private List<Declaration>
private ParsedValueImpl<ParsedValue<V, T>[], Color>
derive(final CssParser.Term root)

private ParsedValueImpl<V, T>
private void
error(final CssParser.Term root, final String msg)

public static ObservableList<CssParser.ParseError>

Returns:

an ObservableList of ParseError
errorsProperty
()

List of errors that may have occurred during CSS processing.

private CssParser.Term
expr(CssLexer lexer)

private FontFace
private String
formatDeprecatedMessage(final CssParser.Term root, final String syntax)

private String
private String
private Stylesheet
private ParsedValueImpl<V, T>
private ParsedValueImpl<V, T>
private boolean
private static boolean
private boolean
isSize(Token token)

private boolean
private boolean
isTime(Token token)

private boolean
private ParsedValueImpl<ParsedValue<V, T>[], Color>
ladder(final CssParser.Term root)

private ParsedValueImpl<ParsedValue<V, T>[], Paint>
private CssParser.Term
nextLayer(final CssParser.Term root)

private Token
private int
private int
private int
public Stylesheet

Returns:

the Stylesheet
parse
(final String
the CSS document to parse
stylesheetText
)

Creates a Stylesheet from a CSS document string.

public Stylesheet

Returns:

the Stylesheet
parse
(final String
the doc base for resolving URL references
docbase
,
final String
the CSS document to parse
stylesheetText
)

Creates a Stylesheet from a CSS document string using docbase as the base URL for resolving references within Stylesheet.

public Stylesheet

Returns:

the stylesheet
parse
(final URL
URL of the stylesheet to parse
url
)

Updates the given stylesheet by reading a CSS document from a URL, assuming UTF-8 encoding.

private void
parse(final Stylesheet stylesheet, final Reader reader)

private ParsedValueImpl<V, T>
private void
parse(Stylesheet stylesheet, CssLexer lexer)

private ParsedValueImpl<ParsedValue<V, T>[], BackgroundPosition>
private ParsedValueImpl<ParsedValue<ParsedValue<V, T>[], BackgroundPosition>[], BackgroundPosition[]>
private ParsedValueImpl<ParsedValue<String, BackgroundRepeat>[][], RepeatStruct[]>
private ParsedValueImpl<ParsedValue<V, T>[], BackgroundSize>
private ParsedValueImpl<ParsedValue<ParsedValue<V, T>[], BackgroundSize>[], BackgroundSize[]>
private ParsedValueImpl<ParsedValue<String, BackgroundRepeat>[][], RepeatStruct[]>
private ParsedValueImpl<ParsedValue<V, T>[], BorderImageSlices>
private ParsedValueImpl<ParsedValue<ParsedValue<V, T>[], BorderImageSlices>[], BorderImageSlices[]>
private ParsedValueImpl<ParsedValue<V, T>[], BorderWidths>
private ParsedValueImpl<ParsedValue<ParsedValue<V, T>[], BorderWidths>[], BorderWidths[]>
private ParsedValueImpl<ParsedValue<?, Paint>[], Paint[]>
private ParsedValueImpl<ParsedValue<ParsedValue<?, Paint>[], Paint[]>[], Paint[][]>
private ParsedValueImpl<ParsedValue<V, T>[], BorderStrokeStyle>
private ParsedValueImpl<ParsedValue<ParsedValue<ParsedValue<V, T>[], BorderStrokeStyle>[], BorderStrokeStyle[]>[], BorderStrokeStyle[][]>
private ParsedValueImpl<ParsedValue<ParsedValue<V, T>[], BorderStrokeStyle>[], BorderStrokeStyle[]>
private ParsedValueImpl<?, Color>
private ParsedValueImpl<ParsedValue<V, T>[], Stop>[]
private ParsedValueImpl<ParsedValue<ParsedValue<?, Size>[][], CornerRadii>[], CornerRadii[]>
private ParsedValueImpl<ParsedValue<?, Size>, Duration>
parseDuration(CssParser.Term term, boolean allowNegative)

private ParsedValueImpl<ParsedValue<ParsedValue<?, Size>, Duration>[], Duration[]>
parseDurationLayers(CssParser.Term term, boolean allowNegative)

private ParsedValueImpl<?, Interpolator>
private ParsedValueImpl<ParsedValue<?, Interpolator>[], Interpolator[]>
pack-priv ParsedValue<V, T>

Returns:

the parsed value
parseExpr
(String
the property
property
,
String
the expression
expr
)

Convenience method for unit tests.

private ParsedValueImpl<ParsedValue<V, T>[], Font>
private ParsedValueImpl<String, String>
private ParsedValueImpl<ParsedValue<?, Size>, Number>
private ParsedValueImpl<String, FontPosture>
private ParsedValueImpl<String, FontWeight>
private ParsedValueImpl<V, T>
private ParsedValueImpl<ParsedValue<V, T>[], Paint>
public Stylesheet

Returns:

the style sheet
parseInlineStyle
(final Styleable
the styleable node
node
)

Parse an in-line style from a Node.

private ParsedValueImpl<ParsedValue<V, T>[], Insets>
private ParsedValueImpl<ParsedValue<ParsedValue<V, T>[], Insets>[], Insets[]>
private ParsedValueImpl<ParsedValue<V, T>[], Color>
private ParsedValueImpl<V, T>
private ParsedValueImpl<ParsedValue<ParsedValue<V, T>[], Margins>[], Margins[]>
private ParsedValueImpl<ParsedValue<?, Paint>[], Paint[]>
private ParsedValueImpl<V, T>
private ParsedValueImpl<String, String>
private ParsedValueImpl<ParsedValue<V, T>[], Paint>
private ParsedValueImpl<String, BackgroundRepeat>[]
private ParsedValueImpl<?, Size>
parseSize(final CssParser.Term root)

private ParsedValueImpl<?, Size>[]
private ParsedValueImpl<Size, Size>[]
private ParsedValueImpl<String, StrokeLineCap>
private ParsedValueImpl<V, T>[]
private ParsedValueImpl<String, StrokeType>
private ParsedValueImpl<?, Size>
parseTime(final CssParser.Term root)

private ParsedValueImpl<ParsedValue<V, T>[], TransitionDefinition>
private ParsedValueImpl<ParsedValue<ParsedValue<V, T>[], TransitionDefinition>[], TransitionDefinition[]>
private ParsedValueImpl<String, String>
private ParsedValueImpl<ParsedValue<String, String>[], String[]>
private ParsedValueImpl<ParsedValue<V, T>[], String>
private ParsedValueImpl<ParsedValue<ParsedValue<V, T>[], String>[], String[]>
private ParsedValueImpl<V, T>[]
point(final CssParser.Term root)

private ParsedValueImpl<ParsedValue<V, T>[], Paint>
private void
private void
private ParsedValueImpl<V, T>
private ParsedValueImpl<ParsedValue<V, T>[], Number[]>
private Selector
private List<Selector>
private void
private void
private void
private SimpleSelector
private Size
size(final Token token)

private void
private ParsedValueImpl<ParsedValue<V, T>[], Stop>
stop(final CssParser.Term root)

private String
private CssParser.Term
term(CssLexer lexer)

private Size
time(Token token)

pack-priv ParsedValueImpl<V, T>
valueFor(String property, CssParser.Term root, CssLexer lexer)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait