Skip to content

Lomboked the code. #581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
882 changes: 444 additions & 438 deletions pom.xml

Large diffs are not rendered by default.

28 changes: 6 additions & 22 deletions src/main/java/net/sf/jsqlparser/expression/Alias.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,22 @@
*/
package net.sf.jsqlparser.expression;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
*
* @author toben
*/
@Data
@AllArgsConstructor
public class Alias {

private String name;
private boolean useAs = true;

public Alias(String name) {
this.name = name;
}

public Alias(String name, boolean useAs) {
this.name = name;
this.useAs = useAs;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public boolean isUseAs() {
return useAs;
}

public void setUseAs(boolean useAs) {
this.useAs = useAs;
this(name, true);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,17 @@
*/
package net.sf.jsqlparser.expression;

import lombok.Data;
import lombok.RequiredArgsConstructor;
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
import net.sf.jsqlparser.statement.select.SubSelect;

@Data
@RequiredArgsConstructor
public class AllComparisonExpression extends ASTNodeAccessImpl implements Expression {

private final SubSelect subSelect;

public AllComparisonExpression(SubSelect subSelect) {
this.subSelect = subSelect;
}

public SubSelect getSubSelect() {
return subSelect;
}

@Override
public void accept(ExpressionVisitor expressionVisitor) {
expressionVisitor.visit(this);
Expand Down
93 changes: 7 additions & 86 deletions src/main/java/net/sf/jsqlparser/expression/AnalyticExpression.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
*/
package net.sf.jsqlparser.expression;

import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
import net.sf.jsqlparser.statement.select.OrderByElement;

import java.util.List;

import lombok.Data;
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
import net.sf.jsqlparser.statement.select.OrderByElement;
import net.sf.jsqlparser.statement.select.PlainSelect;

/**
Expand All @@ -36,6 +37,7 @@
*
* @author tw
*/
@Data
public class AnalyticExpression extends ASTNodeAccessImpl implements Expression {

private ExpressionList partitionExpressionList;
Expand All @@ -54,78 +56,6 @@ public void accept(ExpressionVisitor expressionVisitor) {
expressionVisitor.visit(this);
}

public List<OrderByElement> getOrderByElements() {
return orderByElements;
}

public void setOrderByElements(List<OrderByElement> orderByElements) {
this.orderByElements = orderByElements;
}

public KeepExpression getKeep() {
return keep;
}

public void setKeep(KeepExpression keep) {
this.keep = keep;
}

public ExpressionList getPartitionExpressionList() {
return partitionExpressionList;
}

public void setPartitionExpressionList(ExpressionList partitionExpressionList) {
this.partitionExpressionList = partitionExpressionList;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public Expression getExpression() {
return expression;
}

public void setExpression(Expression expression) {
this.expression = expression;
}

public Expression getOffset() {
return offset;
}

public void setOffset(Expression offset) {
this.offset = offset;
}

public Expression getDefaultValue() {
return defaultValue;
}

public void setDefaultValue(Expression defaultValue) {
this.defaultValue = defaultValue;
}

public WindowElement getWindowElement() {
return windowElement;
}

public void setWindowElement(WindowElement windowElement) {
this.windowElement = windowElement;
}

public AnalyticType getType() {
return type;
}

public void setType(AnalyticType type) {
this.type = type;
}

@Override
public String toString() {
StringBuilder b = new StringBuilder();
Expand All @@ -146,7 +76,7 @@ public String toString() {
if (keep != null) {
b.append(keep.toString()).append(" ");
}

switch (type) {
case WITHIN_GROUP:
b.append("WITHIN GROUP");
Expand All @@ -164,19 +94,10 @@ public String toString() {
return b.toString();
}

public boolean isAllColumns() {
return allColumns;
}

public void setAllColumns(boolean allColumns) {
this.allColumns = allColumns;
}

private void toStringPartitionBy(StringBuilder b) {
if (partitionExpressionList != null && !partitionExpressionList.getExpressions().isEmpty()) {
b.append("PARTITION BY ");
b.append(PlainSelect.
getStringList(partitionExpressionList.getExpressions(), true, false));
b.append(PlainSelect.getStringList(partitionExpressionList.getExpressions(), true, false));
b.append(" ");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/
package net.sf.jsqlparser.expression;

import lombok.AllArgsConstructor;
import lombok.Data;
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
import net.sf.jsqlparser.statement.select.SubSelect;

Expand All @@ -29,29 +31,18 @@
*
* @author toben
*/
@Data
@AllArgsConstructor
public class AnyComparisonExpression extends ASTNodeAccessImpl implements Expression {

private final SubSelect subSelect;
private final AnyType anyType;

public AnyComparisonExpression(AnyType anyType, SubSelect subSelect) {
this.anyType = anyType;
this.subSelect = subSelect;
}

public SubSelect getSubSelect() {
return subSelect;
}
private final SubSelect subSelect;

@Override
public void accept(ExpressionVisitor expressionVisitor) {
expressionVisitor.visit(this);
}

public AnyType getAnyType() {
return anyType;
}

@Override
public String toString() {
return anyType.name() + " " + subSelect.toString();
Expand Down
36 changes: 18 additions & 18 deletions src/main/java/net/sf/jsqlparser/expression/AnyType.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
* #L%
*/
/*
* Copyright (C) 2015 JSQLParser.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
/*
* Copyright (C) 2015 JSQLParser.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package net.sf.jsqlparser.expression;

/**
Expand Down
36 changes: 2 additions & 34 deletions src/main/java/net/sf/jsqlparser/expression/BinaryExpression.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,56 +21,24 @@
*/
package net.sf.jsqlparser.expression;

import lombok.Data;
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;

/**
* A basic class for binary expressions, that is expressions having a left member and a right member
* which are in turn expressions.
*/
@Data
public abstract class BinaryExpression extends ASTNodeAccessImpl implements Expression {

private Expression leftExpression;
private Expression rightExpression;
private boolean not = false;



public BinaryExpression() {
}

public Expression getLeftExpression() {
return leftExpression;
}

public Expression getRightExpression() {
return rightExpression;
}

public void setLeftExpression(Expression expression) {
leftExpression = expression;
}

public void setRightExpression(Expression expression) {
rightExpression = expression;
}

public void setNot() {
not = true;
}

public void removeNot() {
not = false;
}

public boolean isNot() {
return not;
}

@Override
public String toString() {
return (not ? "NOT " : "") + getLeftExpression() + " " + getStringExpression() + " " + getRightExpression();
}

public abstract String getStringExpression();

}
Loading