当前位置: 首页>>代码示例>>Java>>正文


Java Visitable类代码示例

本文整理汇总了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;
}
 
开发者ID:alkida,项目名称:bidal,代码行数:18,代码来源:BashVisitor.java

示例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;

}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:26,代码来源:ResultColumnListVisitor.java

示例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;

}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:25,代码来源:OrderByListVisitor.java

示例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;

}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:19,代码来源:JoinNodeVisitor.java

示例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;

}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:26,代码来源:GroupByListVisitor.java

示例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;

}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:38,代码来源:UpdateColumnVisitor.java

示例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;

}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:16,代码来源:UpdateColumnVisitor.java

示例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;

}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:18,代码来源:LimitClauseVisitor.java

示例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;
}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:8,代码来源:SelectVisitor.java

示例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;

}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:43,代码来源:FromListVisitor.java

示例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;
}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:14,代码来源:FromListVisitor.java

示例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;

}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:36,代码来源:InsertVisitor.java

示例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;

}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:39,代码来源:StaticMethodCallNodeVisitor.java

示例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;

}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:14,代码来源:StaticMethodCallNodeVisitor.java

示例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;

}
 
开发者ID:UniversityOfWuerzburg-ChairCompSciVI,项目名称:ueps,代码行数:43,代码来源:JoinNodeVisitor.java


注:本文中的com.akiban.sql.parser.Visitable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。