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.xml.axi.impl;
042:
043: import org.netbeans.modules.xml.schema.model.All;
044: import org.netbeans.modules.xml.schema.model.AnyAttribute;
045: import org.netbeans.modules.xml.schema.model.AnyElement;
046: import org.netbeans.modules.xml.schema.model.AttributeGroupReference;
047: import org.netbeans.modules.xml.schema.model.AttributeReference;
048: import org.netbeans.modules.xml.schema.model.Choice;
049: import org.netbeans.modules.xml.schema.model.ComplexContent;
050: import org.netbeans.modules.xml.schema.model.ComplexExtension;
051: import org.netbeans.modules.xml.schema.model.ElementReference;
052: import org.netbeans.modules.xml.schema.model.GlobalAttribute;
053: import org.netbeans.modules.xml.schema.model.GlobalAttributeGroup;
054: import org.netbeans.modules.xml.schema.model.GlobalComplexType;
055: import org.netbeans.modules.xml.schema.model.GlobalElement;
056: import org.netbeans.modules.xml.schema.model.GlobalGroup;
057: import org.netbeans.modules.xml.schema.model.GroupReference;
058: import org.netbeans.modules.xml.schema.model.LocalAttribute;
059: import org.netbeans.modules.xml.schema.model.LocalComplexType;
060: import org.netbeans.modules.xml.schema.model.LocalElement;
061: import org.netbeans.modules.xml.schema.model.Schema;
062: import org.netbeans.modules.xml.schema.model.Sequence;
063: import org.netbeans.modules.xml.schema.model.SimpleContent;
064: import org.netbeans.modules.xml.schema.model.SimpleExtension;
065: import org.netbeans.modules.xml.schema.model.visitor.DeepSchemaVisitor;
066:
067: /**
068: * An AXI model can be created with few schema componnets. This class must
069: * define a set of visit methods for those components and all the builder
070: * implementation must implement those.
071: *
072: * @author Samaresh (Samaresh.Panda@Sun.Com)
073: */
074: public abstract class AbstractModelBuilder extends DeepSchemaVisitor {
075:
076: public AbstractModelBuilder(AXIModelImpl model) {
077: this .model = model;
078: }
079:
080: public AXIModelImpl getModel() {
081: return model;
082: }
083:
084: public abstract void visit(Schema schema);
085:
086: public abstract void visit(AnyElement schemaComponent);
087:
088: public abstract void visit(AnyAttribute schemaComponent);
089:
090: public abstract void visit(GlobalElement schemaComponent);
091:
092: public abstract void visit(LocalElement component);
093:
094: public abstract void visit(ElementReference component);
095:
096: public abstract void visit(GlobalAttribute schemaComponent);
097:
098: public abstract void visit(LocalAttribute component);
099:
100: public abstract void visit(AttributeReference component);
101:
102: public abstract void visit(Sequence component);
103:
104: public abstract void visit(Choice component);
105:
106: public abstract void visit(All component);
107:
108: public abstract void visit(GlobalGroup schemaComponent);
109:
110: public abstract void visit(GroupReference component);
111:
112: public abstract void visit(GlobalAttributeGroup schemaComponent);
113:
114: public abstract void visit(AttributeGroupReference component);
115:
116: public abstract void visit(GlobalComplexType schemaComponent);
117:
118: public abstract void visit(LocalComplexType component);
119:
120: public abstract void visit(ComplexContent component);
121:
122: public abstract void visit(SimpleContent component);
123:
124: public abstract void visit(SimpleExtension component);
125:
126: public abstract void visit(ComplexExtension component);
127:
128: ////////////////////////////////////////////////////////////////////
129: ////////////////////////// member variables ////////////////////////
130: ////////////////////////////////////////////////////////////////////
131: protected AXIModelImpl model;
132: }
|