KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > xs > XSComplexType


1 /*
2  * Copyright 2003, 2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15
16  */

17 package org.apache.ws.jaxme.xs;
18
19 import org.apache.ws.jaxme.xs.xml.*;
20
21
22 /** <p>Details of a complex type.</p>
23  *
24  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
25  */

26 public interface XSComplexType {
27   /** <p>Returns whether the complex type has simple content. If so,
28    * you may use the method {@link #getSimpleContent()} to fetch the
29    * simple contents type. If not, you may use
30    * {@link #getComplexContentType()}, {@link #isEmpty()},
31    * {@link #isElementOnly()}, {@link #isMixed()}, and
32    * {@link #getParticle()}. The method {@link #getAttributes()}
33    * is always valid.</p>
34    */

35   public boolean hasSimpleContent();
36
37   /** <p>If the complex type has simple content, returns the contents
38    * type. This is, of course, a simple type.</p>
39    */

40   public XSSimpleContentType getSimpleContent();
41
42   /** <p>If the element hasn't simple content: Returns the element contents
43    * type.</p>
44    * @throws IllegalStateException The element does not have
45    * complex content
46    * @see XsComplexContentType#EMPTY
47    * @see XsComplexContentType#ELEMENT_ONLY
48    * @see XsComplexContentType#MIXED
49    * @see #isEmpty()
50    * @see #isElementOnly()
51    * @see #isMixed()
52    */

53   public XsComplexContentType getComplexContentType();
54
55   /** <p>If the element hasn't simple content: Returns whether the
56    * elements content is empty. Shortcut for
57    * <code>getComplexContentType().equals(EMPTY)</code>.</p>
58    * @throws IllegalStateException The element does not have
59    * complex content
60    * @see XsComplexContentType#EMPTY
61    */

62   public boolean isEmpty();
63
64   /** <p>If the element hasn't simple content: Returns whether the
65    * elements content is elementOnly. Shortcut for
66    * <code>getComplexContentType().equals(ELEMENT_ONLY)</code>.</p>
67    * @throws IllegalStateException The element does not have
68    * complex content
69    * @see XsComplexContentType#ELEMENT_ONLY
70    */

71   public boolean isElementOnly();
72
73   /** <p>If the element hasn't simple content: Returns whether the
74    * elements content is mixed. Shortcut for
75    * <code>getComplexContentType().equals(MIXED)</code>.</p>
76    * @throws IllegalStateException The element does not have
77    * complex content
78    * @see XsComplexContentType#MIXED
79    */

80   public boolean isMixed();
81
82   /** <p>If the element hasn't simple content: Returns the complex
83    * elements particle.</p>
84    * @throws IllegalStateException The element has simple content
85    */

86   public XSParticle getParticle();
87
88   /** <p>Returns the complex types attributes.</p>
89    */

90   public XSAttributable[] getAttributes();
91
92   /** <p>Returns whether the element is a extension of another element.</p>
93    */

94   public boolean isExtension();
95
96   /** <p>If the element is an extension: Returns the extended type.</p>
97    * @throws IllegalStateException The element is no extension.
98    */

99   public XSType getExtendedType();
100
101   /** <p>Returns whether the element is a restriction of another element.</p>
102    */

103   public boolean isRestriction();
104
105   /** <p>If the element is an restriction: Returns the restricted type.</p>
106    * @throws IllegalStateException The element is no restriction.
107    */

108   public XSType getRestrictedType();
109 }
110
Popular Tags