當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。