01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19:
20: package org.netbeans.modules.xml.xpath.ext.visitor;
21:
22: import java.util.Collection;
23: import org.netbeans.modules.xml.xpath.ext.LocationStep;
24: import org.netbeans.modules.xml.xpath.ext.XPathCoreFunction;
25: import org.netbeans.modules.xml.xpath.ext.XPathCoreOperation;
26: import org.netbeans.modules.xml.xpath.ext.XPathExpression;
27: import org.netbeans.modules.xml.xpath.ext.XPathExpressionPath;
28: import org.netbeans.modules.xml.xpath.ext.XPathExtensionFunction;
29: import org.netbeans.modules.xml.xpath.ext.XPathLocationPath;
30: import org.netbeans.modules.xml.xpath.ext.XPathNumericLiteral;
31: import org.netbeans.modules.xml.xpath.ext.XPathOperationOrFuntion;
32: import org.netbeans.modules.xml.xpath.ext.XPathPredicateExpression;
33: import org.netbeans.modules.xml.xpath.ext.XPathStringLiteral;
34: import org.netbeans.modules.xml.xpath.ext.XPathVariableReference;
35:
36: /**
37: *
38: * @author radval
39: * @author nk160297
40: */
41: public abstract class XPathVisitorAdapter implements XPathVisitor {
42:
43: public void visit(LocationStep locationStep) {
44: }
45:
46: public void visit(XPathCoreFunction coreFunction) {
47: }
48:
49: public void visit(XPathCoreOperation coreOperation) {
50: }
51:
52: public void visit(XPathExpressionPath expressionPath) {
53: }
54:
55: public void visit(XPathExtensionFunction extensionFunction) {
56: }
57:
58: public void visit(XPathLocationPath locationPath) {
59: }
60:
61: public void visit(XPathNumericLiteral numericLiteral) {
62: }
63:
64: public void visit(XPathStringLiteral stringLiteral) {
65: }
66:
67: public void visit(XPathVariableReference vReference) {
68: }
69:
70: public void visit(XPathPredicateExpression predicate) {
71: XPathExpression predicateExpression = predicate.getPredicate();
72: if (predicateExpression != null) {
73: predicateExpression.accept(this );
74: }
75: }
76:
77: protected void visitChildren(XPathOperationOrFuntion expr) {
78: @SuppressWarnings(value="unchecked")
79: Collection<XPathExpression> children = expr.getChildren();
80: if (children != null) {
81: for (XPathExpression child : children) {
82: if (child != null) {
83: child.accept(this);
84: }
85: }
86: }
87: }
88: }
|