01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.xerces.impl.xs;
19:
20: import org.apache.xerces.impl.xs.util.XSObjectListImpl;
21: import org.apache.xerces.xs.*;
22:
23: /**
24: * The XML representation for a group declaration
25: * schema component is a global <group> element information item
26: *
27: * @xerces.internal
28: *
29: * @author Sandy Gao, IBM
30: * @version $Id: XSGroupDecl.java 449424 2006-09-24 16:22:30Z mrglavas $
31: */
32: public class XSGroupDecl implements XSModelGroupDefinition {
33:
34: // name of the group
35: public String fName = null;
36: // target namespace of the group
37: public String fTargetNamespace = null;
38: // model group of the group
39: public XSModelGroupImpl fModelGroup = null;
40: // optional annotations
41: public XSObjectList fAnnotations = null;
42:
43: /**
44: * Get the type of the object, i.e ELEMENT_DECLARATION.
45: */
46: public short getType() {
47: return XSConstants.MODEL_GROUP_DEFINITION;
48: }
49:
50: /**
51: * The <code>name</code> of this <code>XSObject</code> depending on the
52: * <code>XSObject</code> type.
53: */
54: public String getName() {
55: return fName;
56: }
57:
58: /**
59: * The namespace URI of this node, or <code>null</code> if it is
60: * unspecified. defines how a namespace URI is attached to schema
61: * components.
62: */
63: public String getNamespace() {
64: return fTargetNamespace;
65: }
66:
67: /**
68: * {model group} A model group.
69: */
70: public XSModelGroup getModelGroup() {
71: return fModelGroup;
72: }
73:
74: /**
75: * Optional. Annotation.
76: */
77: public XSAnnotation getAnnotation() {
78: return (fAnnotations != null) ? (XSAnnotation) fAnnotations
79: .item(0) : null;
80: }
81:
82: /**
83: * Optional. Annotations.
84: */
85: public XSObjectList getAnnotations() {
86: return (fAnnotations != null) ? fAnnotations
87: : XSObjectListImpl.EMPTY_LIST;
88: }
89:
90: /**
91: * @see org.apache.xerces.xs.XSObject#getNamespaceItem()
92: */
93: public XSNamespaceItem getNamespaceItem() {
94: // REVISIT: implement
95: return null;
96: }
97:
98: } // class XSGroupDecl
|