本文整理汇总了Java中com.akiban.sql.parser.Visitable类的典型用法代码示例。如果您正苦于以下问题:Java Visitable类的具体用法?Java Visitable怎么用?Java Visitable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Visitable类属于com.akiban.sql.parser包,在下文中一共展示了Visitable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
public Visitable visit(Visitable v) throws StandardException {
if(v instanceof ResultColumnList)visit((ResultColumnList)v);
else if(v instanceof FromList)visit((FromList)v);
else if(v instanceof GroupByList)visit((GroupByList)v);
else if(v instanceof ResultColumn)visit((ResultColumn)v);
else if(v instanceof SelectNode){
SelectNode sn = (SelectNode)v;
ValueNode vn = sn.getWhereClause();
if( vn != null ){
ExpressionVisitor ev = new ExpressionVisitor(false);
vn.accept(ev);
where = ev.getGeneratedCommand();
}
}
else System.out.println(v.getClass().toString());
return null;
}
示例2: skipChildren
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
@Override
public boolean skipChildren(Visitable node) throws StandardException {
boolean tmp = false;
switch (((QueryTreeNode) node).getNodeType()) {
case NodeTypes.AGGREGATE_NODE:
tmp = true;
break;
case NodeTypes.RESULT_COLUMN:
if (mainKeyWord.equals("UPDATE"))
return true;
break;
case NodeTypes.STATIC_METHOD_CALL_NODE:
tmp = true;
break;
}
if (node instanceof BinaryOperatorNode) {
return true;
}
return tmp;
}
示例3: visit
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
/**
* Main visit function, delegates order by columns to sub visit function.
*
* @param node
* @throws StandardException
* @see com.akiban.sql.parser.Visitor#visit(com.akiban.sql.parser.Visitable)
*/
@Override
public Visitable visit(Visitable node) throws StandardException {
switch (((QueryTreeNode) node).getNodeType()) {
case NodeTypes.ORDER_BY_LIST:
break;
case NodeTypes.ORDER_BY_COLUMN:
visit((OrderByColumn) node);
break;
default:
// throw new StandardException("Unbekannter Parameter: \n " +
// node.getClass() + "\n" + node.toString());
}
return node;
}
示例4: skipChildren
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
@Override
public boolean skipChildren(Visitable node) throws StandardException {
switch (((QueryTreeNode) node).getNodeType()) {
case NodeTypes.JOIN_NODE:
case NodeTypes.FULL_OUTER_JOIN_NODE:
case NodeTypes.HALF_OUTER_JOIN_NODE:
if (stopChilds == true)
return true;
break;
}
if (node instanceof BinaryOperatorNode)
return true;
return false;
}
示例5: visit
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
/**
* Main visit function, delegates entries to the according sub visit
* function.
*
* @param node
* @throws StandardException
* @see com.akiban.sql.parser.Visitor#visit(com.akiban.sql.parser.Visitable)
*/
@Override
public Visitable visit(Visitable node) throws StandardException {
switch (((QueryTreeNode) node).getNodeType()) {
case NodeTypes.GROUP_BY_LIST:
break;
case NodeTypes.GROUP_BY_COLUMN:
visit((GroupByColumn) node);
break;
default:
// throw new StandardException("Unbekannter Parameter: \n " +
// node.getClass() + "\n" + node.toString());
}
return node;
}
示例6: visit
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
@Override
public Visitable visit(Visitable node) throws StandardException {
switch (((QueryTreeNode) node).getNodeType()) {
case NodeTypes.JAVA_TO_SQL_VALUE_NODE:
visit((JavaToSQLValueNode) node);
break;
case NodeTypes.RESULT_COLUMN:
break;
case NodeTypes.AGGREGATE_NODE:
visit((AggregateNode) node);
break;
case NodeTypes.COLUMN_REFERENCE:
ColumnStructure tmp = new ColumnStructure(
((ColumnReference) node).getColumnName(), null);
tableName = ((ColumnReference) node).getTableName();
setOperand(tmp);
break;
default:
if (node instanceof BinaryOperatorNode) {
visit((BinaryOperatorNode) node);
} else if (node instanceof ConstantNode) {
visit((ConstantNode) node);
} else if (node instanceof SQLToJavaValueNode) {
} else
throw new StandardException("Unbekannter Parameter: \n "
+ node.getClass() + "\n" + node.toString());
break;
}
return node;
}
示例7: skipChildren
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
@Override
public boolean skipChildren(Visitable node) throws StandardException {
if (node instanceof BinaryOperatorNode)
return true;
else if (node instanceof AggregateNode)
return true;
else if (node instanceof StaticMethodCallNode)
return true;
else if (rightOperand != null)
return true;
return false;
}
示例8: visit
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
/**
* Main visit function, gets limit offset.
*
* @param node
* @throws StandardException
* @see com.akiban.sql.parser.Visitor#visit(com.akiban.sql.parser.Visitable)
*/
@Override
public Visitable visit(Visitable node) throws StandardException {
if (node instanceof ConstantNode) {
offset = (int) ((ConstantNode) node).getValue();
}
return node;
}
示例9: skipChildren
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
@Override
public boolean skipChildren(Visitable node) throws StandardException {
if (node instanceof SubqueryNode)
return true;
return false;
}
示例10: visit
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
/**
* Main visit function, delegates entries to the according sub visit
* function.
*
* @param node
* @throws StandardException
* @see com.akiban.sql.parser.Visitor#visit(com.akiban.sql.parser.Visitable)
*/
@Override
public Visitable visit(Visitable node) throws StandardException {
switch (((QueryTreeNode) node).getNodeType()) {
case NodeTypes.FROM_LIST:
break;
case NodeTypes.FROM_BASE_TABLE:
tables.add(new TableStructure(((FromTable) node).getOrigTableName().getTableName()));
break;
case NodeTypes.FULL_OUTER_JOIN_NODE:
case NodeTypes.HALF_OUTER_JOIN_NODE:
case NodeTypes.JOIN_NODE:
visit((JoinNode) node);
break;
default:
if (node instanceof BinaryOperatorNode) {
} else if (node instanceof ConstantNode) {
} else if (node instanceof ColumnReference) {
} else {
throw new StandardException("Unbekannter Parameter: \n "
+ node.getClass() + "\n" + node.toString());
}
break;
}
return node;
}
示例11: skipChildren
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
@Override
public boolean skipChildren(Visitable node) throws StandardException {
boolean tmp = false;
switch (((QueryTreeNode) node).getNodeType()) {
case NodeTypes.JOIN_NODE:
tmp = true;
break;
}
return tmp;
}
示例12: visit
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
/**
* Main visit function, sub nodes to the according sub visit function.
*
* @param node
* @throws StandardException
* @see com.akiban.sql.parser.Visitor#visit(com.akiban.sql.parser.Visitable)
*/
@Override
public Visitable visit(Visitable node) throws StandardException {
switch (((QueryTreeNode) node).getNodeType()) {
case NodeTypes.INSERT_NODE:
if (((InsertNode) node).getTargetTableName() != null) {
table = new TableStructure(((InsertNode) node)
.getTargetTableName().toString());
}
if (((InsertNode) node).getTargetColumnList() != null) {
visit(((InsertNode) node).getTargetColumnList());
}
if (((InsertNode) node).getResultSetNode() != null) {
isValues = true;
visit(((InsertNode) node).getResultSetNode().getResultColumns());
isValues = false;
}
break;
}
return node;
}
示例13: visit
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
@Override
public Visitable visit(Visitable node) throws StandardException {
switch (((QueryTreeNode) node).getNodeType()) {
case NodeTypes.JAVA_TO_SQL_VALUE_NODE:
break;
case NodeTypes.STATIC_METHOD_CALL_NODE:
for (JavaValueNode nodeChild : ((StaticMethodCallNode) node)
.getMethodParameters()) {
WhereClauseVisitor wvisitor = new WhereClauseVisitor();
nodeChild.accept(wvisitor);
Structure tmp = wvisitor.getConditionTree();
operands.add(tmp);
}
operator = ((StaticMethodCallNode) node).getMethodName();
if (operator.equals("COUNT(*)")) {
operands.add(new Structure("*"));
conditionTree = (new PrefixOperatorStructure("COUNT", operands));
} else {
conditionTree = (new PrefixOperatorStructure(operator, operands));
}
break;
default:
throw new StandardException("Unbekannter Parameter: \n "
+ node.getClass() + "\n" + node.toString());
}
return node;
}
示例14: skipChildren
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
@Override
public boolean skipChildren(Visitable node) throws StandardException {
if (node instanceof BinaryOperatorNode)
return true;
else if (node instanceof AggregateNode)
return true;
else if (node instanceof StaticMethodCallNode)
return true;
return false;
}
示例15: visit
import com.akiban.sql.parser.Visitable; //导入依赖的package包/类
/**
* Main visit function, gets join type and delegates join tables and join
* clause to the according sub visit function.
*
* @param node
* @throws StandardException
* @see com.akiban.sql.parser.Visitor#visit(com.akiban.sql.parser.Visitable)
*/
@Override
public Visitable visit(Visitable node) throws StandardException {
switch (((QueryTreeNode) node).getNodeType()) {
case NodeTypes.JOIN_NODE:
joinType = "JOIN";
visit((JoinNode) node);
break;
case NodeTypes.FULL_OUTER_JOIN_NODE:
joinType = "FULL_OUTER_JOIN";
visit((JoinNode) node);
break;
case NodeTypes.HALF_OUTER_JOIN_NODE:
joinType = "HALF_OUTER_JOIN";
visit((JoinNode) node);
break;
case NodeTypes.FROM_BASE_TABLE:
setTable(new TableStructure(((FromTable) node).getOrigTableName().getTableName()));
break;
default:
if (node instanceof BinaryOperatorNode)
visit((BinaryOperatorNode) node);
else
throw new StandardException("Unbekannter Parameter: \n "
+ node.getClass() + "\n" + node.toString());
break;
}
return node;
}