Skip to content

Commit a0432e6

Browse files
committed
javadoc fixes
1 parent af7f6bf commit a0432e6

File tree

3 files changed

+54
-20
lines changed

3 files changed

+54
-20
lines changed

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

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,21 @@
3434
*/
3535
public class CSSMediaRuleImpl extends AbstractCSSRuleImpl {
3636

37-
private MediaListImpl media_;
37+
private MediaListImpl mediaList_;
3838
private CSSRuleListImpl cssRules_;
3939

40-
public void setMedia(final MediaListImpl media) {
41-
media_ = media;
42-
}
43-
44-
public void setCssRules(final CSSRuleListImpl cssRules) {
45-
cssRules_ = cssRules;
46-
}
47-
40+
/**
41+
* Ctor.
42+
* @param parentStyleSheet the parent style sheet
43+
* @param parentRule the parent rule
44+
* @param media the media
45+
*/
4846
public CSSMediaRuleImpl(
4947
final CSSStyleSheetImpl parentStyleSheet,
5048
final AbstractCSSRuleImpl parentRule,
5149
final MediaListImpl media) {
5250
super(parentStyleSheet, parentRule);
53-
media_ = media;
51+
mediaList_ = media;
5452
}
5553

5654
/**
@@ -59,7 +57,7 @@ public CSSMediaRuleImpl(
5957
public String getCssText() {
6058
final StringBuilder sb = new StringBuilder("@media ");
6159

62-
sb.append(getMedia().getMediaText());
60+
sb.append(getMediaList().getMediaText());
6361
sb.append(" {");
6462
for (int i = 0; i < getCssRules().getLength(); i++) {
6563
final AbstractCSSRuleImpl rule = getCssRules().getRules().get(i);
@@ -89,7 +87,7 @@ public void setCssText(final String cssText) throws DOMException {
8987

9088
// The rule must be a media rule
9189
if (r instanceof CSSMediaRuleImpl) {
92-
media_ = ((CSSMediaRuleImpl) r).media_;
90+
mediaList_ = ((CSSMediaRuleImpl) r).mediaList_;
9391
cssRules_ = ((CSSMediaRuleImpl) r).cssRules_;
9492
}
9593
else {
@@ -112,18 +110,30 @@ public void setCssText(final String cssText) throws DOMException {
112110
}
113111
}
114112

115-
public MediaListImpl getMedia() {
116-
return media_;
113+
/**
114+
* @return the media list
115+
*/
116+
public MediaListImpl getMediaList() {
117+
return mediaList_;
117118
}
118119

120+
/**
121+
* @return the css rules
122+
*/
119123
public CSSRuleListImpl getCssRules() {
120124
if (cssRules_ == null) {
121125
cssRules_ = new CSSRuleListImpl();
122126
}
123127
return cssRules_;
124128
}
125129

126-
public int insertRule(final String rule, final int index) throws DOMException {
130+
/**
131+
* Insert a new rule at the given index.
132+
* @param rule the rule to be inserted
133+
* @param index the insert pos
134+
* @throws DOMException in case of error
135+
*/
136+
public void insertRule(final String rule, final int index) throws DOMException {
127137
final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheet();
128138
if (parentStyleSheet != null && parentStyleSheet.isReadOnly()) {
129139
throw new DOMExceptionImpl(
@@ -160,9 +170,13 @@ public int insertRule(final String rule, final int index) throws DOMException {
160170
DOMExceptionImpl.SYNTAX_ERROR,
161171
e.getMessage());
162172
}
163-
return index;
164173
}
165174

175+
/**
176+
* Removes a rule at the given index.
177+
* @param index the insert pos
178+
* @throws DOMException in case of error
179+
*/
166180
public void deleteRule(final int index) throws DOMException {
167181
final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheet();
168182
if (parentStyleSheet != null && parentStyleSheet.isReadOnly()) {
@@ -181,6 +195,10 @@ public void deleteRule(final int index) throws DOMException {
181195
}
182196
}
183197

198+
/**
199+
* Replaces the rule list.
200+
* @param rules the new rule list
201+
*/
184202
public void setRuleList(final CSSRuleListImpl rules) {
185203
cssRules_ = rules;
186204
}
@@ -200,21 +218,21 @@ public boolean equals(final Object obj) {
200218
}
201219
final CSSMediaRuleImpl cmr = (CSSMediaRuleImpl) obj;
202220
return super.equals(obj)
203-
&& LangUtils.equals(getMedia(), cmr.getMedia())
221+
&& LangUtils.equals(getMediaList(), cmr.getMediaList())
204222
&& LangUtils.equals(getCssRules(), cmr.getCssRules());
205223
}
206224

207225
@Override
208226
public int hashCode() {
209227
int hash = super.hashCode();
210-
hash = LangUtils.hashCode(hash, media_);
228+
hash = LangUtils.hashCode(hash, mediaList_);
211229
hash = LangUtils.hashCode(hash, cssRules_);
212230
return hash;
213231
}
214232

215233
private void writeObject(final ObjectOutputStream out) throws IOException {
216234
out.writeObject(cssRules_);
217-
out.writeObject(media_);
235+
out.writeObject(mediaList_);
218236
}
219237

220238
private void readObject(final ObjectInputStream in)
@@ -228,6 +246,6 @@ private void readObject(final ObjectInputStream in)
228246
cssRule.setParentStyleSheet(getParentStyleSheet());
229247
}
230248
}
231-
media_ = (MediaListImpl) in.readObject();
249+
mediaList_ = (MediaListImpl) in.readObject();
232250
}
233251
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ public CSSValueImpl(final LexicalUnit value) {
212212
this(value, false);
213213
}
214214

215+
/**
216+
* @return the css text
217+
*/
215218
public String getCssText() {
216219
if (getCssValueType() == CSSValueType.CSS_VALUE_LIST) {
217220

@@ -246,6 +249,11 @@ public String getCssText() {
246249
return value_ != null ? value_.toString() : "";
247250
}
248251

252+
/**
253+
* Sets the css text.
254+
* @param cssText the new css text
255+
* @throws DOMException in case of error
256+
*/
249257
public void setCssText(final String cssText) throws DOMException {
250258
try {
251259
final InputSource is = new InputSource(new StringReader(cssText));

src/main/java/com/gargoylesoftware/css/parser/selector/ChildSelector.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ public class ChildSelector extends AbstractSelector implements Serializable {
2424
private Selector ancestorSelector_;
2525
private SimpleSelector simpleSelector_;
2626

27+
/**
28+
* Ctor.
29+
* @param ancestorSelector the ancestor selector
30+
* @param simpleSelector the simple selector
31+
*/
2732
public ChildSelector(final Selector ancestorSelector, final SimpleSelector simpleSelector) {
2833
ancestorSelector_ = ancestorSelector;
2934
if (ancestorSelector != null) {
@@ -38,6 +43,9 @@ public SelectorType getSelectorType() {
3843
return SelectorType.CHILD_SELECTOR;
3944
}
4045

46+
/**
47+
* @return the ancestor selector
48+
*/
4149
public Selector getAncestorSelector() {
4250
return ancestorSelector_;
4351
}

0 commit comments

Comments
 (0)