jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSDDescription.java
author joehw
Wed, 08 May 2013 23:38:03 -0700
changeset 17534 21dc0b2762da
parent 12457 c348e06f0e82
child 25264 040625ce9b72
permissions -rw-r--r--
8011653: Upgrade JDK8 to JAXP 1.5 Reviewed-by: alanb, dfuchs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * reserved comment block
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * Copyright 2002, 2003,2004 The Apache Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * Licensed under the Apache License, Version 2.0 (the "License");
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * you may not use this file except in compliance with the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * You may obtain a copy of the License at
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 *      http://www.apache.org/licenses/LICENSE-2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * Unless required by applicable law or agreed to in writing, software
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * distributed under the License is distributed on an "AS IS" BASIS,
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * See the License for the specific language governing permissions and
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * limitations under the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
package com.sun.org.apache.xerces.internal.impl.xs;
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl;
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
import com.sun.org.apache.xerces.internal.xni.QName;
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
import com.sun.org.apache.xerces.internal.xni.grammars.XMLSchemaDescription;
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
 * All information specific to XML Schema grammars.
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
 * @xerces.internal
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 * @author Neil Graham, IBM
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 * @author Neeraj Bajaj, SUN Microsystems.
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 *
17534
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
    37
 * @version $Id: XSDDescription.java,v 1.6 2010-11-01 04:39:55 joehw Exp $
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
public class XSDDescription extends XMLResourceIdentifierImpl
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
                implements XMLSchemaDescription {
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
    // used to indicate what triggered the call
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
     * Indicate that this description was just initialized.
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
    public final static short CONTEXT_INITIALIZE = -1;
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
     * Indicate that the current schema document is <include>d by another
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
     * schema document.
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
    public final static short CONTEXT_INCLUDE   = 0;
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
     * Indicate that the current schema document is <redefine>d by another
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
     * schema document.
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
    public final static short CONTEXT_REDEFINE  = 1;
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
     * Indicate that the current schema document is <import>ed by another
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
     * schema document.
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
    public final static short CONTEXT_IMPORT    = 2;
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
     * Indicate that the current schema document is being preparsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
    public final static short CONTEXT_PREPARSE  = 3;
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
     * Indicate that the parse of the current schema document is triggered
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
     * by xsi:schemaLocation/noNamespaceSchemaLocation attribute(s) in the
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
     * instance document. This value is only used if we don't defer the loading
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
     * of schema documents.
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
    public final static short CONTEXT_INSTANCE  = 4;
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
     * Indicate that the parse of the current schema document is triggered by
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
     * the occurrence of an element whose namespace is the target namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
     * of this schema document. This value is only used if we do defer the
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
     * loading of schema documents until a component from that namespace is
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
     * referenced from the instance.
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
    public final static short CONTEXT_ELEMENT   = 5;
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
     * Indicate that the parse of the current schema document is triggered by
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
     * the occurrence of an attribute whose namespace is the target namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
     * of this schema document. This value is only used if we do defer the
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
     * loading of schema documents until a component from that namespace is
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
     * referenced from the instance.
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
    public final static short CONTEXT_ATTRIBUTE = 6;
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
     * Indicate that the parse of the current schema document is triggered by
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
     * the occurrence of an "xsi:type" attribute, whose value (a QName) has
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
     * the target namespace of this schema document as its namespace.
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
     * This value is only used if we do defer the loading of schema documents
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
     * until a component from that namespace is referenced from the instance.
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
    public final static short CONTEXT_XSITYPE   = 7;
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
    // REVISIT: write description of these fields
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
    protected short fContextType;
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
    protected String [] fLocationHints ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
    protected QName fTriggeringComponent;
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
    protected QName fEnclosedElementName;
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
    protected XMLAttributes  fAttributes;
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
     * the type of the grammar (e.g., DTD or XSD);
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
     * @see com.sun.org.apache.xerces.internal.xni.grammars.Grammar
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
    public String getGrammarType() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
        return XMLGrammarDescription.XML_SCHEMA;
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
     * Get the context. The returned value is one of the pre-defined
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
     * CONTEXT_xxx constants.
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
     * @return  the value indicating the context
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
    public short getContextType() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
        return fContextType ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
     * If the context is "include" or "redefine", then return the target
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
     * namespace of the enclosing schema document; otherwise, the expected
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
     * target namespace of this document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
     * @return  the expected/enclosing target namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
    public String getTargetNamespace() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
        return fNamespace;
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
     * For import and references from the instance document, it's possible to
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
     * have multiple hints for one namespace. So this method returns an array,
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
     * which contains all location hints.
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
     * @return  an array of all location hints associated to the expected
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
     *          target namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
    public String[] getLocationHints() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
        return fLocationHints ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
     * If a call is triggered by an element/attribute/xsi:type in the instance,
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
     * this call returns the name of such triggering component: the name of
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
     * the element/attribute, or the value of the xsi:type.
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
     * @return  the name of the triggering component
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
    public QName getTriggeringComponent() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
        return fTriggeringComponent ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
     * If a call is triggered by an attribute or xsi:type, then this mehtod
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
     * returns the enclosing element of such element.
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
     * @return  the name of the enclosing element
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
    public QName getEnclosingElementName() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
        return fEnclosedElementName ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
     * If a call is triggered by an element/attribute/xsi:type in the instance,
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
     * this call returns all attribute of such element (or enclosing element).
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
     * @return  all attributes of the tiggering/enclosing element
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
    public XMLAttributes getAttributes() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
        return fAttributes;
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
    public boolean fromInstance() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
        return fContextType == CONTEXT_ATTRIBUTE ||
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
               fContextType == CONTEXT_ELEMENT ||
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
               fContextType == CONTEXT_INSTANCE ||
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
               fContextType == CONTEXT_XSITYPE;
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
    /**
17534
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
   185
     * @return true is the schema is external
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
   186
     */
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
   187
    public boolean isExternal() {
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
   188
        return fContextType == CONTEXT_INCLUDE ||
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
   189
               fContextType == CONTEXT_REDEFINE ||
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
   190
               fContextType == CONTEXT_IMPORT ||
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
   191
               fContextType == CONTEXT_ELEMENT ||
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
   192
               fContextType == CONTEXT_ATTRIBUTE ||
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
   193
               fContextType == CONTEXT_XSITYPE;
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
   194
    }
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
   195
    /**
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
     * Compares this grammar with the given grammar. Currently, we compare
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
     * the target namespaces.
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
     * @param descObj The description of the grammar to be compared with
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
     * @return        True if they are equal, else false
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
    public boolean equals(Object descObj) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
        if(!(descObj instanceof XMLSchemaDescription)) return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
        XMLSchemaDescription desc = (XMLSchemaDescription)descObj;
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
        if (fNamespace != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
            return fNamespace.equals(desc.getTargetNamespace());
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
        else // fNamespace == null
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
            return desc.getTargetNamespace() == null;
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
     * Returns the hash code of this grammar
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
     * @return The hash code
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
    public int hashCode() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
         return (fNamespace == null) ? 0 : fNamespace.hashCode();
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
    public void setContextType(short contextType){
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
        fContextType = contextType ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
    public void setTargetNamespace(String targetNamespace){
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
        fNamespace = targetNamespace ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
    public void setLocationHints(String [] locationHints){
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
        int length = locationHints.length ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
        fLocationHints  = new String[length];
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
        System.arraycopy(locationHints, 0, fLocationHints, 0, length);
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
        //fLocationHints = locationHints ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
    public void setTriggeringComponent(QName triggeringComponent){
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
        fTriggeringComponent = triggeringComponent ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
    public void setEnclosingElementName(QName enclosedElementName){
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
        fEnclosedElementName = enclosedElementName ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
    public void setAttributes(XMLAttributes attributes){
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
        fAttributes = attributes ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
     *  resets all the fields
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
    public void reset(){
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
        super.clear();
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
        fContextType = CONTEXT_INITIALIZE;
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
        fLocationHints  = null ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
        fTriggeringComponent = null ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
        fEnclosedElementName = null ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
        fAttributes = null ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   258
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
    public XSDDescription makeClone() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
        XSDDescription desc = new XSDDescription();
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
        desc.fAttributes = this.fAttributes;
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
        desc.fBaseSystemId = this.fBaseSystemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
        desc.fContextType = this.fContextType;
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
        desc.fEnclosedElementName = this.fEnclosedElementName;
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
        desc.fExpandedSystemId = this.fExpandedSystemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
        desc.fLiteralSystemId = this.fLiteralSystemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
        desc.fLocationHints = this.fLocationHints;
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
        desc.fPublicId = this.fPublicId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
        desc.fNamespace = this.fNamespace;
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
        desc.fTriggeringComponent = this.fTriggeringComponent;
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
        return desc;
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
} // XSDDescription