src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/ModelGroupDeclImpl.java

changeset 0
373ffda63c9a
equal deleted inserted replaced
-1:000000000000 0:373ffda63c9a
1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.sun.xml.internal.xsom.impl;
27
28 import com.sun.xml.internal.xsom.XSElementDecl;
29 import com.sun.xml.internal.xsom.XSModelGroup;
30 import com.sun.xml.internal.xsom.XSModelGroupDecl;
31 import com.sun.xml.internal.xsom.XSTerm;
32 import com.sun.xml.internal.xsom.XSWildcard;
33 import com.sun.xml.internal.xsom.impl.parser.SchemaDocumentImpl;
34 import com.sun.xml.internal.xsom.visitor.XSFunction;
35 import com.sun.xml.internal.xsom.visitor.XSTermFunction;
36 import com.sun.xml.internal.xsom.visitor.XSTermFunctionWithParam;
37 import com.sun.xml.internal.xsom.visitor.XSTermVisitor;
38 import com.sun.xml.internal.xsom.visitor.XSVisitor;
39 import org.xml.sax.Locator;
40
41 public class ModelGroupDeclImpl extends DeclarationImpl implements XSModelGroupDecl, Ref.Term
42 {
43 public ModelGroupDeclImpl( SchemaDocumentImpl owner,
44 AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa,
45 String _targetNamespace, String _name,
46 ModelGroupImpl _modelGroup ) {
47
48 super(owner,_annon,_loc,_fa,_targetNamespace,_name,false);
49 this.modelGroup = _modelGroup;
50
51 if(modelGroup==null)
52 throw new IllegalArgumentException();
53 }
54
55 private final ModelGroupImpl modelGroup;
56 public XSModelGroup getModelGroup() { return modelGroup; }
57
58 /**
59 * This component is a redefinition of "oldMG". Fix up the internal state
60 * as such.
61 */
62 public void redefine( ModelGroupDeclImpl oldMG ) {
63 modelGroup.redefine(oldMG);
64 }
65
66
67 public void visit( XSVisitor visitor ) {
68 visitor.modelGroupDecl(this);
69 }
70 public void visit( XSTermVisitor visitor ) {
71 visitor.modelGroupDecl(this);
72 }
73 public Object apply( XSTermFunction function ) {
74 return function.modelGroupDecl(this);
75 }
76
77 public <T,P> T apply(XSTermFunctionWithParam<T, P> function, P param) {
78 return function.modelGroupDecl(this,param);
79 }
80
81 public Object apply( XSFunction function ) {
82 return function.modelGroupDecl(this);
83 }
84
85
86 public boolean isWildcard() { return false; }
87 public boolean isModelGroupDecl() { return true; }
88 public boolean isModelGroup() { return false; }
89 public boolean isElementDecl() { return false; }
90
91 public XSWildcard asWildcard() { return null; }
92 public XSModelGroupDecl asModelGroupDecl() { return this; }
93 public XSModelGroup asModelGroup() { return null; }
94 public XSElementDecl asElementDecl() { return null; }
95
96
97 // Ref.Term implementation
98 public XSTerm getTerm() { return this; }
99 }

mercurial