當前位置: 首頁>>代碼示例>>Java>>正文


Java Visitable.getClass方法代碼示例

本文整理匯總了Java中com.akiban.sql.parser.Visitable.getClass方法的典型用法代碼示例。如果您正苦於以下問題:Java Visitable.getClass方法的具體用法?Java Visitable.getClass怎麽用?Java Visitable.getClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.akiban.sql.parser.Visitable的用法示例。


在下文中一共展示了Visitable.getClass方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: visit

import com.akiban.sql.parser.Visitable; //導入方法依賴的package包/類
/**
 * Main visit function, delegates columns to an 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.RESULT_COLUMN_LIST:
		break;
	case NodeTypes.RESULT_COLUMN:
		visit((ResultColumn) node);
		break;
	case NodeTypes.ALL_RESULT_COLUMN:
		visit((AllResultColumn) node);
		break;
	case NodeTypes.AGGREGATE_NODE:
		visit((AggregateNode) node);
		break;
	case NodeTypes.COLUMN_REFERENCE:
		visit((ColumnReference) node);
		break;
	case NodeTypes.JAVA_TO_SQL_VALUE_NODE:
		break;
	case NodeTypes.SQL_TO_JAVA_VALUE_NODE:
		break;
	case NodeTypes.STATIC_METHOD_CALL_NODE:
		visit((StaticMethodCallNode) node);
		break;
	default:

		if (node instanceof BinaryOperatorNode) {
			visit((BinaryOperatorNode) node);
		} else if (node instanceof ConstantNode) {

			isPuffering = true;
			extendCol(((ConstantNode) node).getValue().toString());

		} else
			throw new StandardException("Unbekannter Parameter: \n "
					+ node.getClass() + "\n" + node.toString());

	}

	return node;

}
 
開發者ID:UniversityOfWuerzburg-ChairCompSciVI,項目名稱:ueps,代碼行數:52,代碼來源:ResultColumnListVisitor.java

示例6: visit

import com.akiban.sql.parser.Visitable; //導入方法依賴的package包/類
/**
 * Main visit function, gets operator and delegates operands 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.AGGREGATE_NODE:

		if (operator == null) {
			operator = ((AggregateNode) node).getAggregateName();
		} else {
			visit((AggregateNode) node);
			stopChilds = true;
		}

		if (operator.equals("COUNT(*)")) { // count needs special treatment
			operands.add(new Structure("*"));
			conditionTree = (new PrefixOperatorStructure("COUNT", operands));
		}

		break;

	case NodeTypes.COLUMN_REFERENCE:

		ColumnStructure tmp5 = new ColumnStructure(
				((ColumnReference) node).getColumnName(),
				((ColumnReference) node).getTableName());

		setOperand(tmp5);

		break;

	default:

		if (node instanceof BinaryOperatorNode) {
			visit((BinaryOperatorNode) node);
		} else if (node instanceof ConstantNode) {

			Structure tmp2 = new Structure(((ConstantNode) node).getValue()
					.toString());
			setOperand(tmp2);

		} else if (node instanceof StaticMethodCallNode) {

			StaticMethodCallNodeVisitor tvisitor = new StaticMethodCallNodeVisitor();
			node.accept(tvisitor);
			PrefixOperatorStructure tmp4 = tvisitor.getConditionTree();
			setOperand(tmp4);

		} else if (node instanceof SQLToJavaValueNode) {

		} else {
			throw new StandardException("Unbekannter Parameter: \n "
					+ node.getClass() + "\n" + node.toString());
		}

		break;

	}

	return node;

}
 
開發者ID:UniversityOfWuerzburg-ChairCompSciVI,項目名稱:ueps,代碼行數:70,代碼來源:AggregateNodeVisitor.java


注:本文中的com.akiban.sql.parser.Visitable.getClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。