本文整理汇总了Java中net.sf.jsqlparser.expression.SignedExpression类的典型用法代码示例。如果您正苦于以下问题:Java SignedExpression类的具体用法?Java SignedExpression怎么用?Java SignedExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SignedExpression类属于net.sf.jsqlparser.expression包,在下文中一共展示了SignedExpression类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import net.sf.jsqlparser.expression.SignedExpression; //导入依赖的package包/类
@Override
public void visit(SignedExpression value)
{
Expression underlyingValue = value.getExpression();
if (underlyingValue instanceof DoubleValue)
{
DoubleValue doubleValue = (DoubleValue) underlyingValue;
doubleValue.setValue(value.getSign() == '-' ? -doubleValue.getValue() : doubleValue.getValue());
visit(doubleValue);
}
else if (underlyingValue instanceof LongValue)
{
LongValue longValue = (LongValue) underlyingValue;
longValue.setValue(value.getSign() == '-' ? -longValue.getValue() : longValue.getValue());
visit(longValue);
}
else
{
super.visit(value);
}
}
示例2: resolveValue
import net.sf.jsqlparser.expression.SignedExpression; //导入依赖的package包/类
private static Object resolveValue(Expression expression, boolean allowColumn) throws StatementExecutionException {
if (expression instanceof JdbcParameter) {
throw new StatementExecutionException("jdbcparameter expression not usable in this query");
} else if (allowColumn && expression instanceof net.sf.jsqlparser.schema.Column) {
// this is only for supporting back ticks in DDL
return ((net.sf.jsqlparser.schema.Column) expression).getColumnName();
} else if (expression instanceof StringValue) {
return ((StringValue) expression).getValue();
} else if (expression instanceof LongValue) {
return ((LongValue) expression).getValue();
} else if (expression instanceof TimestampValue) {
return ((TimestampValue) expression).getValue();
} else if (expression instanceof SignedExpression) {
SignedExpression se = (SignedExpression) expression;
switch (se.getSign()) {
case '+': {
return resolveValue(se.getExpression(), allowColumn);
}
case '-': {
Object value = resolveValue(se.getExpression(), allowColumn);
if (value == null) {
return null;
}
if (value instanceof Integer) {
return -1L * ((Integer) value);
} else if (value instanceof Long) {
return -1L * ((Long) value);
} else {
throw new StatementExecutionException("unsupported value type " + expression.getClass() + " with sign " + se.getSign() + " on value " + value + " of type " + value.getClass());
}
}
default:
throw new StatementExecutionException("unsupported value type " + expression.getClass() + " with sign " + se.getSign());
}
} else {
throw new StatementExecutionException("unsupported value type " + expression.getClass());
}
}
示例3: visit
import net.sf.jsqlparser.expression.SignedExpression; //导入依赖的package包/类
@Override
public void visit(SignedExpression signedExpression) {
buffer.append(signedExpression.getSign());
signedExpression.getExpression().accept(this);
}
示例4: visit
import net.sf.jsqlparser.expression.SignedExpression; //导入依赖的package包/类
@Override
public void visit(SignedExpression signedExpression) {
signedExpression.getExpression().accept(this);
}
示例5: visit
import net.sf.jsqlparser.expression.SignedExpression; //导入依赖的package包/类
@Override
public void visit(SignedExpression signedExpression) {
// TODO Auto-generated method stub
}
示例6: visit
import net.sf.jsqlparser.expression.SignedExpression; //导入依赖的package包/类
@Override
public void visit(SignedExpression se) {
se.getExpression().accept(this);
}
示例7: visit
import net.sf.jsqlparser.expression.SignedExpression; //导入依赖的package包/类
@Override
public void visit(SignedExpression signedExpression) {
context.setNegative('-' == signedExpression.getSign());
signedExpression.getExpression().accept(this);
context.setNegative(false);
}
示例8: visit
import net.sf.jsqlparser.expression.SignedExpression; //导入依赖的package包/类
public void visit(SignedExpression signedExpression) {
}
示例9: visit
import net.sf.jsqlparser.expression.SignedExpression; //导入依赖的package包/类
@Override
public void visit(SignedExpression arg0) {
isSimple = false;
}
示例10: visit
import net.sf.jsqlparser.expression.SignedExpression; //导入依赖的package包/类
@Override
public void visit(SignedExpression signed)
{
throw new UnsupportedSqlExpressionException("SIGNED"); //$NON-NLS-1$
}
示例11: visit
import net.sf.jsqlparser.expression.SignedExpression; //导入依赖的package包/类
@Override
public void visit(SignedExpression signed)
{
throw new IllegalOperationException("Illegal SQL ON expression: " + signed); //$NON-NLS-1$
}
示例12: visit
import net.sf.jsqlparser.expression.SignedExpression; //导入依赖的package包/类
@Override
public void visit(SignedExpression se) {
}
示例13: visit
import net.sf.jsqlparser.expression.SignedExpression; //导入依赖的package包/类
@Override
public void visit(SignedExpression signedExpression) {
}