01: /*
02: * The contents of this file are subject to the terms
03: * of the Common Development and Distribution License
04: * (the "License"). You may not use this file except
05: * in compliance with the License.
06: *
07: * You can obtain a copy of the license at
08: * https://jwsdp.dev.java.net/CDDLv1.0.html
09: * See the License for the specific language governing
10: * permissions and limitations under the License.
11: *
12: * When distributing Covered Code, include this CDDL
13: * HEADER in each file and include the License file at
14: * https://jwsdp.dev.java.net/CDDLv1.0.html If applicable,
15: * add the following below this CDDL HEADER, with the
16: * fields enclosed by brackets "[]" replaced with your
17: * own identifying information: Portions Copyright [yyyy]
18: * [name of copyright owner]
19: */
20: package com.sun.xml.xsom.impl;
21:
22: import com.sun.xml.xsom.XSAttGroupDecl;
23: import com.sun.xml.xsom.XSAttributeDecl;
24: import com.sun.xml.xsom.XSComplexType;
25: import com.sun.xml.xsom.XSContentType;
26: import com.sun.xml.xsom.XSElementDecl;
27: import com.sun.xml.xsom.XSIdentityConstraint;
28: import com.sun.xml.xsom.XSSimpleType;
29: import com.sun.xml.xsom.XSTerm;
30: import com.sun.xml.xsom.XSType;
31:
32: /**
33: * Reference to other schema components.
34: *
35: * <p>
36: * There are mainly two different types of references. One is
37: * the direct reference, which is only possible when schema components
38: * are already available when references are made.
39: * The other is the lazy reference, which keeps references by names
40: * and later look for the component by name.
41: *
42: * <p>
43: * This class defines interfaces that define the behavior of such
44: * references and classes that implement direct reference semantics.
45: *
46: * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
47: */
48: public abstract class Ref {
49:
50: public static interface Term {
51: /** Obtains a reference as a term. */
52: XSTerm getTerm();
53: }
54:
55: public static interface Type {
56: /** Obtains a reference as a type. */
57: XSType getType();
58: }
59:
60: public static interface ContentType {
61: XSContentType getContentType();
62: }
63:
64: public static interface SimpleType extends Ref.Type {
65: public XSSimpleType getType();
66: }
67:
68: public static interface ComplexType extends Ref.Type {
69: public XSComplexType getType();
70: }
71:
72: public static interface Attribute {
73: XSAttributeDecl getAttribute();
74: }
75:
76: public static interface AttGroup {
77: XSAttGroupDecl get();
78: }
79:
80: public static interface Element extends Term {
81: XSElementDecl get();
82: }
83:
84: public static interface IdentityConstraint {
85: XSIdentityConstraint get();
86: }
87: //
88: //
89: // private static void _assert( boolean b ) {
90: // if(!b)
91: // throw new InternalError("assertion failed");
92: // }
93: }
|