/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 2002, 2003,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* All information specific to XML Schema grammars.
*
* @xerces.internal
*
* @author Neil Graham, IBM
* @author Neeraj Bajaj, SUN Microsystems.
*
* @version $Id: XSDDescription.java,v 1.6 2010-11-01 04:39:55 joehw Exp $
*/
implements XMLSchemaDescription {
// used to indicate what triggered the call
/**
* Indicate that this description was just initialized.
*/
/**
* Indicate that the current schema document is <include>d by another
* schema document.
*/
/**
* Indicate that the current schema document is <redefine>d by another
* schema document.
*/
/**
* Indicate that the current schema document is <import>ed by another
* schema document.
*/
/**
* Indicate that the current schema document is being preparsed.
*/
/**
* Indicate that the parse of the current schema document is triggered
* by xsi:schemaLocation/noNamespaceSchemaLocation attribute(s) in the
* instance document. This value is only used if we don't defer the loading
* of schema documents.
*/
/**
* Indicate that the parse of the current schema document is triggered by
* the occurrence of an element whose namespace is the target namespace
* of this schema document. This value is only used if we do defer the
* loading of schema documents until a component from that namespace is
* referenced from the instance.
*/
/**
* Indicate that the parse of the current schema document is triggered by
* the occurrence of an attribute whose namespace is the target namespace
* of this schema document. This value is only used if we do defer the
* loading of schema documents until a component from that namespace is
* referenced from the instance.
*/
/**
* Indicate that the parse of the current schema document is triggered by
* the occurrence of an "xsi:type" attribute, whose value (a QName) has
* the target namespace of this schema document as its namespace.
* This value is only used if we do defer the loading of schema documents
* until a component from that namespace is referenced from the instance.
*/
// REVISIT: write description of these fields
protected short fContextType;
/**
* the type of the grammar (e.g., DTD or XSD);
*
* @see com.sun.org.apache.xerces.internal.xni.grammars.Grammar
*/
return XMLGrammarDescription.XML_SCHEMA;
}
/**
* Get the context. The returned value is one of the pre-defined
* CONTEXT_xxx constants.
*
* @return the value indicating the context
*/
public short getContextType() {
return fContextType ;
}
/**
* If the context is "include" or "redefine", then return the target
* namespace of the enclosing schema document; otherwise, the expected
* target namespace of this document.
*
*/
return fNamespace;
}
/**
* For import and references from the instance document, it's possible to
* have multiple hints for one namespace. So this method returns an array,
* which contains all location hints.
*
* @return an array of all location hints associated to the expected
* target namespace
*/
return fLocationHints ;
}
/**
* this call returns the name of such triggering component: the name of
*
* @return the name of the triggering component
*/
return fTriggeringComponent ;
}
/**
* If a call is triggered by an attribute or xsi:type, then this mehtod
* returns the enclosing element of such element.
*
* @return the name of the enclosing element
*/
return fEnclosedElementName ;
}
/**
* this call returns all attribute of such element (or enclosing element).
*
*/
return fAttributes;
}
public boolean fromInstance() {
return fContextType == CONTEXT_ATTRIBUTE ||
fContextType == CONTEXT_ELEMENT ||
fContextType == CONTEXT_INSTANCE ||
}
/**
* @return true is the schema is external
*/
public boolean isExternal() {
return fContextType == CONTEXT_INCLUDE ||
fContextType == CONTEXT_REDEFINE ||
fContextType == CONTEXT_IMPORT ||
fContextType == CONTEXT_ELEMENT ||
}
/**
* Compares this grammar with the given grammar. Currently, we compare
* the target namespaces.
*
* @param descObj The description of the grammar to be compared with
* @return True if they are equal, else false
*/
if(!(descObj instanceof XMLSchemaDescription)) return false;
if (fNamespace != null)
else // fNamespace == null
}
/**
* Returns the hash code of this grammar
*
* @return The hash code
*/
public int hashCode() {
}
}
}
//fLocationHints = locationHints ;
}
}
}
}
/**
* resets all the fields
*/
public void reset(){
super.clear();
fLocationHints = null ;
fAttributes = null ;
}
return desc;
}
} // XSDDescription