Skip to content

Commit

Permalink
Rename constant names to match regular expressions and comply a namin…
Browse files Browse the repository at this point in the history
…g convention
  • Loading branch information
JeanDeboutGat committed Mar 30, 2021
1 parent c942d7c commit 51b8da2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
*/
public enum ExpressionType {

XPath, Regex, Css, JsonPath;
X_PATH, REGEX, CSS, JSON_PATH;

}
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,21 @@ public Selector getSelector() {

private Selector compileSelector() {
switch (expressionType) {
case Css:
case CSS:
if (expressionParams.length >= 1) {
return $(expressionValue, expressionParams[0]);
} else {
return $(expressionValue);
}
case XPath:
case X_PATH:
return xpath(expressionValue);
case Regex:
case REGEX:
if (expressionParams.length >= 1) {
return regex(expressionValue, Integer.parseInt(expressionParams[0]));
} else {
return regex(expressionValue);
}
case JsonPath:
case JSON_PATH:
return new JsonPathSelector(expressionValue);
default:
return xpath(expressionValue);
Expand Down

0 comments on commit 51b8da2

Please sign in to comment.