Skip to content

Commit

Permalink
Add missing javadoc
Browse files Browse the repository at this point in the history
Add missing class name
Add missing method name
Add missing inheritDoc
Add final modifier
Repalce import Stack with Deque
  • Loading branch information
oswetto committed Oct 30, 2023
1 parent f2a2ccb commit d711a4f
Show file tree
Hide file tree
Showing 48 changed files with 444 additions and 112 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/.checkstyle
/.classpath
/.project
.idea/
12 changes: 12 additions & 0 deletions src/main/java/org/htmlunit/cssparser/dom/AbstractCSSRuleImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
import org.htmlunit.cssparser.parser.AbstractLocatable;

/**
* <p>Abstract AbstractCSSRuleImpl class.</p>
*
* @author Ronald Brill
*
*/
public abstract class AbstractCSSRuleImpl extends AbstractLocatable implements Serializable {

Expand All @@ -28,6 +31,7 @@ public abstract class AbstractCSSRuleImpl extends AbstractLocatable implements S

/**
* Ctor.
*
* @param parentStyleSheet the parent style sheet
* @param parentRule the parent rule
*/
Expand All @@ -38,6 +42,8 @@ public AbstractCSSRuleImpl(final CSSStyleSheetImpl parentStyleSheet, final Abstr
}

/**
* <p>getCssText.</p>
*
* @return the current css text
*/
public abstract String getCssText();
Expand Down Expand Up @@ -65,19 +71,24 @@ public void setParentRule(final AbstractCSSRuleImpl parentRule) {
}

/**
* <p>getParentStyleSheet.</p>
*
* @return the parent style sheet
*/
public CSSStyleSheetImpl getParentStyleSheet() {
return parentStyleSheet_;
}

/**
* <p>getParentRule.</p>
*
* @return the parent rule
*/
public AbstractCSSRuleImpl getParentRule() {
return parentRule_;
}

/** {@inheritDoc} */
@Override
public boolean equals(final Object obj) {
if (this == obj) {
Expand All @@ -91,6 +102,7 @@ public boolean equals(final Object obj) {
// recursive loop -> stack overflow!
}

/** {@inheritDoc} */
@Override
public int hashCode() {
final int hash = super.hashCode();
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/org/htmlunit/cssparser/dom/CSSCharsetRuleImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Implementation of CSSCharsetRule.
*
* @author Ronald Brill
*
*/
public class CSSCharsetRuleImpl extends AbstractCSSRuleImpl {

Expand All @@ -45,9 +46,7 @@ public CSSCharsetRuleImpl(
encoding_ = encoding;
}

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
@Override
public void setCssText(final String cssText) throws DOMException {
try {
Expand Down Expand Up @@ -79,12 +78,15 @@ public void setCssText(final String cssText) throws DOMException {
}

/**
* <p>getEncoding.</p>
*
* @return the encoding
*/
public String getEncoding() {
return encoding_;
}

/** {@inheritDoc} */
@Override
public boolean equals(final Object obj) {
if (this == obj) {
Expand All @@ -98,21 +100,21 @@ public boolean equals(final Object obj) {
&& ParserUtils.equals(getEncoding(), ccr.getEncoding());
}

/** {@inheritDoc} */
@Override
public int hashCode() {
int hash = super.hashCode();
hash = ParserUtils.hashCode(hash, encoding_);
return hash;
}

/** {@inheritDoc} */
@Override
public String toString() {
return getCssText();
}

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
@Override
public String getCssText() {
final StringBuilder sb = new StringBuilder();
Expand Down
16 changes: 10 additions & 6 deletions src/main/java/org/htmlunit/cssparser/dom/CSSFontFaceRuleImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@
* Implementation of CSSFontFaceRule.
*
* @author Ronald Brill
*
*/
public class CSSFontFaceRuleImpl extends AbstractCSSRuleImpl {

private CSSStyleDeclarationImpl style_;

/**
* Ctor.
*
* @param parentStyleSheet the parent style sheet
* @param parentRule the parent rule
*/
public CSSFontFaceRuleImpl(final CSSStyleSheetImpl parentStyleSheet, final AbstractCSSRuleImpl parentRule) {
super(parentStyleSheet, parentRule);
}

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
@Override
public String getCssText() {
final StringBuilder sb = new StringBuilder();
Expand All @@ -58,9 +58,7 @@ public String getCssText() {
return sb.toString();
}

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
@Override
public void setCssText(final String cssText) throws DOMException {
try {
Expand Down Expand Up @@ -92,6 +90,8 @@ public void setCssText(final String cssText) throws DOMException {
}

/**
* <p>getStyle.</p>
*
* @return the style
*/
public CSSStyleDeclarationImpl getStyle() {
Expand All @@ -100,12 +100,14 @@ public CSSStyleDeclarationImpl getStyle() {

/**
* Sets the style to a new one.
*
* @param style the new style
*/
public void setStyle(final CSSStyleDeclarationImpl style) {
style_ = style;
}

/** {@inheritDoc} */
@Override
public boolean equals(final Object obj) {
if (this == obj) {
Expand All @@ -119,13 +121,15 @@ public boolean equals(final Object obj) {
&& ParserUtils.equals(getStyle(), cffr.getStyle());
}

/** {@inheritDoc} */
@Override
public int hashCode() {
int hash = super.hashCode();
hash = ParserUtils.hashCode(hash, style_);
return hash;
}

/** {@inheritDoc} */
@Override
public String toString() {
return getCssText();
Expand Down
18 changes: 12 additions & 6 deletions src/main/java/org/htmlunit/cssparser/dom/CSSImportRuleImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Implementation of CSSImportRule.
*
* @author Ronald Brill
*
*/
public class CSSImportRuleImpl extends AbstractCSSRuleImpl {

Expand All @@ -49,9 +50,7 @@ public CSSImportRuleImpl(
media_ = media;
}

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
@Override
public String getCssText() {
final StringBuilder sb = new StringBuilder();
Expand All @@ -70,9 +69,7 @@ public String getCssText() {
return sb.toString();
}

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
@Override
public void setCssText(final String cssText) throws DOMException {
try {
Expand Down Expand Up @@ -105,31 +102,39 @@ public void setCssText(final String cssText) throws DOMException {
}

/**
* <p>getHref.</p>
*
* @return the href
*/
public String getHref() {
return href_;
}

/**
* <p>getMedia.</p>
*
* @return the media lsit
*/
public MediaListImpl getMedia() {
return media_;
}

/**
* <p>getStyleSheet.</p>
*
* @return the parent style sheet
*/
public CSSStyleSheetImpl getStyleSheet() {
return getParentStyleSheet();
}

/** {@inheritDoc} */
@Override
public String toString() {
return getCssText();
}

/** {@inheritDoc} */
@Override
public boolean equals(final Object obj) {
if (this == obj) {
Expand All @@ -144,6 +149,7 @@ public boolean equals(final Object obj) {
&& ParserUtils.equals(getMedia(), cir.getMedia());
}

/** {@inheritDoc} */
@Override
public int hashCode() {
int hash = super.hashCode();
Expand Down
17 changes: 11 additions & 6 deletions src/main/java/org/htmlunit/cssparser/dom/CSSMediaRuleImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* Implementation of CSSMediaRule.
*
* @author Ronald Brill
*
*/
public class CSSMediaRuleImpl extends AbstractCSSRuleImpl {

Expand All @@ -36,6 +37,7 @@ public class CSSMediaRuleImpl extends AbstractCSSRuleImpl {

/**
* Ctor.
*
* @param parentStyleSheet the parent style sheet
* @param parentRule the parent rule
* @param media the media
Expand All @@ -48,9 +50,7 @@ public CSSMediaRuleImpl(
mediaList_ = media;
}

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
@Override
public String getCssText() {
final StringBuilder sb = new StringBuilder("@media ");
Expand All @@ -65,9 +65,7 @@ public String getCssText() {
return sb.toString();
}

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
@Override
public void setCssText(final String cssText) throws DOMException {
try {
Expand Down Expand Up @@ -100,13 +98,17 @@ public void setCssText(final String cssText) throws DOMException {
}

/**
* <p>getMediaList.</p>
*
* @return the media list
*/
public MediaListImpl getMediaList() {
return mediaList_;
}

/**
* <p>getCssRules.</p>
*
* @return the css rules
*/
public CSSRuleListImpl getCssRules() {
Expand All @@ -118,6 +120,7 @@ public CSSRuleListImpl getCssRules() {

/**
* Insert a new rule at the given index.
*
* @param rule the rule to be inserted
* @param index the insert pos
* @throws DOMException in case of error
Expand Down Expand Up @@ -181,11 +184,13 @@ public void setRuleList(final CSSRuleListImpl rules) {
cssRules_ = rules;
}

/** {@inheritDoc} */
@Override
public String toString() {
return getCssText();
}

/** {@inheritDoc} */
@Override
public boolean equals(final Object obj) {
if (this == obj) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ public void setCssText(final String cssText) throws DOMException {
}

/**
* @return the current selector text
* <p>getSelectorText.</p>
*
* @return the selector text
*/
public String getSelectorText() {
if (null == pseudoPage_) {
Expand Down
Loading

0 comments on commit d711a4f

Please sign in to comment.