Skip to content

Commit 52c537a

Browse files
committed
javadoc fixes
1 parent a0432e6 commit 52c537a

File tree

5 files changed

+58
-4
lines changed

5 files changed

+58
-4
lines changed

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

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

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

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

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ public class DirectAdjacentSelector extends AbstractSelector implements Serializ
2424
private final Selector selector_; // child
2525
private final SimpleSelector simpleSelector_;
2626

27+
/**
28+
* Ctor.
29+
* @param child the child selector
30+
* @param simpleSelector the simple selector
31+
*/
2732
public DirectAdjacentSelector(final Selector child, final SimpleSelector simpleSelector) {
2833
selector_ = child;
2934
if (child != null) {
@@ -37,6 +42,9 @@ public SelectorType getSelectorType() {
3742
return SelectorType.DIRECT_ADJACENT_SELECTOR;
3843
}
3944

45+
/**
46+
* @return the selector
47+
*/
4048
public Selector getSelector() {
4149
return selector_;
4250
}

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

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ public class ElementSelector extends AbstractSelector implements SimpleSelector,
3131
private final String localNameLC_;
3232
private List<Condition> conditions_;
3333

34+
/**
35+
* Ctor.
36+
* @param localName the local name
37+
* @param locator the locator
38+
*/
3439
public ElementSelector(final String localName, final Locator locator) {
3540
localName_ = localName;
3641
if (localName != null) {
@@ -53,14 +58,23 @@ public SimpleSelector getSimpleSelector() {
5358
return this;
5459
}
5560

61+
/**
62+
* @return the local name
63+
*/
5664
public String getLocalName() {
5765
return localName_;
5866
}
5967

68+
/**
69+
* @return the local name in lowercase
70+
*/
6071
public String getLocalNameLowerCase() {
6172
return localNameLC_;
6273
}
6374

75+
/**
76+
* @return the element name
77+
*/
6478
public String getElementName() {
6579
final String localeName = getLocalName();
6680
if (localeName == null) {
@@ -69,10 +83,17 @@ public String getElementName() {
6983
return localeName;
7084
}
7185

86+
/**
87+
* @return the conditions
88+
*/
7289
public List<Condition> getConditions() {
7390
return conditions_;
7491
}
7592

93+
/**
94+
* Add a condition.
95+
* @param condition the condition to be added
96+
*/
7697
public void addCondition(final Condition condition) {
7798
if (conditions_ == null) {
7899
conditions_ = new ArrayList<Condition>();
@@ -82,14 +103,14 @@ public void addCondition(final Condition condition) {
82103

83104
@Override
84105
public String toString() {
85-
String localeName = getElementName();
106+
final StringBuffer result = new StringBuffer();
107+
result.append(getElementName());
86108

87-
// TODO use StringBuilder
88109
if (conditions_ != null) {
89110
for (Condition condition : conditions_) {
90-
localeName += condition.toString();
111+
result.append(condition);
91112
}
92113
}
93-
return localeName;
114+
return result.toString();
94115
}
95116
}

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

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

27+
/**
28+
* Ctor.
29+
* @param child the child selector
30+
* @param simpleSelector the simple selector
31+
*/
2732
public GeneralAdjacentSelector(final Selector child, final SimpleSelector simpleSelector) {
2833
selector_ = child;
2934
if (child != null) {
@@ -37,6 +42,9 @@ public SelectorType getSelectorType() {
3742
return SelectorType.GENERAL_ADJACENT_SELECTOR;
3843
}
3944

45+
/**
46+
* @return the selector
47+
*/
4048
public Selector getSelector() {
4149
return selector_;
4250
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ public class PseudoElementSelector extends AbstractSelector implements SimpleSel
2727
private final String localName_;
2828
private final boolean doubleColon_;
2929

30+
/**
31+
* Ctor.
32+
* @param localName the local name
33+
* @param locator the locator
34+
* @param doubleColon double column flag
35+
*/
3036
public PseudoElementSelector(final String localName, final Locator locator, final boolean doubleColon) {
3137
localName_ = localName;
3238
setLocator(locator);
@@ -43,6 +49,9 @@ public SimpleSelector getSimpleSelector() {
4349
return this;
4450
}
4551

52+
/**
53+
* @return the local name
54+
*/
4655
public String getLocalName() {
4756
return localName_;
4857
}

0 commit comments

Comments
 (0)