Skip to content
This repository was archived by the owner on Jun 24, 2021. It is now read-only.

Commit e1b35e4

Browse files
author
kcr
committed
8207328: API docs for javafx.css.Stylesheet are inaccurate / wrong
Reviewed-by: kcr, nlisker Contributed-by: wowselim@gmail.com
1 parent a7ba860 commit e1b35e4

File tree

1 file changed

+40
-16
lines changed

1 file changed

+40
-16
lines changed

modules/javafx.graphics/src/main/java/javafx/css/Stylesheet.java

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -66,20 +66,28 @@ public class Stylesheet {
6666
final static int BINARY_CSS_VERSION = 6;
6767

6868
private final String url;
69-
/** The URL from which the stylesheet was loaded.
70-
* @return The URL from which the stylesheet was loaded, or null if
69+
/**
70+
* The URL from which this {@code Stylesheet} was loaded.
71+
*
72+
* @return A {@code String} representation of the URL from which the stylesheet was loaded, or {@code null} if
7173
* the stylesheet was created from an inline style.
7274
*/
7375
public String getUrl() {
7476
return url;
7577
}
7678

7779
/**
78-
* True if this style came from user stylesheet, we need to know this so
80+
* Specifies the origin of this {@code Stylesheet}. We need to know this so
7981
* that we can make user important styles have higher priority than
80-
* author styles
82+
* author styles.
8183
*/
8284
private StyleOrigin origin = StyleOrigin.AUTHOR;
85+
86+
/**
87+
* Returns the origin of this {@code Stylesheet}.
88+
*
89+
* @return the origin of this {@code Stylesheet}
90+
*/
8391
public StyleOrigin getOrigin() {
8492
return origin;
8593
}
@@ -133,18 +141,29 @@ public void setOrigin(StyleOrigin origin) {
133141
/**
134142
* Constructs a Stylesheet using the given URL as the base URI. The
135143
* parameter may not be null.
136-
* @param url
144+
*
145+
* @param url the base URI for this stylesheet
137146
*/
138147
Stylesheet(String url) {
139148

140149
this.url = url;
141150

142151
}
143152

153+
/**
154+
* Returns the rules that are defined in this {@code Stylesheet}.
155+
*
156+
* @return a list of rules used by this {@code Stylesheet}
157+
*/
144158
public List<Rule> getRules() {
145159
return rules;
146160
}
147161

162+
/**
163+
* Returns the font faces used by this {@code Stylesheet}.
164+
*
165+
* @return a list of font faces used by this {@code Stylesheet}
166+
*/
148167
public List<FontFace> getFontFaces() {
149168
return fontFaces;
150169
}
@@ -238,10 +257,13 @@ final void readBinary(int bssVersion, DataInputStream is, String[] strings)
238257
private String[] stringStore;
239258
final String[] getStringStore() { return stringStore; }
240259

241-
/** Load a binary stylesheet file from a input stream.
242-
* @param url the URL from which the stylesheet will be loaded
243-
* @return the constructed stylesheet
244-
* @throws java.io.IOException the exception
260+
/**
261+
* Loads a binary stylesheet from a {@code URL}.
262+
*
263+
* @param url the {@code URL} from which the {@code Stylesheet} will be loaded
264+
* @return the loaded {@code Stylesheet}
265+
* @throws IOException if the binary stream corresponds to a more recent binary
266+
* css version or if an I/O error occurs while reading from the stream
245267
*/
246268
public static Stylesheet loadBinary(URL url) throws IOException {
247269

@@ -293,12 +315,14 @@ public static Stylesheet loadBinary(URL url) throws IOException {
293315
}
294316

295317
/**
296-
* Convert the .css file referenced by urlIn to binary format and write to urlOut.
297-
* @param source is the JavaFX .css file to convert
298-
* @param destination is the file to which the binary conversion is written
299-
* @throws IOException the exception
300-
* @throws IllegalArgumentException if either parameter is null, if source and destination are the same,
301-
* if source cannot be read, or if destination cannot be written.
318+
* Converts the css file referenced by {@code source} to binary format and writes it to {@code destination}.
319+
*
320+
* @param source the JavaFX compliant css file to convert
321+
* @param destination the file to which the binary formatted data is written
322+
* @throws IOException if the destination file can not be created or if an I/O error occurs
323+
* @throws IllegalArgumentException if either parameter is {@code null}, if {@code source} and
324+
* {@code destination} are the same, if {@code source} cannot be read, or if {@code destination}
325+
* cannot be written
302326
*/
303327
public static void convertToBinary(File source, File destination) throws IOException {
304328

0 commit comments

Comments
 (0)