001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package org.netbeans.modules.compapp.casaeditor.model.casa;
042:
043: /**
044: *
045: * @author jqian
046: */
047: public interface CasaComponentVisitor {
048:
049: void visit(Casa target);
050:
051: void visit(CasaServiceUnits target);
052:
053: void visit(CasaServiceEngineServiceUnit target);
054:
055: void visit(CasaBindingComponentServiceUnit target);
056:
057: void visit(CasaConnections target);
058:
059: void visit(CasaConnection target);
060:
061: void visit(CasaEndpoints target);
062:
063: void visit(CasaEndpoint target);
064:
065: void visit(CasaConsumes target);
066:
067: void visit(CasaProvides target);
068:
069: void visit(CasaPorts target);
070:
071: void visit(CasaPort target);
072:
073: void visit(CasaPortTypes target);
074:
075: void visit(CasaBindings target);
076:
077: void visit(CasaServices target);
078:
079: void visit(CasaLink target);
080:
081: void visit(CasaRegions target);
082:
083: void visit(CasaRegion target);
084:
085: void visit(CasaExtensibilityElement target);
086:
087: /**
088: * Default shallow visitor.
089: */
090: public static class Default implements CasaComponentVisitor {
091:
092: public void visit(Casa target) {
093: visitComponent(target);
094: }
095:
096: public void visit(CasaServiceUnits target) {
097: visitComponent(target);
098: }
099:
100: public void visit(CasaServiceEngineServiceUnit target) {
101: visitComponent(target);
102: }
103:
104: public void visit(CasaBindingComponentServiceUnit target) {
105: visitComponent(target);
106: }
107:
108: public void visit(CasaConnections target) {
109: visitComponent(target);
110: }
111:
112: public void visit(CasaConnection target) {
113: visitComponent(target);
114: }
115:
116: public void visit(CasaPorts target) {
117: visitComponent(target);
118: }
119:
120: public void visit(CasaPort target) {
121: visitComponent(target);
122: }
123:
124: public void visit(CasaPortTypes target) {
125: visitComponent(target);
126: }
127:
128: public void visit(CasaBindings target) {
129: visitComponent(target);
130: }
131:
132: public void visit(CasaServices target) {
133: visitComponent(target);
134: }
135:
136: public void visit(CasaLink target) {
137: visitComponent(target);
138: }
139:
140: public void visit(CasaRegions target) {
141: visitComponent(target);
142: }
143:
144: public void visit(CasaRegion target) {
145: visitComponent(target);
146: }
147:
148: public void visit(CasaEndpoints target) {
149: visitComponent(target);
150: }
151:
152: public void visit(CasaEndpoint target) {
153: visitComponent(target);
154: }
155:
156: public void visit(CasaConsumes target) {
157: visitComponent(target);
158: }
159:
160: public void visit(CasaProvides target) {
161: visitComponent(target);
162: }
163:
164: public void visit(CasaExtensibilityElement target) {
165: visitComponent(target);
166: }
167:
168: protected void visitComponent(CasaComponent target) {
169: }
170:
171: }
172:
173: /**
174: * Deep visitor.
175: */
176: public static class Deep extends Default {
177: @Override
178: protected void visitComponent(CasaComponent component) {
179: for (CasaComponent child : component.getChildren()) {
180: child.accept(this);
181: }
182: }
183: }
184: }
|