Skip to content

Commit e3e7853

Browse files
committed
javadoc
1 parent a8039ea commit e3e7853

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+347
-105
lines changed

src/main/java/com/gargoylesoftware/css/dom/CSSStyleSheetListImpl.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,17 @@
3333
public class CSSStyleSheetListImpl implements StyleSheetList {
3434
private List<CSSStyleSheet> cssStyleSheets_;
3535

36+
/**
37+
* @return the list of style sheets
38+
*/
3639
public List<CSSStyleSheet> getCSSStyleSheets() {
3740
if (cssStyleSheets_ == null) {
3841
cssStyleSheets_ = new ArrayList<CSSStyleSheet>();
3942
}
4043
return cssStyleSheets_;
4144
}
4245

43-
public void setCSSStyleSheets(final List<CSSStyleSheet> cssStyleSheets) {
44-
cssStyleSheets_ = cssStyleSheets;
45-
}
46-
47-
/**
48-
* Creates a new instance of CSSStyleSheetListImpl
49-
*/
50-
public CSSStyleSheetListImpl() {
51-
super();
52-
}
53-
54-
// start StyleSheetList
46+
// start StyleSheetList
5547
@Override
5648
public int getLength() {
5749
return getCSSStyleSheets().size();

src/main/java/com/gargoylesoftware/css/dom/CSSUnknownRuleImpl.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@ public class CSSUnknownRuleImpl extends AbstractCSSRuleImpl implements CSSUnknow
3535

3636
private String text_;
3737

38-
public String getText() {
39-
return text_;
40-
}
41-
42-
public void setText(final String text) {
43-
text_ = text;
44-
}
45-
38+
/**
39+
* Ctor.
40+
* @param parentStyleSheet the parent style sheet
41+
* @param parentRule the parent rule
42+
* @param text the text
43+
*/
4644
public CSSUnknownRuleImpl(
4745
final CSSStyleSheetImpl parentStyleSheet,
4846
final CSSRule parentRule,

src/main/java/com/gargoylesoftware/css/dom/CounterImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ public class CounterImpl implements Counter, Serializable {
3434
private String separator_;
3535

3636
/**
37-
* Creates new CounterImpl
37+
* Creates new CounterImpl.
38+
* @param separatorSpecified true if the separator is specified
39+
* @param lu the lexical unit
40+
* @throws DOMException in case of error
3841
*/
3942
public CounterImpl(final boolean separatorSpecified, final LexicalUnit lu) throws DOMException {
4043
LexicalUnit next = lu;

src/main/java/com/gargoylesoftware/css/parser/CSSException.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@
1919
*/
2020
public class CSSException extends RuntimeException {
2121

22-
public enum ErrorCode {
22+
/** Enum for error codes. */
23+
protected enum ErrorCode {
24+
/** Unspecified. */
2325
UNSPECIFIED_ERR,
26+
/** Not supported. */
2427
NOT_SUPPORTED_ERR,
28+
/** Syntax error. */
2529
SYNTAX_ERR,
2630
}
2731

@@ -102,7 +106,7 @@ public String getMessage() {
102106
}
103107

104108
/**
105-
* returns the error code for this exception.
109+
* @return the error code for this exception.
106110
*/
107111
public ErrorCode getCode() {
108112
return code_;

src/main/java/com/gargoylesoftware/css/parser/CSSOMParser.java

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public CSSOMParser() {
6262
parser_ = new CSS3Parser();
6363
}
6464

65+
/**
66+
* @param eh the error handler to be used
67+
*/
6568
public void setErrorHandler(final CSSErrorHandler eh) {
6669
parser_.setErrorHandler(eh);
6770
}
@@ -99,6 +102,13 @@ public CSSStyleDeclaration parseStyleDeclaration(final InputSource source) throw
99102
return sd;
100103
}
101104

105+
/**
106+
* Parses a SAC input source into a CSSOM style declaration.
107+
*
108+
* @param source the SAC input source
109+
* @param sd the CSSOM style declaration
110+
* @throws IOException if the underlying SAC parser throws an IOException
111+
*/
102112
public void parseStyleDeclaration(final CSSStyleDeclaration sd, final InputSource source) throws IOException {
103113
final Stack<Object> nodeStack = new Stack<Object>();
104114
nodeStack.push(sd);
@@ -107,6 +117,13 @@ public void parseStyleDeclaration(final CSSStyleDeclaration sd, final InputSourc
107117
parser_.parseStyleDeclaration(source);
108118
}
109119

120+
/**
121+
* Parses a SAC input source into a CSSValue.
122+
*
123+
* @param source the SAC input source
124+
* @return the css value
125+
* @throws IOException if the underlying SAC parser throws an IOException
126+
*/
110127
public CSSValue parsePropertyValue(final InputSource source) throws IOException {
111128
final CSSOMHandler handler = new CSSOMHandler();
112129
parser_.setDocumentHandler(handler);
@@ -117,19 +134,40 @@ public CSSValue parsePropertyValue(final InputSource source) throws IOException
117134
return new CSSValueImpl(lu);
118135
}
119136

137+
/**
138+
* Parses a SAC input source into a CSSRule.
139+
*
140+
* @param source the SAC input source
141+
* @return the css rule
142+
* @throws IOException if the underlying SAC parser throws an IOException
143+
*/
120144
public CSSRule parseRule(final InputSource source) throws IOException {
121145
final CSSOMHandler handler = new CSSOMHandler();
122146
parser_.setDocumentHandler(handler);
123147
parser_.parseRule(source);
124148
return (CSSRule) handler.getRoot();
125149
}
126150

151+
/**
152+
* Parses a SAC input source into a CSSSelectorList.
153+
*
154+
* @param source the SAC input source
155+
* @return the css selector list
156+
* @throws IOException if the underlying SAC parser throws an IOException
157+
*/
127158
public SelectorList parseSelectors(final InputSource source) throws IOException {
128159
final HandlerBase handler = new HandlerBase();
129160
parser_.setDocumentHandler(handler);
130161
return parser_.parseSelectors(source);
131162
}
132163

164+
/**
165+
* Parses a SAC input source into a MediaQueryList.
166+
*
167+
* @param source the SAC input source
168+
* @return the css media query list
169+
* @throws IOException if the underlying SAC parser throws an IOException
170+
*/
133171
public MediaQueryList parseMedia(final InputSource source) throws IOException {
134172
final HandlerBase handler = new HandlerBase();
135173
parser_.setDocumentHandler(handler);
@@ -139,10 +177,16 @@ public MediaQueryList parseMedia(final InputSource source) throws IOException {
139177
return null;
140178
}
141179

180+
/**
181+
* @param parentStyleSheet the new parent stylesheet
182+
*/
142183
public void setParentStyleSheet(final CSSStyleSheetImpl parentStyleSheet) {
143184
parentStyleSheet_ = parentStyleSheet;
144185
}
145186

187+
/**
188+
* @return the parent style sheet
189+
*/
146190
protected CSSStyleSheetImpl getParentStyleSheet() {
147191
return parentStyleSheet_;
148192
}

src/main/java/com/gargoylesoftware/css/parser/DocumentHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public interface DocumentHandler {
3333
* The CSS parser will invoke this method only once, before any other
3434
* methods in this interface.
3535
*
36-
* @param uri The URI of the style sheet. @@TODO can be NULL ! (inline style sheet)
36+
* @param source the input source to parse
3737
* @exception CSSException Any CSS exception, possibly wrapping another
3838
* exception.
3939
*/
@@ -47,7 +47,7 @@ public interface DocumentHandler {
4747
* method until it has either abandoned parsing (because of an
4848
* unrecoverable error) or reached the end of input.
4949
*
50-
* @param uri The URI of the style sheet.
50+
* @param source the input source to parse
5151
* @exception CSSException Any CSS exception, possibly wrapping another
5252
* exception.
5353
*/
@@ -65,8 +65,8 @@ public interface DocumentHandler {
6565
/**
6666
* Receive notification of the end of a media statement.
6767
*
68-
* @param media The intended destination medium for style information.
69-
* @param pseudo_page the pseudo page (if any, null otherwise)
68+
* @param name the name
69+
* @param pseudoPage the pseudo page (if any, null otherwise)
7070
* @exception CSSException Any CSS exception, possibly wrapping another
7171
* exception.
7272
*/

src/main/java/com/gargoylesoftware/css/parser/HandlerBase.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
/**
2121
* Empty implementation of the DocumentHandlerExt interface.
22+
*
23+
* @author Ronald Brill
2224
*/
2325
public class HandlerBase implements DocumentHandler, CSSErrorHandler {
2426

src/main/java/com/gargoylesoftware/css/parser/InputSource.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class InputSource implements Closeable {
3838
/**
3939
* Create a new input source backed by byteStream.
4040
* @param byteStream the byte stream
41+
* @param encoding the encoding
4142
* @throws UnsupportedEncodingException if the encoding is not supported
4243
*/
4344
public InputSource(final InputStream byteStream, final String encoding) throws UnsupportedEncodingException {
@@ -51,13 +52,15 @@ public InputSource(final InputStream byteStream, final String encoding) throws U
5152

5253
/**
5354
* Create a new input source backed by a reader.
55+
* @param reader the reader
5456
*/
5557
public InputSource(final Reader reader) {
5658
reader_ = reader;
5759
}
5860

5961
/**
6062
* Create a new input source backed by a reader.
63+
* @param uri the uri to read from
6164
* @throws IOException in case of error
6265
* @throws MalformedURLException in case of error
6366
*/

src/main/java/com/gargoylesoftware/css/parser/Locator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class Locator implements Serializable {
3030
private int columnNumber_;
3131

3232
/**
33-
* Creates new LocatorImpl
33+
* Creates new LocatorImpl.
3434
* @param uri the uri
3535
* @param line the lineNumber
3636
* @param column the columnNumber

src/main/java/com/gargoylesoftware/css/parser/ParserUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static String trimBy(final StringBuilder s, final int left, final int rig
4141
* Helper that removes the leading "url(", the trailing ")"
4242
* and surrounding quotes from the given string builder.
4343
* @param s the StringBuilder
44-
* @return
44+
* @return the trimmed string
4545
*/
4646
public static String trimUrl(final StringBuilder s) {
4747
final String s1 = trimBy(s, 4, 1).trim();

0 commit comments

Comments
 (0)