From d711a4f8026b59040a0298183d70470cfe7c5f6b Mon Sep 17 00:00:00 2001 From: oswetto Date: Mon, 30 Oct 2023 22:52:02 +0100 Subject: [PATCH] Add missing javadoc Add missing class name Add missing method name Add missing inheritDoc Add final modifier Repalce import Stack with Deque --- .gitignore | 1 + .../cssparser/dom/AbstractCSSRuleImpl.java | 12 ++++ .../cssparser/dom/CSSCharsetRuleImpl.java | 14 ++-- .../cssparser/dom/CSSFontFaceRuleImpl.java | 16 +++-- .../cssparser/dom/CSSImportRuleImpl.java | 18 +++-- .../cssparser/dom/CSSMediaRuleImpl.java | 17 +++-- .../cssparser/dom/CSSPageRuleImpl.java | 4 +- .../cssparser/dom/CSSRuleListImpl.java | 6 ++ .../dom/CSSStyleDeclarationImpl.java | 12 ++++ .../cssparser/dom/CSSStyleSheetImpl.java | 26 +++++++ .../cssparser/dom/CSSStyleSheetListImpl.java | 5 ++ .../cssparser/dom/CSSUnknownRuleImpl.java | 10 ++- .../htmlunit/cssparser/dom/CSSValueImpl.java | 20 +++++- .../htmlunit/cssparser/dom/CounterImpl.java | 8 +++ .../htmlunit/cssparser/dom/MediaListImpl.java | 9 +++ .../org/htmlunit/cssparser/dom/Property.java | 10 ++- .../htmlunit/cssparser/dom/RGBColorImpl.java | 6 ++ .../org/htmlunit/cssparser/dom/RectImpl.java | 12 +++- .../cssparser/parser/AbstractCSSParser.java | 11 +++ .../cssparser/parser/AbstractLocatable.java | 2 + .../cssparser/parser/CSSErrorHandler.java | 3 + .../cssparser/parser/CSSException.java | 4 ++ .../cssparser/parser/CSSOMParser.java | 68 +++++++++---------- .../cssparser/parser/CssCharStream.java | 58 +++++++++++++--- .../cssparser/parser/InputSource.java | 15 ++++ .../cssparser/parser/LexicalUnit.java | 24 +++++++ .../htmlunit/cssparser/parser/Locatable.java | 2 + .../htmlunit/cssparser/parser/Locator.java | 4 ++ .../parser/condition/ClassCondition.java | 11 ++- .../cssparser/parser/condition/Condition.java | 8 +++ .../parser/condition/IdCondition.java | 16 ++--- .../parser/condition/LangCondition.java | 2 +- .../condition/OneOfAttributeCondition.java | 6 +- .../condition/PrefixAttributeCondition.java | 2 +- .../condition/PseudoClassCondition.java | 11 ++- .../SubstringAttributeCondition.java | 4 ++ .../condition/SuffixAttributeCondition.java | 4 ++ .../cssparser/parser/media/MediaQuery.java | 12 ++++ .../parser/media/MediaQueryList.java | 5 ++ .../parser/selector/AbstractSelector.java | 3 + .../parser/selector/ChildSelector.java | 2 +- .../parser/selector/DescendantSelector.java | 7 ++ .../selector/DirectAdjacentSelector.java | 7 ++ .../parser/selector/ElementSelector.java | 14 ++++ .../selector/GeneralAdjacentSelector.java | 7 ++ .../selector/PseudoElementSelector.java | 6 ++ .../cssparser/parser/selector/Selector.java | 6 ++ .../parser/selector/SelectorListImpl.java | 26 +++++++ 48 files changed, 444 insertions(+), 112 deletions(-) diff --git a/.gitignore b/.gitignore index 00bb005..9d4eb5b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /.checkstyle /.classpath /.project +.idea/ diff --git a/src/main/java/org/htmlunit/cssparser/dom/AbstractCSSRuleImpl.java b/src/main/java/org/htmlunit/cssparser/dom/AbstractCSSRuleImpl.java index a19bf13..7afade7 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/AbstractCSSRuleImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/AbstractCSSRuleImpl.java @@ -19,7 +19,10 @@ import org.htmlunit.cssparser.parser.AbstractLocatable; /** + *

Abstract AbstractCSSRuleImpl class.

+ * * @author Ronald Brill + * */ public abstract class AbstractCSSRuleImpl extends AbstractLocatable implements Serializable { @@ -28,6 +31,7 @@ public abstract class AbstractCSSRuleImpl extends AbstractLocatable implements S /** * Ctor. + * * @param parentStyleSheet the parent style sheet * @param parentRule the parent rule */ @@ -38,6 +42,8 @@ public AbstractCSSRuleImpl(final CSSStyleSheetImpl parentStyleSheet, final Abstr } /** + *

getCssText.

+ * * @return the current css text */ public abstract String getCssText(); @@ -65,6 +71,8 @@ public void setParentRule(final AbstractCSSRuleImpl parentRule) { } /** + *

getParentStyleSheet.

+ * * @return the parent style sheet */ public CSSStyleSheetImpl getParentStyleSheet() { @@ -72,12 +80,15 @@ public CSSStyleSheetImpl getParentStyleSheet() { } /** + *

getParentRule.

+ * * @return the parent rule */ public AbstractCSSRuleImpl getParentRule() { return parentRule_; } + /** {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (this == obj) { @@ -91,6 +102,7 @@ public boolean equals(final Object obj) { // recursive loop -> stack overflow! } + /** {@inheritDoc} */ @Override public int hashCode() { final int hash = super.hashCode(); diff --git a/src/main/java/org/htmlunit/cssparser/dom/CSSCharsetRuleImpl.java b/src/main/java/org/htmlunit/cssparser/dom/CSSCharsetRuleImpl.java index 96c6d41..da30f56 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/CSSCharsetRuleImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/CSSCharsetRuleImpl.java @@ -25,6 +25,7 @@ * Implementation of CSSCharsetRule. * * @author Ronald Brill + * */ public class CSSCharsetRuleImpl extends AbstractCSSRuleImpl { @@ -45,9 +46,7 @@ public CSSCharsetRuleImpl( encoding_ = encoding; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void setCssText(final String cssText) throws DOMException { try { @@ -79,12 +78,15 @@ public void setCssText(final String cssText) throws DOMException { } /** + *

getEncoding.

+ * * @return the encoding */ public String getEncoding() { return encoding_; } + /** {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (this == obj) { @@ -98,6 +100,7 @@ public boolean equals(final Object obj) { && ParserUtils.equals(getEncoding(), ccr.getEncoding()); } + /** {@inheritDoc} */ @Override public int hashCode() { int hash = super.hashCode(); @@ -105,14 +108,13 @@ public int hashCode() { return hash; } + /** {@inheritDoc} */ @Override public String toString() { return getCssText(); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public String getCssText() { final StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/htmlunit/cssparser/dom/CSSFontFaceRuleImpl.java b/src/main/java/org/htmlunit/cssparser/dom/CSSFontFaceRuleImpl.java index 811e76f..60c7372 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/CSSFontFaceRuleImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/CSSFontFaceRuleImpl.java @@ -25,6 +25,7 @@ * Implementation of CSSFontFaceRule. * * @author Ronald Brill + * */ public class CSSFontFaceRuleImpl extends AbstractCSSRuleImpl { @@ -32,6 +33,7 @@ public class CSSFontFaceRuleImpl extends AbstractCSSRuleImpl { /** * Ctor. + * * @param parentStyleSheet the parent style sheet * @param parentRule the parent rule */ @@ -39,9 +41,7 @@ public CSSFontFaceRuleImpl(final CSSStyleSheetImpl parentStyleSheet, final Abstr super(parentStyleSheet, parentRule); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public String getCssText() { final StringBuilder sb = new StringBuilder(); @@ -58,9 +58,7 @@ public String getCssText() { return sb.toString(); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void setCssText(final String cssText) throws DOMException { try { @@ -92,6 +90,8 @@ public void setCssText(final String cssText) throws DOMException { } /** + *

getStyle.

+ * * @return the style */ public CSSStyleDeclarationImpl getStyle() { @@ -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) { @@ -119,6 +121,7 @@ public boolean equals(final Object obj) { && ParserUtils.equals(getStyle(), cffr.getStyle()); } + /** {@inheritDoc} */ @Override public int hashCode() { int hash = super.hashCode(); @@ -126,6 +129,7 @@ public int hashCode() { return hash; } + /** {@inheritDoc} */ @Override public String toString() { return getCssText(); diff --git a/src/main/java/org/htmlunit/cssparser/dom/CSSImportRuleImpl.java b/src/main/java/org/htmlunit/cssparser/dom/CSSImportRuleImpl.java index c001abc..d2413b5 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/CSSImportRuleImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/CSSImportRuleImpl.java @@ -25,6 +25,7 @@ * Implementation of CSSImportRule. * * @author Ronald Brill + * */ public class CSSImportRuleImpl extends AbstractCSSRuleImpl { @@ -49,9 +50,7 @@ public CSSImportRuleImpl( media_ = media; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public String getCssText() { final StringBuilder sb = new StringBuilder(); @@ -70,9 +69,7 @@ public String getCssText() { return sb.toString(); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void setCssText(final String cssText) throws DOMException { try { @@ -105,6 +102,8 @@ public void setCssText(final String cssText) throws DOMException { } /** + *

getHref.

+ * * @return the href */ public String getHref() { @@ -112,6 +111,8 @@ public String getHref() { } /** + *

getMedia.

+ * * @return the media lsit */ public MediaListImpl getMedia() { @@ -119,17 +120,21 @@ public MediaListImpl getMedia() { } /** + *

getStyleSheet.

+ * * @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) { @@ -144,6 +149,7 @@ public boolean equals(final Object obj) { && ParserUtils.equals(getMedia(), cir.getMedia()); } + /** {@inheritDoc} */ @Override public int hashCode() { int hash = super.hashCode(); diff --git a/src/main/java/org/htmlunit/cssparser/dom/CSSMediaRuleImpl.java b/src/main/java/org/htmlunit/cssparser/dom/CSSMediaRuleImpl.java index e466bfc..ee1d348 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/CSSMediaRuleImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/CSSMediaRuleImpl.java @@ -28,6 +28,7 @@ * Implementation of CSSMediaRule. * * @author Ronald Brill + * */ public class CSSMediaRuleImpl extends AbstractCSSRuleImpl { @@ -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 @@ -48,9 +50,7 @@ public CSSMediaRuleImpl( mediaList_ = media; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public String getCssText() { final StringBuilder sb = new StringBuilder("@media "); @@ -65,9 +65,7 @@ public String getCssText() { return sb.toString(); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void setCssText(final String cssText) throws DOMException { try { @@ -100,6 +98,8 @@ public void setCssText(final String cssText) throws DOMException { } /** + *

getMediaList.

+ * * @return the media list */ public MediaListImpl getMediaList() { @@ -107,6 +107,8 @@ public MediaListImpl getMediaList() { } /** + *

getCssRules.

+ * * @return the css rules */ public CSSRuleListImpl getCssRules() { @@ -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 @@ -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) { diff --git a/src/main/java/org/htmlunit/cssparser/dom/CSSPageRuleImpl.java b/src/main/java/org/htmlunit/cssparser/dom/CSSPageRuleImpl.java index ab835f4..6d392e2 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/CSSPageRuleImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/CSSPageRuleImpl.java @@ -109,7 +109,9 @@ public void setCssText(final String cssText) throws DOMException { } /** - * @return the current selector text + *

getSelectorText.

+ * + * @return the selector text */ public String getSelectorText() { if (null == pseudoPage_) { diff --git a/src/main/java/org/htmlunit/cssparser/dom/CSSRuleListImpl.java b/src/main/java/org/htmlunit/cssparser/dom/CSSRuleListImpl.java index 90459b9..d428eae 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/CSSRuleListImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/CSSRuleListImpl.java @@ -30,6 +30,8 @@ public class CSSRuleListImpl implements Serializable { private final List rules_ = new ArrayList<>(); /** + *

getRules.

+ * * @return the rules */ public List getRules() { @@ -44,6 +46,8 @@ public CSSRuleListImpl() { } /** + *

getLength.

+ * * @return the number of rules */ public int getLength() { @@ -75,6 +79,7 @@ public void delete(final int index) { getRules().remove(index); } + /** {@inheritDoc} */ @Override public String toString() { final StringBuilder sb = new StringBuilder(); @@ -87,6 +92,7 @@ public String toString() { return sb.toString(); } + /** {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (this == obj) { diff --git a/src/main/java/org/htmlunit/cssparser/dom/CSSStyleDeclarationImpl.java b/src/main/java/org/htmlunit/cssparser/dom/CSSStyleDeclarationImpl.java index 1b0558c..e0fa1d9 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/CSSStyleDeclarationImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/CSSStyleDeclarationImpl.java @@ -46,6 +46,8 @@ public CSSStyleDeclarationImpl(final AbstractCSSRuleImpl parentRule) { } /** + *

getProperties.

+ * * @return the properties */ public List getProperties() { @@ -113,6 +115,8 @@ public String getPropertyValue(final String propertyName) { } /** + *

getPropertyCSSValue.

+ * * @param propertyName the property name * @return the property value */ @@ -146,6 +150,8 @@ public String removeProperty(final String propertyName) throws DOMException { } /** + *

getPropertyPriority.

+ * * @param propertyName the name of the property * @return the priority */ @@ -194,6 +200,8 @@ public void setProperty( } /** + *

getLength.

+ * * @return the properties count */ public int getLength() { @@ -201,6 +209,8 @@ public int getLength() { } /** + *

getParentRule.

+ * * @return the parent rule */ public AbstractCSSRuleImpl getParentRule() { @@ -219,6 +229,8 @@ public void addProperty(final Property p) { } /** + *

getPropertyDeclaration.

+ * * @param propertyName the name of the propery * @return the property */ diff --git a/src/main/java/org/htmlunit/cssparser/dom/CSSStyleSheetImpl.java b/src/main/java/org/htmlunit/cssparser/dom/CSSStyleSheetImpl.java index c5855dd..25187b2 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/CSSStyleSheetImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/CSSStyleSheetImpl.java @@ -61,6 +61,8 @@ public CSSStyleSheetImpl() { } /** + *

getDisabled.

+ * * @return the disable state */ public boolean getDisabled() { @@ -77,6 +79,8 @@ public void setDisabled(final boolean disabled) { } /** + *

getOwnerNode.

+ * * @return the owner node */ public Node getOwnerNode() { @@ -84,6 +88,8 @@ public Node getOwnerNode() { } /** + *

getHref.

+ * * @return the href */ public String getHref() { @@ -91,6 +97,8 @@ public String getHref() { } /** + *

getTitle.

+ * * @return the title */ public String getTitle() { @@ -98,6 +106,8 @@ public String getTitle() { } /** + *

getMedia.

+ * * @return the media list */ public MediaListImpl getMedia() { @@ -105,6 +115,8 @@ public MediaListImpl getMedia() { } /** + *

getOwnerRule.

+ * * @return the owner rule */ public AbstractCSSRuleImpl getOwnerRule() { @@ -112,6 +124,8 @@ public AbstractCSSRuleImpl getOwnerRule() { } /** + *

getCssRules.

+ * * @return the css rules */ public CSSRuleListImpl getCssRules() { @@ -275,6 +289,8 @@ public void setMediaText(final String mediaText) { } /** + *

setOwnerRule.

+ * * @param ownerRule the new ownerRule */ public void setOwnerRule(final AbstractCSSRuleImpl ownerRule) { @@ -282,17 +298,25 @@ public void setOwnerRule(final AbstractCSSRuleImpl ownerRule) { } /** + *

setCssRules.

+ * * @param rules the new rules */ public void setCssRules(final CSSRuleListImpl rules) { cssRules_ = rules; } + /** + * {@inheritDoc} + */ @Override public String toString() { return getCssRules().toString(); } + /** + * {@inheritDoc} + */ @Override public boolean equals(final Object obj) { if (this == obj) { @@ -345,6 +369,8 @@ private void readObject(final ObjectInputStream in) throws IOException, ClassNot } /** + *

getRuleIndex.

+ * * @return the CSSStyleSheetRuleIndex */ public CSSStyleSheetRuleIndex getRuleIndex() { diff --git a/src/main/java/org/htmlunit/cssparser/dom/CSSStyleSheetListImpl.java b/src/main/java/org/htmlunit/cssparser/dom/CSSStyleSheetListImpl.java index 9305621..12b5f68 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/CSSStyleSheetListImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/CSSStyleSheetListImpl.java @@ -29,6 +29,8 @@ public class CSSStyleSheetListImpl { private List cssStyleSheets_; /** + *

getCSSStyleSheets.

+ * * @return the list of style sheets */ public List getCSSStyleSheets() { @@ -39,6 +41,8 @@ public List getCSSStyleSheets() { } /** + *

getLength.

+ * * @return the number of style sheets */ public int getLength() { @@ -75,6 +79,7 @@ public CSSStyleSheetImpl merge() { return merged; } + /** {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (this == obj) { diff --git a/src/main/java/org/htmlunit/cssparser/dom/CSSUnknownRuleImpl.java b/src/main/java/org/htmlunit/cssparser/dom/CSSUnknownRuleImpl.java index a9c49df..3dc9bce 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/CSSUnknownRuleImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/CSSUnknownRuleImpl.java @@ -44,9 +44,7 @@ public CSSUnknownRuleImpl( text_ = text; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public String getCssText() { if (null == text_) { @@ -55,9 +53,7 @@ public String getCssText() { return text_; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void setCssText(final String cssText) throws DOMException { try { @@ -88,11 +84,13 @@ public void setCssText(final String cssText) throws DOMException { } } + /** {@inheritDoc} */ @Override public String toString() { return getCssText(); } + /** {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (this == obj) { diff --git a/src/main/java/org/htmlunit/cssparser/dom/CSSValueImpl.java b/src/main/java/org/htmlunit/cssparser/dom/CSSValueImpl.java index d5d80d6..599b334 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/CSSValueImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/CSSValueImpl.java @@ -164,6 +164,8 @@ public enum CSSPrimitiveValueType { private Object value_; /** + *

getValue.

+ * * @return the value */ public Object getValue() { @@ -238,6 +240,8 @@ public CSSValueImpl(final LexicalUnit value) { } /** + *

getCssText.

+ * * @return the css text */ public String getCssText() { @@ -294,6 +298,8 @@ public void setCssText(final String cssText) throws DOMException { } /** + *

getCssValueType.

+ * * @return the css value type */ public CSSValueType getCssValueType() { @@ -308,6 +314,8 @@ public CSSValueType getCssValueType() { } /** + *

getPrimitiveType.

+ * * @return the primitive type */ public CSSPrimitiveValueType getPrimitiveType() { @@ -405,6 +413,8 @@ else if (value_ instanceof CounterImpl) { } /** + *

getLexicalUnitType.

+ * * @return the lexical unit type */ public LexicalUnit.LexicalUnitType getLexicalUnitType() { @@ -425,8 +435,9 @@ public void setDoubleValue(final double doubleValue) throws DOMException { } /** - * @return the double value. + *

getDoubleValue.

* + * @return the double value. * @throws DOMException in case of error */ public double getDoubleValue() throws DOMException { @@ -443,6 +454,8 @@ public double getDoubleValue() throws DOMException { } /** + *

getStringValue.

+ * * @return the string value. * @throws DOMException case of error */ @@ -485,9 +498,10 @@ public int getLength() { } /** + *

item.

+ * * @param index the position * @return the value at the position - * @throws DOMException in case of error */ @SuppressWarnings("unchecked") public CSSValueImpl item(final int index) { @@ -498,11 +512,13 @@ public CSSValueImpl item(final int index) { return null; } + /** {@inheritDoc} */ @Override public String toString() { return getCssText(); } + /** {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (this == obj) { diff --git a/src/main/java/org/htmlunit/cssparser/dom/CounterImpl.java b/src/main/java/org/htmlunit/cssparser/dom/CounterImpl.java index 1da9fcd..f4fffe6 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/CounterImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/CounterImpl.java @@ -33,6 +33,7 @@ public class CounterImpl implements Serializable { /** * Creates new CounterImpl. + * * @param separatorSpecified true if the separator is specified * @param lu the lexical unit * @throws DOMException in case of error @@ -73,6 +74,8 @@ public CounterImpl(final boolean separatorSpecified, final LexicalUnit lu) throw } /** + *

getIdentifier.

+ * * @return the identifier */ public String getIdentifier() { @@ -80,6 +83,8 @@ public String getIdentifier() { } /** + *

getListStyle.

+ * * @return the list style */ public String getListStyle() { @@ -87,12 +92,15 @@ public String getListStyle() { } /** + *

getSeparator.

+ * * @return the separator */ public String getSeparator() { return separator_; } + /** {@inheritDoc} */ @Override public String toString() { final StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/htmlunit/cssparser/dom/MediaListImpl.java b/src/main/java/org/htmlunit/cssparser/dom/MediaListImpl.java index 29f1149..d82de0e 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/MediaListImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/MediaListImpl.java @@ -51,6 +51,8 @@ public MediaListImpl(final MediaQueryList mediaList) { } /** + *

getMediaText.

+ * * @return the media text */ public String getMediaText() { @@ -89,6 +91,8 @@ public void setMediaText(final String mediaText) throws DOMException { } /** + *

getLength.

+ * * @return the media query count */ public int getLength() { @@ -96,6 +100,8 @@ public int getLength() { } /** + *

mediaQuery.

+ * * @param index the position of the media query * @return the media query at the given pos */ @@ -106,6 +112,7 @@ public MediaQuery mediaQuery(final int index) { return mediaQueries_.get(index); } + /** {@inheritDoc} */ @Override public String toString() { return getMediaText(); @@ -145,6 +152,7 @@ private boolean equalsMedia(final MediaListImpl ml) { return true; } + /** {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (this == obj) { @@ -157,6 +165,7 @@ public boolean equals(final Object obj) { return super.equals(obj) && equalsMedia(ml); } + /** {@inheritDoc} */ @Override public int hashCode() { int hash = super.hashCode(); diff --git a/src/main/java/org/htmlunit/cssparser/dom/Property.java b/src/main/java/org/htmlunit/cssparser/dom/Property.java index 16901be..e6e0816 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/Property.java +++ b/src/main/java/org/htmlunit/cssparser/dom/Property.java @@ -20,6 +20,8 @@ import org.htmlunit.cssparser.util.ParserUtils; /** + *

Property class.

+ * * @author Ronald Brill */ public class Property extends AbstractLocatable implements Serializable { @@ -88,9 +90,7 @@ public void setImportant(final boolean important) { important_ = important; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public String toString() { final StringBuilder sb = new StringBuilder(); @@ -105,9 +105,7 @@ public String toString() { return sb.toString(); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (this == obj) { diff --git a/src/main/java/org/htmlunit/cssparser/dom/RGBColorImpl.java b/src/main/java/org/htmlunit/cssparser/dom/RGBColorImpl.java index 021c803..575875c 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/RGBColorImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/RGBColorImpl.java @@ -173,6 +173,8 @@ private static CSSValueImpl getPart(final LexicalUnit next) { } /** + *

getRed.

+ * * @return the red part. */ public CSSValueImpl getRed() { @@ -188,6 +190,8 @@ public void setRed(final CSSValueImpl red) { } /** + *

getGreen.

+ * * @return the green part. */ public CSSValueImpl getGreen() { @@ -203,6 +207,8 @@ public void setGreen(final CSSValueImpl green) { } /** + *

getBlue.

+ * * @return the blue part. */ public CSSValueImpl getBlue() { diff --git a/src/main/java/org/htmlunit/cssparser/dom/RectImpl.java b/src/main/java/org/htmlunit/cssparser/dom/RectImpl.java index 3df98ea..84760a6 100644 --- a/src/main/java/org/htmlunit/cssparser/dom/RectImpl.java +++ b/src/main/java/org/htmlunit/cssparser/dom/RectImpl.java @@ -115,6 +115,8 @@ public RectImpl(final LexicalUnit lu) throws DOMException { } /** + *

getTop.

+ * * @return the top part. */ public CSSValueImpl getTop() { @@ -130,6 +132,8 @@ public void setTop(final CSSValueImpl top) { } /** + *

getRight.

+ * * @return the right part. */ public CSSValueImpl getRight() { @@ -145,6 +149,8 @@ public void setRight(final CSSValueImpl right) { } /** + *

getBottom.

+ * * @return the bottom part. */ public CSSValueImpl getBottom() { @@ -160,6 +166,8 @@ public void setBottom(final CSSValueImpl bottom) { } /** + *

getLeft.

+ * * @return the left part. */ public CSSValueImpl getLeft() { @@ -174,9 +182,7 @@ public void setLeft(final CSSValueImpl left) { left_ = left; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public String toString() { return new StringBuilder("rect(") diff --git a/src/main/java/org/htmlunit/cssparser/parser/AbstractCSSParser.java b/src/main/java/org/htmlunit/cssparser/parser/AbstractCSSParser.java index 5d21e65..6aa3a90 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/AbstractCSSParser.java +++ b/src/main/java/org/htmlunit/cssparser/parser/AbstractCSSParser.java @@ -93,6 +93,8 @@ public abstract class AbstractCSSParser { private static final String NUM_CHARS = "0123456789."; /** + *

getDocumentHandler.

+ * * @return the document handler */ protected DocumentHandler getDocumentHandler() { @@ -122,6 +124,8 @@ public void setDocumentHandler(final DocumentHandler handler) { } /** + *

getErrorHandler.

+ * * @return the error handler */ protected CSSErrorHandler getErrorHandler() { @@ -152,6 +156,8 @@ public void setErrorHandler(final CSSErrorHandler handler) { } /** + *

getInputSource.

+ * * @return the input source */ protected InputSource getInputSource() { @@ -233,6 +239,7 @@ protected String addEscapes(final String str) { } /** + *

toCSSParseException.

* * @param key the message lookup key * @param e the parse exception @@ -282,6 +289,8 @@ protected CSSParseException toCSSParseException(final String key, final ParseExc } /** + *

toCSSParseException.

+ * * @param e the DOMException * @return a new CSSParseException */ @@ -292,6 +301,8 @@ protected CSSParseException toCSSParseException(final DOMException e) { } /** + *

toCSSParseException.

+ * * @param e the TokenMgrException * @return a new CSSParseException */ diff --git a/src/main/java/org/htmlunit/cssparser/parser/AbstractLocatable.java b/src/main/java/org/htmlunit/cssparser/parser/AbstractLocatable.java index 004c795..a174edf 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/AbstractLocatable.java +++ b/src/main/java/org/htmlunit/cssparser/parser/AbstractLocatable.java @@ -23,11 +23,13 @@ public class AbstractLocatable implements Locatable { private Locator locator_; + /** {@inheritDoc} */ @Override public Locator getLocator() { return locator_; } + /** {@inheritDoc} */ @Override public void setLocator(final Locator locator) { locator_ = locator; diff --git a/src/main/java/org/htmlunit/cssparser/parser/CSSErrorHandler.java b/src/main/java/org/htmlunit/cssparser/parser/CSSErrorHandler.java index 2b7af57..3f73702 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/CSSErrorHandler.java +++ b/src/main/java/org/htmlunit/cssparser/parser/CSSErrorHandler.java @@ -25,6 +25,7 @@ public interface CSSErrorHandler { * * @param exception the {@link CSSParseException} that is the reason for the warning. * @exception CSSException in case of error + * @throws CSSException if any. */ void warning(CSSParseException exception) throws CSSException; @@ -33,6 +34,7 @@ public interface CSSErrorHandler { * * @param exception the {@link CSSParseException} that is the reason for the error. * @exception CSSException in case of error + * @throws CSSException if any. */ void error(CSSParseException exception) throws CSSException; @@ -41,6 +43,7 @@ public interface CSSErrorHandler { * * @param exception the {@link CSSParseException} that is the reason for the error. * @exception CSSException in case of error + * @throws CSSException if any. */ void fatalError(CSSParseException exception) throws CSSException; } diff --git a/src/main/java/org/htmlunit/cssparser/parser/CSSException.java b/src/main/java/org/htmlunit/cssparser/parser/CSSException.java index e0f0307..e9a38fb 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/CSSException.java +++ b/src/main/java/org/htmlunit/cssparser/parser/CSSException.java @@ -78,6 +78,8 @@ public CSSException(final ErrorCode code, final String message, final Exception } /** + * {@inheritDoc} + * * Returns the detail message of this throwable object. * * @return the detail message of this Throwable, or null if this Throwable @@ -106,6 +108,8 @@ public String getMessage() { } /** + *

getCode.

+ * * @return the error code for this exception. */ public ErrorCode getCode() { diff --git a/src/main/java/org/htmlunit/cssparser/parser/CSSOMParser.java b/src/main/java/org/htmlunit/cssparser/parser/CSSOMParser.java index aad7cd8..bf45d58 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/CSSOMParser.java +++ b/src/main/java/org/htmlunit/cssparser/parser/CSSOMParser.java @@ -16,26 +16,15 @@ import java.io.IOException; import java.io.StringReader; -import java.util.Stack; - -import org.htmlunit.cssparser.dom.AbstractCSSRuleImpl; -import org.htmlunit.cssparser.dom.CSSCharsetRuleImpl; -import org.htmlunit.cssparser.dom.CSSFontFaceRuleImpl; -import org.htmlunit.cssparser.dom.CSSImportRuleImpl; -import org.htmlunit.cssparser.dom.CSSMediaRuleImpl; -import org.htmlunit.cssparser.dom.CSSPageRuleImpl; -import org.htmlunit.cssparser.dom.CSSRuleListImpl; -import org.htmlunit.cssparser.dom.CSSStyleDeclarationImpl; -import org.htmlunit.cssparser.dom.CSSStyleRuleImpl; -import org.htmlunit.cssparser.dom.CSSStyleSheetImpl; -import org.htmlunit.cssparser.dom.CSSUnknownRuleImpl; -import org.htmlunit.cssparser.dom.CSSValueImpl; -import org.htmlunit.cssparser.dom.MediaListImpl; -import org.htmlunit.cssparser.dom.Property; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Deque; +import java.util.List; + +import org.htmlunit.cssparser.dom.*; import org.htmlunit.cssparser.parser.javacc.CSS3Parser; import org.htmlunit.cssparser.parser.media.MediaQueryList; import org.htmlunit.cssparser.parser.selector.SelectorList; -import org.w3c.dom.DOMException; /** * @author Ronald Brill @@ -61,6 +50,8 @@ public CSSOMParser() { } /** + *

setErrorHandler.

+ * * @param eh the error handler to be used */ public void setErrorHandler(final CSSErrorHandler eh) { @@ -108,8 +99,8 @@ public CSSStyleDeclarationImpl parseStyleDeclaration(final String styleDecl) thr * @throws IOException if the underlying SAC parser throws an IOException */ public void parseStyleDeclaration(final CSSStyleDeclarationImpl sd, final String styleDecl) throws IOException { - try (InputSource source = new InputSource(new StringReader(styleDecl))) { - final Stack nodeStack = new Stack<>(); + try (final InputSource source = new InputSource(new StringReader(styleDecl))) { + final Deque nodeStack = new ArrayDeque<>(); nodeStack.push(sd); final CSSOMHandler handler = new CSSOMHandler(nodeStack); parser_.setDocumentHandler(handler); @@ -125,7 +116,7 @@ public void parseStyleDeclaration(final CSSStyleDeclarationImpl sd, final String * @throws IOException if the underlying SAC parser throws an IOException */ public CSSValueImpl parsePropertyValue(final String propertyValue) throws IOException { - try (InputSource source = new InputSource(new StringReader(propertyValue))) { + try (final InputSource source = new InputSource(new StringReader(propertyValue))) { final CSSOMHandler handler = new CSSOMHandler(); parser_.setDocumentHandler(handler); final LexicalUnit lu = parser_.parsePropertyValue(source); @@ -144,7 +135,7 @@ public CSSValueImpl parsePropertyValue(final String propertyValue) throws IOExce * @throws IOException if the underlying SAC parser throws an IOException */ public AbstractCSSRuleImpl parseRule(final String rule) throws IOException { - try (InputSource source = new InputSource(new StringReader(rule))) { + try (final InputSource source = new InputSource(new StringReader(rule))) { final CSSOMHandler handler = new CSSOMHandler(); parser_.setDocumentHandler(handler); parser_.parseRule(source); @@ -160,7 +151,7 @@ public AbstractCSSRuleImpl parseRule(final String rule) throws IOException { * @throws IOException if the underlying SAC parser throws an IOException */ public SelectorList parseSelectors(final String selectors) throws IOException { - try (InputSource source = new InputSource(new StringReader(selectors))) { + try (final InputSource source = new InputSource(new StringReader(selectors))) { final HandlerBase handler = new HandlerBase(); parser_.setDocumentHandler(handler); return parser_.parseSelectors(source); @@ -175,7 +166,7 @@ public SelectorList parseSelectors(final String selectors) throws IOException { * @throws IOException if the underlying SAC parser throws an IOException */ public MediaQueryList parseMedia(final String media) throws IOException { - try (InputSource source = new InputSource(new StringReader(media))) { + try (final InputSource source = new InputSource(new StringReader(media))) { final HandlerBase handler = new HandlerBase(); parser_.setDocumentHandler(handler); return parser_.parseMedia(source); @@ -183,6 +174,8 @@ public MediaQueryList parseMedia(final String media) throws IOException { } /** + *

setParentStyleSheet.

+ * * @param parentStyleSheet the new parent stylesheet */ public void setParentStyleSheet(final CSSStyleSheetImpl parentStyleSheet) { @@ -190,6 +183,8 @@ public void setParentStyleSheet(final CSSStyleSheetImpl parentStyleSheet) { } /** + *

getParentStyleSheet.

+ * * @return the parent style sheet */ protected CSSStyleSheetImpl getParentStyleSheet() { @@ -197,7 +192,7 @@ protected CSSStyleSheetImpl getParentStyleSheet() { } class CSSOMHandler implements DocumentHandler { - private final Stack nodeStack_; + private final Deque nodeStack_; private Object root_; private String href_; @@ -209,12 +204,12 @@ private void setHref(final String href) { href_ = href; } - CSSOMHandler(final Stack nodeStack) { + CSSOMHandler(final Deque nodeStack) { nodeStack_ = nodeStack; } CSSOMHandler() { - nodeStack_ = new Stack<>(); + nodeStack_ = new ArrayDeque<>(); } Object getRoot() { @@ -223,7 +218,7 @@ Object getRoot() { @Override public void startDocument(final InputSource source) throws CSSException { - if (nodeStack_.empty()) { + if (nodeStack_.isEmpty()) { final CSSStyleSheetImpl ss = new CSSStyleSheetImpl(); CSSOMParser.this.setParentStyleSheet(ss); ss.setHref(getHref()); @@ -252,7 +247,7 @@ public void ignorableAtRule(final String atRule, final Locator locator) throws C getParentRule(), atRule); ir.setLocator(locator); - if (!nodeStack_.empty()) { + if (!nodeStack_.isEmpty()) { ((CSSRuleListImpl) nodeStack_.peek()).add(ir); } else { @@ -268,7 +263,7 @@ public void charset(final String characterEncoding, final Locator locator) getParentRule(), characterEncoding); cr.setLocator(locator); - if (!nodeStack_.empty()) { + if (!nodeStack_.isEmpty()) { ((CSSRuleListImpl) nodeStack_.peek()).add(cr); } else { @@ -286,7 +281,7 @@ public void importStyle(final String uri, final MediaQueryList media, uri, new MediaListImpl(media)); ir.setLocator(locator); - if (!nodeStack_.empty()) { + if (!nodeStack_.isEmpty()) { ((CSSRuleListImpl) nodeStack_.peek()).add(ir); } else { @@ -303,7 +298,7 @@ public void startMedia(final MediaQueryList media, final Locator locator) throws getParentRule(), ml); mr.setLocator(locator); - if (!nodeStack_.empty()) { + if (!nodeStack_.isEmpty()) { ((CSSRuleListImpl) nodeStack_.peek()).add(mr); } @@ -329,7 +324,7 @@ public void startPage(final String name, final String pseudoPage, final Locator CSSOMParser.this.getParentStyleSheet(), getParentRule(), pseudoPage); pr.setLocator(locator); - if (!nodeStack_.empty()) { + if (!nodeStack_.isEmpty()) { ((CSSRuleListImpl) nodeStack_.peek()).add(pr); } @@ -354,7 +349,7 @@ public void startFontFace(final Locator locator) throws CSSException { CSSOMParser.this.getParentStyleSheet(), getParentRule()); ffr.setLocator(locator); - if (!nodeStack_.empty()) { + if (!nodeStack_.isEmpty()) { ((CSSRuleListImpl) nodeStack_.peek()).add(ffr); } @@ -379,7 +374,7 @@ public void startSelector(final SelectorList selectors, final Locator locator) t CSSOMParser.this.getParentStyleSheet(), getParentRule(), selectors); sr.setLocator(locator); - if (!nodeStack_.empty()) { + if (!nodeStack_.isEmpty()) { final Object o = nodeStack_.peek(); ((CSSRuleListImpl) o).add(sr); } @@ -413,8 +408,9 @@ public void property(final String name, final LexicalUnit value, final boolean i } private AbstractCSSRuleImpl getParentRule() { - if (!nodeStack_.empty() && nodeStack_.size() > 1) { - final Object node = nodeStack_.get(nodeStack_.size() - 2); + if (!nodeStack_.isEmpty() && nodeStack_.size() > 1) { + final List nodesStack_ = new ArrayList<>(nodeStack_); + final Object node = nodesStack_.get(nodesStack_.size() - 2); if (node instanceof AbstractCSSRuleImpl) { return (AbstractCSSRuleImpl) node; } diff --git a/src/main/java/org/htmlunit/cssparser/parser/CssCharStream.java b/src/main/java/org/htmlunit/cssparser/parser/CssCharStream.java index 845cde7..e3bb6d4 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/CssCharStream.java +++ b/src/main/java/org/htmlunit/cssparser/parser/CssCharStream.java @@ -184,7 +184,11 @@ else if (prevCharIsCR) bufcolumn[bufpos] = column; } - /** Read a character. */ +/** + * {@inheritDoc} + * + * Read a character. + */ @Override public final char readChar() throws java.io.IOException { @@ -207,31 +211,51 @@ public final char readChar() throws java.io.IOException return c; } - /** Get token end column number. */ +/** + * {@inheritDoc} + * + * Get token end column number. + */ @Override public final int getEndColumn() { return bufcolumn[bufpos]; } - /** Get token end line number. */ +/** + * {@inheritDoc} + * + * Get token end line number. + */ @Override public final int getEndLine() { return bufline[bufpos]; } - /** Get token beginning column number. */ +/** + * {@inheritDoc} + * + * Get token beginning column number. + */ @Override public final int getBeginColumn() { return bufcolumn[tokenBegin]; } - /** Get token beginning line number. */ +/** + * {@inheritDoc} + * + * Get token beginning line number. + */ @Override public final int getBeginLine() { return bufline[tokenBegin]; } - /** Backup a number of characters. */ +/** + * {@inheritDoc} + * + * Backup a number of characters. + */ @Override public final void backup(int amount) { inBuf += amount; @@ -269,7 +293,11 @@ public CssCharStream(java.io.Reader dstream, int startline, int startcolumn) this(dstream, startline, startcolumn, 4096); } - /** Get token literal value. */ +/** + * {@inheritDoc} + * + * Get token literal value. + */ @Override public final String getImage() { @@ -278,7 +306,11 @@ public final String getImage() return new String(buffer, tokenBegin, bufsize - tokenBegin) + new String(buffer, 0, bufpos + 1); } - /** Get the suffix. */ +/** + * {@inheritDoc} + * + * Get the suffix. + */ @Override public final char[] getSuffix(int len) { @@ -295,7 +327,11 @@ public final char[] getSuffix(int len) return ret; } - /** Reset buffer when finished. */ +/** + * {@inheritDoc} + * + * Reset buffer when finished. + */ @Override public void done() { @@ -353,21 +389,25 @@ public void adjustBeginLineColumn(int newLine, int newCol) column = bufcolumn[j]; } + /** {@inheritDoc} */ @Override public void setTabSize(int i) { tabSize = i; } + /** {@inheritDoc} */ @Override public int getTabSize() { return tabSize; } + /** {@inheritDoc} */ @Override public boolean isTrackLineColumn() { return trackLineColumn; } + /** {@inheritDoc} */ @Override public void setTrackLineColumn(boolean tlc) { trackLineColumn = tlc; diff --git a/src/main/java/org/htmlunit/cssparser/parser/InputSource.java b/src/main/java/org/htmlunit/cssparser/parser/InputSource.java index ab473f0..3f94e82 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/InputSource.java +++ b/src/main/java/org/htmlunit/cssparser/parser/InputSource.java @@ -38,6 +38,8 @@ public InputSource(final Reader reader) { } /** + *

getReader.

+ * * @return the reader if defined */ public Reader getReader() { @@ -45,6 +47,8 @@ public Reader getReader() { } /** + *

getURI.

+ * * @return the uri if set */ public String getURI() { @@ -52,6 +56,8 @@ public String getURI() { } /** + *

setURI.

+ * * @param uri the uri */ public void setURI(final String uri) { @@ -59,6 +65,8 @@ public void setURI(final String uri) { } /** + *

getMedia.

+ * * @return the media if set */ public String getMedia() { @@ -69,6 +77,8 @@ public String getMedia() { } /** + *

setMedia.

+ * * @param media the media */ public void setMedia(final String media) { @@ -76,6 +86,8 @@ public void setMedia(final String media) { } /** + *

getTitle.

+ * * @return the title if set */ public String getTitle() { @@ -83,12 +95,15 @@ public String getTitle() { } /** + *

setTitle.

+ * * @param title the title */ public void setTitle(final String title) { title_ = title; } + /** {@inheritDoc} */ @Override public void close() throws IOException { reader_.close(); diff --git a/src/main/java/org/htmlunit/cssparser/parser/LexicalUnit.java b/src/main/java/org/htmlunit/cssparser/parser/LexicalUnit.java index dc97176..1f50036 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/LexicalUnit.java +++ b/src/main/java/org/htmlunit/cssparser/parser/LexicalUnit.java @@ -132,61 +132,85 @@ enum LexicalUnitType { } /** + *

getLexicalUnitType.

+ * * @return an integer indicating the type of LexicalUnit. */ LexicalUnitType getLexicalUnitType(); /** + *

getNextLexicalUnit.

+ * * @return the next value or null if any. */ LexicalUnit getNextLexicalUnit(); /** + *

getPreviousLexicalUnit.

+ * * @return the previous value or null if any. */ LexicalUnit getPreviousLexicalUnit(); /** + *

getIntegerValue.

+ * * @return the integer value. */ int getIntegerValue(); /** + *

getDoubleValue.

+ * * @return the double value. */ double getDoubleValue(); /** + *

getDimensionUnitText.

+ * * @return the string representation of the unit. */ String getDimensionUnitText(); /** + *

getFunctionName.

+ * * @return the name of the function. */ String getFunctionName(); /** + *

getParameters.

+ * * @return the function parameters including operators (like the comma). */ LexicalUnit getParameters(); /** + *

getStringValue.

+ * * @return the string value. */ String getStringValue(); /** + *

getSubValues.

+ * * @return a list of values inside the sub expression. */ LexicalUnit getSubValues(); /** + *

getLocator.

+ * * @return the locator */ Locator getLocator(); /** + *

setLocator.

+ * * @param locator the new locator */ void setLocator(Locator locator); diff --git a/src/main/java/org/htmlunit/cssparser/parser/Locatable.java b/src/main/java/org/htmlunit/cssparser/parser/Locatable.java index 9b954f4..ee7be60 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/Locatable.java +++ b/src/main/java/org/htmlunit/cssparser/parser/Locatable.java @@ -22,6 +22,8 @@ public interface Locatable { /** + *

getLocator.

+ * * @return the locator */ Locator getLocator(); diff --git a/src/main/java/org/htmlunit/cssparser/parser/Locator.java b/src/main/java/org/htmlunit/cssparser/parser/Locator.java index e4399a2..285261d 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/Locator.java +++ b/src/main/java/org/htmlunit/cssparser/parser/Locator.java @@ -42,6 +42,8 @@ public Locator(final String uri, final int line, final int column) { } /** + *

getUri.

+ * * @return the uri */ public String getUri() { @@ -95,6 +97,7 @@ public void setLineNumber(final int line) { lineNumber_ = line; } + /** {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (this == obj) { @@ -118,6 +121,7 @@ public int hashCode() { return hash; } + /** {@inheritDoc} */ @Override public String toString() { return new StringBuilder().append(getUri()).append(" (") diff --git a/src/main/java/org/htmlunit/cssparser/parser/condition/ClassCondition.java b/src/main/java/org/htmlunit/cssparser/parser/condition/ClassCondition.java index a9d5264..8959db5 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/condition/ClassCondition.java +++ b/src/main/java/org/htmlunit/cssparser/parser/condition/ClassCondition.java @@ -20,6 +20,7 @@ import org.htmlunit.cssparser.parser.Locator; /** + *

ClassCondition class.

* * @author Ronald Brill */ @@ -37,27 +38,25 @@ public ClassCondition(final String value, final Locator locator) { setLocator(locator); } + /** {@inheritDoc} */ @Override public ConditionType getConditionType() { return ConditionType.CLASS_CONDITION; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public String getLocalName() { return null; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public String getValue() { return value_; } + /** {@inheritDoc} */ @Override public String toString() { final String value = getValue(); diff --git a/src/main/java/org/htmlunit/cssparser/parser/condition/Condition.java b/src/main/java/org/htmlunit/cssparser/parser/condition/Condition.java index c87bf1d..1045cb3 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/condition/Condition.java +++ b/src/main/java/org/htmlunit/cssparser/parser/condition/Condition.java @@ -17,6 +17,8 @@ import org.htmlunit.cssparser.parser.Locatable; /** + *

Condition interface.

+ * * @author Ronald Brill */ public interface Condition extends Locatable { @@ -50,16 +52,22 @@ enum ConditionType { } /** + *

getConditionType.

+ * * @return the associated condition type */ ConditionType getConditionType(); /** + *

getValue.

+ * * @return the value */ String getValue(); /** + *

getLocalName.

+ * * @return the local name */ String getLocalName(); diff --git a/src/main/java/org/htmlunit/cssparser/parser/condition/IdCondition.java b/src/main/java/org/htmlunit/cssparser/parser/condition/IdCondition.java index 7d96d32..af109a0 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/condition/IdCondition.java +++ b/src/main/java/org/htmlunit/cssparser/parser/condition/IdCondition.java @@ -20,6 +20,8 @@ import org.htmlunit.cssparser.parser.Locator; /** + *

IdCondition class.

+ * * @author Ronald Brill */ public class IdCondition extends AbstractLocatable implements Condition, Serializable { @@ -28,6 +30,7 @@ public class IdCondition extends AbstractLocatable implements Condition, Seriali /** * Ctor. + * * @param value the value * @param locator the locator */ @@ -36,30 +39,25 @@ public IdCondition(final String value, final Locator locator) { setLocator(locator); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public ConditionType getConditionType() { return ConditionType.ID_CONDITION; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public String getLocalName() { return null; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public String getValue() { return value_; } + /** {@inheritDoc} */ @Override public String toString() { final String value = getValue(); diff --git a/src/main/java/org/htmlunit/cssparser/parser/condition/LangCondition.java b/src/main/java/org/htmlunit/cssparser/parser/condition/LangCondition.java index b03c5c4..e5163ae 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/condition/LangCondition.java +++ b/src/main/java/org/htmlunit/cssparser/parser/condition/LangCondition.java @@ -71,4 +71,4 @@ public String toString() { result.append(")"); return result.toString(); } -} +} \ No newline at end of file diff --git a/src/main/java/org/htmlunit/cssparser/parser/condition/OneOfAttributeCondition.java b/src/main/java/org/htmlunit/cssparser/parser/condition/OneOfAttributeCondition.java index 3332fab..cc4382a 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/condition/OneOfAttributeCondition.java +++ b/src/main/java/org/htmlunit/cssparser/parser/condition/OneOfAttributeCondition.java @@ -15,13 +15,15 @@ package org.htmlunit.cssparser.parser.condition; /** + *

OneOfAttributeCondition class.

+ * * @author Ronald Brill */ public class OneOfAttributeCondition extends AttributeCondition { /** * Ctor. - * @param localName the local value + * @param localName the local name * @param value the value * @param caseInSensitive null if not set, true/false for i/s */ @@ -29,11 +31,13 @@ public OneOfAttributeCondition(final String localName, final String value, final super(localName, value, caseInSensitive); } + /** {@inheritDoc} */ @Override public ConditionType getConditionType() { return ConditionType.ONE_OF_ATTRIBUTE_CONDITION; } + /** {@inheritDoc} */ @Override public String getOperator() { return "~="; diff --git a/src/main/java/org/htmlunit/cssparser/parser/condition/PrefixAttributeCondition.java b/src/main/java/org/htmlunit/cssparser/parser/condition/PrefixAttributeCondition.java index 9ffc2ed..50b5ec1 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/condition/PrefixAttributeCondition.java +++ b/src/main/java/org/htmlunit/cssparser/parser/condition/PrefixAttributeCondition.java @@ -21,7 +21,7 @@ public class PrefixAttributeCondition extends AttributeCondition { /** * Ctor. - * @param localName the local value + * @param localName the local name * @param value the value * @param caseInSensitive null if not set, true/false for i/s */ diff --git a/src/main/java/org/htmlunit/cssparser/parser/condition/PseudoClassCondition.java b/src/main/java/org/htmlunit/cssparser/parser/condition/PseudoClassCondition.java index 5dbc308..d6d00cb 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/condition/PseudoClassCondition.java +++ b/src/main/java/org/htmlunit/cssparser/parser/condition/PseudoClassCondition.java @@ -20,6 +20,7 @@ import org.htmlunit.cssparser.parser.Locator; /** + *

PseudoClassCondition class.

* * @author Ronald Brill */ @@ -40,27 +41,25 @@ public PseudoClassCondition(final String value, final Locator locator, final boo doubleColon_ = doubleColon; } + /** {@inheritDoc} */ @Override public ConditionType getConditionType() { return ConditionType.PSEUDO_CLASS_CONDITION; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public String getLocalName() { return null; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public String getValue() { return value_; } + /** {@inheritDoc} */ @Override public String toString() { final String value = getValue(); diff --git a/src/main/java/org/htmlunit/cssparser/parser/condition/SubstringAttributeCondition.java b/src/main/java/org/htmlunit/cssparser/parser/condition/SubstringAttributeCondition.java index 1508ec3..0ea0406 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/condition/SubstringAttributeCondition.java +++ b/src/main/java/org/htmlunit/cssparser/parser/condition/SubstringAttributeCondition.java @@ -15,6 +15,8 @@ package org.htmlunit.cssparser.parser.condition; /** + *

SubstringAttributeCondition class.

+ * * @author Ronald Brill */ public class SubstringAttributeCondition extends AttributeCondition { @@ -29,11 +31,13 @@ public SubstringAttributeCondition(final String localName, final String value, f super(localName, value, caseInSensitive); } + /** {@inheritDoc} */ @Override public ConditionType getConditionType() { return ConditionType.SUBSTRING_ATTRIBUTE_CONDITION; //for now } + /** {@inheritDoc} */ @Override public String getOperator() { return "*="; diff --git a/src/main/java/org/htmlunit/cssparser/parser/condition/SuffixAttributeCondition.java b/src/main/java/org/htmlunit/cssparser/parser/condition/SuffixAttributeCondition.java index 2d8f064..564ba2a 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/condition/SuffixAttributeCondition.java +++ b/src/main/java/org/htmlunit/cssparser/parser/condition/SuffixAttributeCondition.java @@ -15,6 +15,8 @@ package org.htmlunit.cssparser.parser.condition; /** + *

SuffixAttributeCondition class.

+ * * @author Ronald Brill */ public class SuffixAttributeCondition extends AttributeCondition { @@ -29,11 +31,13 @@ public SuffixAttributeCondition(final String localName, final String value, fina super(localName, value, caseInSensitive); } + /** {@inheritDoc} */ @Override public ConditionType getConditionType() { return ConditionType.SUFFIX_ATTRIBUTE_CONDITION; //for now } + /** {@inheritDoc} */ @Override public String getOperator() { return "$="; diff --git a/src/main/java/org/htmlunit/cssparser/parser/media/MediaQuery.java b/src/main/java/org/htmlunit/cssparser/parser/media/MediaQuery.java index 50acd5b..b914355 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/media/MediaQuery.java +++ b/src/main/java/org/htmlunit/cssparser/parser/media/MediaQuery.java @@ -22,6 +22,8 @@ import org.htmlunit.cssparser.parser.AbstractLocatable; /** + *

MediaQuery class.

+ * * @author Ronald Brill */ public class MediaQuery extends AbstractLocatable implements Serializable { @@ -58,6 +60,8 @@ public MediaQuery(final String media, final boolean isOnly, final boolean isNot) } /** + *

getMedia.

+ * * @return the media */ public String getMedia() { @@ -65,6 +69,8 @@ public String getMedia() { } /** + *

getProperties.

+ * * @return the list of properties */ public List getProperties() { @@ -73,6 +79,7 @@ public List getProperties() { /** * Adds a property to the list. + * * @param mp the property to add */ public void addMediaProperty(final Property mp) { @@ -80,6 +87,8 @@ public void addMediaProperty(final Property mp) { } /** + *

isOnly.

+ * * @return the is only flag */ public boolean isOnly() { @@ -87,12 +96,15 @@ public boolean isOnly() { } /** + *

isNot.

+ * * @return the is not flag */ public boolean isNot() { return isNot_; } + /** {@inheritDoc} */ @Override public String toString() { final StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/htmlunit/cssparser/parser/media/MediaQueryList.java b/src/main/java/org/htmlunit/cssparser/parser/media/MediaQueryList.java index 2cd298f..0bae855 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/media/MediaQueryList.java +++ b/src/main/java/org/htmlunit/cssparser/parser/media/MediaQueryList.java @@ -36,6 +36,8 @@ public MediaQueryList() { } /** + *

getLength.

+ * * @return the number of mediaQueries */ public int getLength() { @@ -43,6 +45,7 @@ public int getLength() { } /** + *

getMediaQueries.

* @return the list of media queries */ public List getMediaQueries() { @@ -51,12 +54,14 @@ public List getMediaQueries() { /** * Adds a new media query to the list. + * * @param mediaQuery the media query to add */ public void add(final MediaQuery mediaQuery) { mediaQueries_.add(mediaQuery); } + /** {@inheritDoc} */ @Override public String toString() { final StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/htmlunit/cssparser/parser/selector/AbstractSelector.java b/src/main/java/org/htmlunit/cssparser/parser/selector/AbstractSelector.java index 30a4c17..ea28b4a 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/selector/AbstractSelector.java +++ b/src/main/java/org/htmlunit/cssparser/parser/selector/AbstractSelector.java @@ -19,12 +19,15 @@ import org.htmlunit.cssparser.parser.AbstractLocatable; /** + *

Abstract AbstractSelector class.

+ * * @author Ronald Brill */ public abstract class AbstractSelector extends AbstractLocatable implements Selector, Serializable { private SelectorSpecificity specificity_; + /** {@inheritDoc} */ @Override public SelectorSpecificity getSelectorSpecificity() { if (specificity_ == null) { diff --git a/src/main/java/org/htmlunit/cssparser/parser/selector/ChildSelector.java b/src/main/java/org/htmlunit/cssparser/parser/selector/ChildSelector.java index f7fbe38..c847bec 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/selector/ChildSelector.java +++ b/src/main/java/org/htmlunit/cssparser/parser/selector/ChildSelector.java @@ -69,4 +69,4 @@ public String toString() { return sb.toString(); } -} +} \ No newline at end of file diff --git a/src/main/java/org/htmlunit/cssparser/parser/selector/DescendantSelector.java b/src/main/java/org/htmlunit/cssparser/parser/selector/DescendantSelector.java index ed3df6b..35bbd61 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/selector/DescendantSelector.java +++ b/src/main/java/org/htmlunit/cssparser/parser/selector/DescendantSelector.java @@ -15,6 +15,8 @@ package org.htmlunit.cssparser.parser.selector; /** + *

DescendantSelector class.

+ * * @author Ronald Brill */ public class DescendantSelector extends AbstractSelector { @@ -36,23 +38,28 @@ public DescendantSelector(final Selector ancestorSelector, final SimpleSelector simpleSelector_ = simpleSelector; } + /** {@inheritDoc} */ @Override public SelectorType getSelectorType() { return SelectorType.DESCENDANT_SELECTOR; } /** + *

getAncestorSelector.

+ * * @return the anchestor selector */ public Selector getAncestorSelector() { return ancestorSelector_; } + /** {@inheritDoc} */ @Override public SimpleSelector getSimpleSelector() { return simpleSelector_; } + /** {@inheritDoc} */ @Override public String toString() { final StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/htmlunit/cssparser/parser/selector/DirectAdjacentSelector.java b/src/main/java/org/htmlunit/cssparser/parser/selector/DirectAdjacentSelector.java index e747d9f..51bde09 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/selector/DirectAdjacentSelector.java +++ b/src/main/java/org/htmlunit/cssparser/parser/selector/DirectAdjacentSelector.java @@ -15,6 +15,8 @@ package org.htmlunit.cssparser.parser.selector; /** + *

DirectAdjacentSelector class.

+ * * @author Ronald Brill */ public class DirectAdjacentSelector extends AbstractSelector { @@ -35,23 +37,28 @@ public DirectAdjacentSelector(final Selector child, final SimpleSelector simpleS simpleSelector_ = simpleSelector; } + /** {@inheritDoc} */ @Override public SelectorType getSelectorType() { return SelectorType.DIRECT_ADJACENT_SELECTOR; } /** + *

getSelector.

+ * * @return the selector */ public Selector getSelector() { return selector_; } + /** {@inheritDoc} */ @Override public SimpleSelector getSimpleSelector() { return simpleSelector_; } + /** {@inheritDoc} */ @Override public String toString() { final StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/htmlunit/cssparser/parser/selector/ElementSelector.java b/src/main/java/org/htmlunit/cssparser/parser/selector/ElementSelector.java index 0fe06b6..9d54078 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/selector/ElementSelector.java +++ b/src/main/java/org/htmlunit/cssparser/parser/selector/ElementSelector.java @@ -22,6 +22,8 @@ import org.htmlunit.cssparser.parser.condition.Condition; /** + *

ElementSelector class.

+ * * @author Ronald Brill */ public class ElementSelector extends AbstractSelector implements SimpleSelector { @@ -47,17 +49,21 @@ public ElementSelector(final String localName, final Locator locator) { setLocator(locator); } + /** {@inheritDoc} */ @Override public SelectorType getSelectorType() { return SelectorType.ELEMENT_NODE_SELECTOR; } + /** {@inheritDoc} */ @Override public SimpleSelector getSimpleSelector() { return this; } /** + *

getLocalName.

+ * * @return the local name */ public String getLocalName() { @@ -65,6 +71,8 @@ public String getLocalName() { } /** + *

getLocalNameLowerCase.

+ * * @return the local name in lowercase */ public String getLocalNameLowerCase() { @@ -72,6 +80,8 @@ public String getLocalNameLowerCase() { } /** + *

getElementName.

+ * * @return the element name */ public String getElementName() { @@ -83,6 +93,8 @@ public String getElementName() { } /** + *

getConditions.

+ * * @return the conditions */ public List getConditions() { @@ -91,6 +103,7 @@ public List getConditions() { /** * Add a condition. + * * @param condition the condition to be added */ public void addCondition(final Condition condition) { @@ -100,6 +113,7 @@ public void addCondition(final Condition condition) { conditions_.add(condition); } + /** {@inheritDoc} */ @Override public String toString() { final StringBuilder result = new StringBuilder(); diff --git a/src/main/java/org/htmlunit/cssparser/parser/selector/GeneralAdjacentSelector.java b/src/main/java/org/htmlunit/cssparser/parser/selector/GeneralAdjacentSelector.java index 50d13fa..cebfa9d 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/selector/GeneralAdjacentSelector.java +++ b/src/main/java/org/htmlunit/cssparser/parser/selector/GeneralAdjacentSelector.java @@ -15,6 +15,8 @@ package org.htmlunit.cssparser.parser.selector; /** + *

GeneralAdjacentSelector class.

+ * * @author Ronald Brill */ public class GeneralAdjacentSelector extends AbstractSelector { @@ -35,23 +37,28 @@ public GeneralAdjacentSelector(final Selector child, final SimpleSelector simple simpleSelector_ = simpleSelector; } + /** {@inheritDoc} */ @Override public SelectorType getSelectorType() { return SelectorType.GENERAL_ADJACENT_SELECTOR; } /** + *

getSelector.

+ * * @return the selector */ public Selector getSelector() { return selector_; } + /** {@inheritDoc} */ @Override public SimpleSelector getSimpleSelector() { return simpleSelector_; } + /** {@inheritDoc} */ @Override public String toString() { final StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/htmlunit/cssparser/parser/selector/PseudoElementSelector.java b/src/main/java/org/htmlunit/cssparser/parser/selector/PseudoElementSelector.java index 562d767..fc7464b 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/selector/PseudoElementSelector.java +++ b/src/main/java/org/htmlunit/cssparser/parser/selector/PseudoElementSelector.java @@ -17,6 +17,7 @@ import org.htmlunit.cssparser.parser.Locator; /** + *

PseudoElementSelector class.

* * @author Ronald Brill */ @@ -37,23 +38,28 @@ public PseudoElementSelector(final String localName, final Locator locator, fina doubleColon_ = doubleColon; } + /** {@inheritDoc} */ @Override public SelectorType getSelectorType() { return SelectorType.PSEUDO_ELEMENT_SELECTOR; } + /** {@inheritDoc} */ @Override public SimpleSelector getSimpleSelector() { return this; } /** + *

getLocalName.

+ * * @return the local name */ public String getLocalName() { return localName_; } + /** {@inheritDoc} */ @Override public String toString() { if (localName_ == null) { diff --git a/src/main/java/org/htmlunit/cssparser/parser/selector/Selector.java b/src/main/java/org/htmlunit/cssparser/parser/selector/Selector.java index 982add3..5dafed0 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/selector/Selector.java +++ b/src/main/java/org/htmlunit/cssparser/parser/selector/Selector.java @@ -40,16 +40,22 @@ enum SelectorType { } /** + *

getSelectorType.

+ * * @return the associated selector type */ SelectorType getSelectorType(); /** + *

getSimpleSelector.

+ * * @return the simple selector part */ SimpleSelector getSimpleSelector(); /** + *

getSelectorSpecificity.

+ * * @return the selector specificity */ SelectorSpecificity getSelectorSpecificity(); diff --git a/src/main/java/org/htmlunit/cssparser/parser/selector/SelectorListImpl.java b/src/main/java/org/htmlunit/cssparser/parser/selector/SelectorListImpl.java index 704231a..3accb6f 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/selector/SelectorListImpl.java +++ b/src/main/java/org/htmlunit/cssparser/parser/selector/SelectorListImpl.java @@ -34,12 +34,15 @@ public class SelectorListImpl extends AbstractLocatable implements SelectorList, private final List selectors_ = new ArrayList<>(); /** + *

getSelectors.

+ * * @return the list of selectors. */ public List getSelectors() { return selectors_; } + /** {@inheritDoc} */ @Override public String toString() { return selectors_.stream() @@ -47,116 +50,139 @@ public String toString() { .collect(Collectors.joining(", ")); } + /** {@inheritDoc} */ @Override public int size() { return selectors_.size(); } + /** {@inheritDoc} */ @Override public boolean isEmpty() { return selectors_.isEmpty(); } + /** {@inheritDoc} */ @Override public boolean contains(final Object o) { return selectors_.contains(o); } + /** {@inheritDoc} */ @Override public Iterator iterator() { return selectors_.iterator(); } + /** {@inheritDoc} */ @Override public Object[] toArray() { return selectors_.toArray(); } + /** {@inheritDoc} */ @Override public T[] toArray(final T[] a) { return selectors_.toArray(a); } + /** {@inheritDoc} */ @Override public boolean add(final Selector e) { return selectors_.add(e); } + /** {@inheritDoc} */ @Override public boolean remove(final Object o) { return selectors_.remove(o); } + /** {@inheritDoc} */ @Override public boolean containsAll(final Collection c) { return selectors_.containsAll(c); } + /** {@inheritDoc} */ @Override public boolean addAll(final Collection c) { return selectors_.addAll(c); } + /** {@inheritDoc} */ @Override public boolean addAll(final int index, final Collection c) { return selectors_.addAll(index, c); } + /** {@inheritDoc} */ @Override public boolean removeAll(final Collection c) { return selectors_.removeAll(c); } + /** {@inheritDoc} */ @Override public boolean retainAll(final Collection c) { return selectors_.retainAll(c); } + /** {@inheritDoc} */ @Override public void clear() { selectors_.clear(); } + /** {@inheritDoc} */ @Override public Selector get(final int index) { return selectors_.get(index); } + /** {@inheritDoc} */ @Override public Selector set(final int index, final Selector element) { return selectors_.set(index, element); } + /** {@inheritDoc} */ @Override public void add(final int index, final Selector element) { selectors_.add(index, element); } + /** {@inheritDoc} */ @Override public Selector remove(final int index) { return selectors_.remove(index); } + /** {@inheritDoc} */ @Override public int indexOf(final Object o) { return selectors_.indexOf(o); } + /** {@inheritDoc} */ @Override public int lastIndexOf(final Object o) { return selectors_.lastIndexOf(o); } + /** {@inheritDoc} */ @Override public ListIterator listIterator() { return selectors_.listIterator(); } + /** {@inheritDoc} */ @Override public ListIterator listIterator(final int index) { return selectors_.listIterator(index); } + /** {@inheritDoc} */ @Override public List subList(final int fromIndex, final int toIndex) { return selectors_.subList(fromIndex, toIndex);