KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > xni > grammars > XMLSchemaDescription


1 /*
2  * Copyright 2002,2004,2005 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.xerces.xni.grammars;
18
19 import org.apache.xerces.xni.QName;
20 import org.apache.xerces.xni.XMLAttributes;
21
22 /**
23  * All information specific to XML Schema grammars.
24  *
25  * @author Sandy Gao, IBM
26  *
27  * @version $Id: XMLSchemaDescription.java,v 1.4 2005/02/24 05:18:57 mrglavas Exp $
28  */

29 public interface XMLSchemaDescription extends XMLGrammarDescription {
30
31     // used to indicate what triggered the call
32
/**
33      * Indicate that the current schema document is <include>d by another
34      * schema document.
35      */

36     public final static short CONTEXT_INCLUDE = 0;
37     /**
38      * Indicate that the current schema document is <redefine>d by another
39      * schema document.
40      */

41     public final static short CONTEXT_REDEFINE = 1;
42     /**
43      * Indicate that the current schema document is <import>ed by another
44      * schema document.
45      */

46     public final static short CONTEXT_IMPORT = 2;
47     /**
48      * Indicate that the current schema document is being preparsed.
49      */

50     public final static short CONTEXT_PREPARSE = 3;
51     /**
52      * Indicate that the parse of the current schema document is triggered
53      * by xsi:schemaLocation/noNamespaceSchemaLocation attribute(s) in the
54      * instance document. This value is only used if we don't defer the loading
55      * of schema documents.
56      */

57     public final static short CONTEXT_INSTANCE = 4;
58     /**
59      * Indicate that the parse of the current schema document is triggered by
60      * the occurrence of an element whose namespace is the target namespace
61      * of this schema document. This value is only used if we do defer the
62      * loading of schema documents until a component from that namespace is
63      * referenced from the instance.
64      */

65     public final static short CONTEXT_ELEMENT = 5;
66     /**
67      * Indicate that the parse of the current schema document is triggered by
68      * the occurrence of an attribute whose namespace is the target namespace
69      * of this schema document. This value is only used if we do defer the
70      * loading of schema documents until a component from that namespace is
71      * referenced from the instance.
72      */

73     public final static short CONTEXT_ATTRIBUTE = 6;
74     /**
75      * Indicate that the parse of the current schema document is triggered by
76      * the occurrence of an "xsi:type" attribute, whose value (a QName) has
77      * the target namespace of this schema document as its namespace.
78      * This value is only used if we do defer the loading of schema documents
79      * until a component from that namespace is referenced from the instance.
80      */

81     public final static short CONTEXT_XSITYPE = 7;
82
83     /**
84      * Get the context. The returned value is one of the pre-defined
85      * CONTEXT_xxx constants.
86      *
87      * @return the value indicating the context
88      */

89     public short getContextType();
90
91     /**
92      * If the context is "include" or "redefine", then return the target
93      * namespace of the enclosing schema document; otherwise, the expected
94      * target namespace of this document.
95      *
96      * @return the expected/enclosing target namespace
97      */

98     public String JavaDoc getTargetNamespace();
99
100     /**
101      * For import and references from the instance document, it's possible to
102      * have multiple hints for one namespace. So this method returns an array,
103      * which contains all location hints.
104      *
105      * @return an array of all location hints associated to the expected
106      * target namespace
107      */

108     public String JavaDoc[] getLocationHints();
109
110     /**
111      * If a call is triggered by an element/attribute/xsi:type in the instance,
112      * this call returns the name of such triggering component: the name of
113      * the element/attribute, or the value of the xsi:type.
114      *
115      * @return the name of the triggering component
116      */

117     public QName getTriggeringComponent();
118
119     /**
120      * If a call is triggered by an attribute or xsi:type, then this method
121      * returns the enclosing element of such element.
122      *
123      * @return the name of the enclosing element
124      */

125     public QName getEnclosingElementName();
126     
127     /**
128      * If a call is triggered by an element/attribute/xsi:type in the instance,
129      * this call returns all attribute of such element (or enclosing element).
130      *
131      * @return all attributes of the tiggering/enclosing element
132      */

133     public XMLAttributes getAttributes();
134     
135 } // XSDDescription
136
Popular Tags