- java.lang.Object
-
- javafx.css.CssParser
-
public final class CssParser extends Object
A parser for a CSS document string.- Since:
- 9
-
-
Property Summary
Properties Type Property Description static ObservableList<CssParser.ParseError>errorsList of errors that may have occurred during CSS processing.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCssParser.ParseErrorA class that encapsulates information about the source and nature of errors encountered while parsing CSS or applying styles to Nodes.
-
Constructor Summary
Constructors Constructor Description CssParser()Constructs aCssParser.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ObservableList<CssParser.ParseError>errorsProperty()List of errors that may have occurred during CSS processing.Stylesheetparse(String stylesheetText)Creates aStylesheetfrom a CSS document string.Stylesheetparse(String docbase, String stylesheetText)Creates aStylesheetfrom a CSS document string using docbase as the base URL for resolving references withinStylesheet.Stylesheetparse(URL url)Updates the given stylesheet by reading a CSS document from a URL, assuming UTF-8 encoding.StylesheetparseInlineStyle(Styleable node)Parse an in-line style from aNode.
-
-
-
Property Detail
-
errors
public static ObservableList<CssParser.ParseError> errorsProperty
List of errors that may have occurred during CSS processing.
-
-
Method Detail
-
parse
public Stylesheet parse(String stylesheetText)
Creates aStylesheetfrom a CSS document string.- Parameters:
stylesheetText- the CSS document to parse- Returns:
- the
Stylesheet
-
parse
public Stylesheet parse(String docbase, String stylesheetText) throws IOException
Creates aStylesheetfrom a CSS document string using docbase as the base URL for resolving references withinStylesheet.- Parameters:
docbase- the doc base for resolving URL referencesstylesheetText- the CSS document to parse- Returns:
- the Stylesheet
- Throws:
IOException- the exception
-
parse
public Stylesheet parse(URL url) throws IOException
Updates the given stylesheet by reading a CSS document from a URL, assuming UTF-8 encoding.- Parameters:
url- URL of the stylesheet to parse- Returns:
- the stylesheet
- Throws:
IOException- the exception
-
parseInlineStyle
public Stylesheet parseInlineStyle(Styleable node)
Parse an in-line style from aNode.- Parameters:
node- the styleable node- Returns:
- the style sheet
-
errorsProperty
public static ObservableList<CssParser.ParseError> errorsProperty()
List of errors that may have occurred during CSS processing.
-
-