1/* 2 * Copyright (c) 1997, 2012, 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 26package com.sun.xml.internal.xsom.impl; 27 28import com.sun.xml.internal.xsom.XSAttGroupDecl; 29import com.sun.xml.internal.xsom.XSAttributeDecl; 30import com.sun.xml.internal.xsom.XSComplexType; 31import com.sun.xml.internal.xsom.XSContentType; 32import com.sun.xml.internal.xsom.XSElementDecl; 33import com.sun.xml.internal.xsom.XSIdentityConstraint; 34import com.sun.xml.internal.xsom.XSSimpleType; 35import com.sun.xml.internal.xsom.XSTerm; 36import com.sun.xml.internal.xsom.XSType; 37 38/** 39 * Reference to other schema components. 40 * 41 * <p> 42 * There are mainly two different types of references. One is 43 * the direct reference, which is only possible when schema components 44 * are already available when references are made. 45 * The other is the lazy reference, which keeps references by names 46 * and later look for the component by name. 47 * 48 * <p> 49 * This class defines interfaces that define the behavior of such 50 * references and classes that implement direct reference semantics. 51 * 52 * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) 53 */ 54public abstract class Ref { 55 56 public static interface Term { 57 /** Obtains a reference as a term. */ 58 XSTerm getTerm(); 59 } 60 61 public static interface Type { 62 /** Obtains a reference as a type. */ 63 XSType getType(); 64 } 65 66 public static interface ContentType { 67 XSContentType getContentType(); 68 } 69 70 public static interface SimpleType extends Ref.Type { 71 public XSSimpleType getType(); 72 } 73 74 public static interface ComplexType extends Ref.Type { 75 public XSComplexType getType(); 76 } 77 78 public static interface Attribute { 79 XSAttributeDecl getAttribute(); 80 } 81 82 public static interface AttGroup { 83 XSAttGroupDecl get(); 84 } 85 86 public static interface Element extends Term { 87 XSElementDecl get(); 88 } 89 90 public static interface IdentityConstraint { 91 XSIdentityConstraint get(); 92 } 93// 94// 95// private static void _assert( boolean b ) { 96// if(!b) 97// throw new InternalError("assertion failed"); 98// } 99} 100