~ubuntu-branches/ubuntu/karmic/libxerces2-java/karmic

« back to all changes in this revision

Viewing changes to src/org/apache/xerces/xni/grammars/XMLSchemaDescription.java

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Gybas
  • Date: 2004-06-06 18:00:26 UTC
  • Revision ID: james.westby@ubuntu.com-20040606180026-a3vh56uc95hjbyfh
Tags: upstream-2.6.2
ImportĀ upstreamĀ versionĀ 2.6.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * The Apache Software License, Version 1.1
 
3
 *
 
4
 *
 
5
 * Copyright (c) 2002 The Apache Software Foundation.  
 
6
 * All rights reserved.
 
7
 *
 
8
 * Redistribution and use in source and binary forms, with or without
 
9
 * modification, are permitted provided that the following conditions
 
10
 * are met:
 
11
 *
 
12
 * 1. Redistributions of source code must retain the above copyright
 
13
 *    notice, this list of conditions and the following disclaimer. 
 
14
 *
 
15
 * 2. Redistributions in binary form must reproduce the above copyright
 
16
 *    notice, this list of conditions and the following disclaimer in
 
17
 *    the documentation and/or other materials provided with the
 
18
 *    distribution.
 
19
 *
 
20
 * 3. The end-user documentation included with the redistribution,
 
21
 *    if any, must include the following acknowledgment:  
 
22
 *       "This product includes software developed by the
 
23
 *        Apache Software Foundation (http://www.apache.org/)."
 
24
 *    Alternately, this acknowledgment may appear in the software itself,
 
25
 *    if and wherever such third-party acknowledgments normally appear.
 
26
 *
 
27
 * 4. The names "Xerces" and "Apache Software Foundation" must
 
28
 *    not be used to endorse or promote products derived from this
 
29
 *    software without prior written permission. For written 
 
30
 *    permission, please contact apache@apache.org.
 
31
 *
 
32
 * 5. Products derived from this software may not be called "Apache",
 
33
 *    nor may "Apache" appear in their name, without prior written
 
34
 *    permission of the Apache Software Foundation.
 
35
 *
 
36
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 
37
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 
38
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 
39
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 
40
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
41
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
42
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 
43
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 
44
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 
45
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 
46
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 
47
 * SUCH DAMAGE.
 
48
 * ====================================================================
 
49
 *
 
50
 * This software consists of voluntary contributions made by many
 
51
 * individuals on behalf of the Apache Software Foundation and was
 
52
 * originally based on software copyright (c) 1999, International
 
53
 * Business Machines, Inc., http://www.apache.org.  For more
 
54
 * information on the Apache Software Foundation, please see
 
55
 * <http://www.apache.org/>.
 
56
 */
 
57
 
 
58
package org.apache.xerces.xni.grammars;
 
59
 
 
60
import org.apache.xerces.xni.QName;
 
61
import org.apache.xerces.xni.XMLAttributes;
 
62
 
 
63
/**
 
64
 * All information specific to XML Schema grammars.
 
65
 *
 
66
 * @author Sandy Gao, IBM
 
67
 *
 
68
 * @version $Id: XMLSchemaDescription.java,v 1.2 2003/11/14 16:54:05 mrglavas Exp $
 
69
 */
 
70
public interface XMLSchemaDescription extends XMLGrammarDescription {
 
71
 
 
72
    // used to indicate what triggered the call
 
73
    /**
 
74
     * Indicate that the current schema document is &lt;include&gt;d by another
 
75
     * schema document.
 
76
     */
 
77
    public final static short CONTEXT_INCLUDE   = 0;
 
78
    /**
 
79
     * Indicate that the current schema document is &lt;redefine&gt;d by another
 
80
     * schema document.
 
81
     */
 
82
    public final static short CONTEXT_REDEFINE  = 1;
 
83
    /**
 
84
     * Indicate that the current schema document is &lt;import&gt;ed by another
 
85
     * schema document.
 
86
     */
 
87
    public final static short CONTEXT_IMPORT    = 2;
 
88
    /**
 
89
     * Indicate that the current schema document is being preparsed.
 
90
     */
 
91
    public final static short CONTEXT_PREPARSE  = 3;
 
92
    /**
 
93
     * Indicate that the parse of the current schema document is triggered
 
94
     * by xsi:schemaLocation/noNamespaceSchemaLocation attribute(s) in the
 
95
     * instance document. This value is only used if we don't defer the loading
 
96
     * of schema documents.
 
97
     */
 
98
    public final static short CONTEXT_INSTANCE  = 4;
 
99
    /**
 
100
     * Indicate that the parse of the current schema document is triggered by
 
101
     * the occurrence of an element whose namespace is the target namespace
 
102
     * of this schema document. This value is only used if we do defer the
 
103
     * loading of schema documents until a component from that namespace is
 
104
     * referenced from the instance.
 
105
     */
 
106
    public final static short CONTEXT_ELEMENT   = 5;
 
107
    /**
 
108
     * Indicate that the parse of the current schema document is triggered by
 
109
     * the occurrence of an attribute whose namespace is the target namespace
 
110
     * of this schema document. This value is only used if we do defer the
 
111
     * loading of schema documents until a component from that namespace is
 
112
     * referenced from the instance.
 
113
     */
 
114
    public final static short CONTEXT_ATTRIBUTE = 6;
 
115
    /**
 
116
     * Indicate that the parse of the current schema document is triggered by
 
117
     * the occurrence of an "xsi:type" attribute, whose value (a QName) has
 
118
     * the target namespace of this schema document as its namespace.
 
119
     * This value is only used if we do defer the loading of schema documents
 
120
     * until a component from that namespace is referenced from the instance.
 
121
     */
 
122
    public final static short CONTEXT_XSITYPE   = 7;
 
123
 
 
124
    /**
 
125
     * Get the context. The returned value is one of the pre-defined
 
126
     * CONTEXT_xxx constants.
 
127
     * 
 
128
     * @return  the value indicating the context
 
129
     */
 
130
    public short getContextType();
 
131
 
 
132
    /**
 
133
     * If the context is "include" or "redefine", then return the target
 
134
     * namespace of the enclosing schema document; otherwise, the expected
 
135
     * target namespace of this document.
 
136
     * 
 
137
     * @return  the expected/enclosing target namespace
 
138
     */
 
139
    public String getTargetNamespace();
 
140
 
 
141
    /**
 
142
     * For import and references from the instance document, it's possible to
 
143
     * have multiple hints for one namespace. So this method returns an array,
 
144
     * which contains all location hints.
 
145
     * 
 
146
     * @return  an array of all location hints associated to the expected
 
147
     *          target namespace
 
148
     */          
 
149
    public String[] getLocationHints();
 
150
 
 
151
    /**
 
152
     * If a call is triggered by an element/attribute/xsi:type in the instance,
 
153
     * this call returns the name of such triggering component: the name of
 
154
     * the element/attribute, or the value of the xsi:type.
 
155
     * 
 
156
     * @return  the name of the triggering component
 
157
     */
 
158
    public QName getTriggeringComponent();
 
159
 
 
160
    /**
 
161
     * If a call is triggered by an attribute or xsi:type, then this mehtod
 
162
     * returns the enclosing element of such element.
 
163
     * 
 
164
     * @return  the name of the enclosing element
 
165
     */
 
166
    public QName getEnclosingElementName();
 
167
    
 
168
    /**
 
169
     * If a call is triggered by an element/attribute/xsi:type in the instance,
 
170
     * this call returns all attribute of such element (or enclosing element).
 
171
     * 
 
172
     * @return  all attributes of the tiggering/enclosing element
 
173
     */
 
174
    public XMLAttributes getAttributes();
 
175
    
 
176
} // XSDDescription