Methods Summary |
---|
public void | addAnnotation(com.sun.org.apache.xerces.internal.impl.xs.XSAnnotationImpl annotation)
if(annotation == null)
return;
if(fAnnotations == null) {
fAnnotations = new XSAnnotationImpl[2];
} else if(fNumAnnotations == fAnnotations.length) {
XSAnnotationImpl[] newArray = new XSAnnotationImpl[fNumAnnotations << 1];
System.arraycopy(fAnnotations, 0, newArray, 0, fNumAnnotations);
fAnnotations = newArray;
}
fAnnotations[fNumAnnotations++] = annotation;
|
public void | addComplexTypeDecl(com.sun.org.apache.xerces.internal.impl.xs.XSComplexTypeDecl decl, com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator locator)add one complex type decl: for later constraint checking
if (fCTCount == fComplexTypeDecls.length) {
fComplexTypeDecls = resize(fComplexTypeDecls, fCTCount+INC_SIZE);
fCTLocators = resize(fCTLocators, fCTCount+INC_SIZE);
}
fCTLocators[fCTCount] = locator;
fComplexTypeDecls[fCTCount++] = decl;
|
public synchronized void | addDocument(java.lang.Object document, java.lang.String location)
if (fDocuments == null) {
fDocuments = new Vector();
fLocations = new Vector();
}
fDocuments.addElement(document);
fLocations.addElement(location);
|
public void | addGlobalAttributeDecl(com.sun.org.apache.xerces.internal.impl.xs.XSAttributeDecl decl)register one global attribute
fGlobalAttrDecls.put(decl.fName, decl);
|
public void | addGlobalAttributeGroupDecl(com.sun.org.apache.xerces.internal.impl.xs.XSAttributeGroupDecl decl)register one global attribute group
fGlobalAttrGrpDecls.put(decl.fName, decl);
|
public void | addGlobalElementDecl(com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl decl)register one global element
fGlobalElemDecls.put(decl.fName, decl);
// if there is a substitution group affiliation, store in an array,
// for further constraint checking: UPA, PD, EDC
if (decl.fSubGroup != null) {
if (fSubGroupCount == fSubGroups.length)
fSubGroups = resize(fSubGroups, fSubGroupCount+INC_SIZE);
fSubGroups[fSubGroupCount++] = decl;
}
|
public void | addGlobalGroupDecl(com.sun.org.apache.xerces.internal.impl.xs.XSGroupDecl decl)register one global group
fGlobalGroupDecls.put(decl.fName, decl);
|
public void | addGlobalNotationDecl(com.sun.org.apache.xerces.internal.impl.xs.XSNotationDecl decl)register one global notation
fGlobalNotationDecls.put(decl.fName, decl);
|
public void | addGlobalTypeDecl(com.sun.org.apache.xerces.internal.xs.XSTypeDefinition decl)register one global type
fGlobalTypeDecls.put(decl.getName(), decl);
|
public final void | addIDConstraintDecl(com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl elmDecl, com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint decl)register one identity constraint
elmDecl.addIDConstraint(decl);
fGlobalIDConstraintDecls.put(decl.getIdentityConstraintName(), decl);
|
public void | addRedefinedGroupDecl(com.sun.org.apache.xerces.internal.impl.xs.XSGroupDecl derived, com.sun.org.apache.xerces.internal.impl.xs.XSGroupDecl base, com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator locator)add a group redefined by restriction: for later constraint checking
if (fRGCount == fRedefinedGroupDecls.length) {
// double array size each time.
fRedefinedGroupDecls = resize(fRedefinedGroupDecls, fRGCount << 1);
fRGLocators = resize(fRGLocators, fRGCount);
}
fRGLocators[fRGCount/2] = locator;
fRedefinedGroupDecls[fRGCount++] = derived;
fRedefinedGroupDecls[fRGCount++] = base;
|
public com.sun.org.apache.xerces.internal.xs.XSObjectList | getAnnotations()
return new XSObjectListImpl(fAnnotations, fNumAnnotations);
|
public com.sun.org.apache.xerces.internal.xs.XSAttributeDeclaration | getAttributeDeclaration(java.lang.String name)Convenience method. Returns a top-level attribute declaration.
return getGlobalAttributeDecl(name);
|
public com.sun.org.apache.xerces.internal.xs.XSAttributeGroupDefinition | getAttributeGroup(java.lang.String name)Convenience method. Returns a top-level attribute group definition.
return getGlobalAttributeGroupDecl(name);
|
public synchronized com.sun.org.apache.xerces.internal.xs.XSNamedMap | getComponents(short objectType)Returns a list of top-level components, i.e. element declarations,
attribute declarations, etc.
Note that XSTypeDefinition#SIMPLE_TYPE and
XSTypeDefinition#COMPLEX_TYPE can also be used as the
objectType to retrieve only complex types or simple types,
instead of all types.
if (objectType <= 0 || objectType > MAX_COMP_IDX ||
!GLOBAL_COMP[objectType]) {
return null;
}
if (fComponents == null)
fComponents = new XSNamedMap[MAX_COMP_IDX+1];
// get the hashtable for this type of components
if (fComponents[objectType] == null) {
SymbolHash table = null;
switch (objectType) {
case XSConstants.TYPE_DEFINITION:
case XSTypeDefinition.COMPLEX_TYPE:
case XSTypeDefinition.SIMPLE_TYPE:
table = fGlobalTypeDecls;
break;
case XSConstants.ATTRIBUTE_DECLARATION:
table = fGlobalAttrDecls;
break;
case XSConstants.ELEMENT_DECLARATION:
table = fGlobalElemDecls;
break;
case XSConstants.ATTRIBUTE_GROUP:
table = fGlobalAttrGrpDecls;
break;
case XSConstants.MODEL_GROUP_DEFINITION:
table = fGlobalGroupDecls;
break;
case XSConstants.NOTATION_DECLARATION:
table = fGlobalNotationDecls;
break;
}
// for complex/simple types, create a special implementation,
// which take specific types out of the hash table
if (objectType == XSTypeDefinition.COMPLEX_TYPE ||
objectType == XSTypeDefinition.SIMPLE_TYPE) {
fComponents[objectType] = new XSNamedMap4Types(fTargetNamespace, table, objectType);
}
else {
fComponents[objectType] = new XSNamedMapImpl(fTargetNamespace, table);
}
}
return fComponents[objectType];
|
synchronized com.sun.org.apache.xerces.internal.parsers.DOMParser | getDOMParser()
if (fDOMParser != null) return fDOMParser;
// REVISIT: when schema handles XML 1.1, will need to
// revisit this (and the practice of not prepending an XML decl to the annotation string
IntegratedParserConfiguration config = new IntegratedParserConfiguration(fSymbolTable);
// note that this should never produce errors or require
// entity resolution, so just a barebones configuration with
// a couple of feature set will do fine
config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true);
config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE, false);
fDOMParser = new DOMParser(config);
return fDOMParser;
|
public com.sun.org.apache.xerces.internal.xs.StringList | getDocumentLocations()[document location]
return new StringListImpl(fLocations);
|
public com.sun.org.apache.xerces.internal.xs.XSElementDeclaration | getElementDeclaration(java.lang.String name)Convenience method. Returns a top-level element declaration.
return getGlobalElementDecl(name);
|
public final com.sun.org.apache.xerces.internal.impl.xs.XSAttributeDecl | getGlobalAttributeDecl(java.lang.String declName)get one global attribute
return(XSAttributeDecl)fGlobalAttrDecls.get(declName);
|
public final com.sun.org.apache.xerces.internal.impl.xs.XSAttributeGroupDecl | getGlobalAttributeGroupDecl(java.lang.String declName)get one global attribute group
return(XSAttributeGroupDecl)fGlobalAttrGrpDecls.get(declName);
|
public final com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl | getGlobalElementDecl(java.lang.String declName)get one global element
return(XSElementDecl)fGlobalElemDecls.get(declName);
|
public final com.sun.org.apache.xerces.internal.impl.xs.XSGroupDecl | getGlobalGroupDecl(java.lang.String declName)get one global group
return(XSGroupDecl)fGlobalGroupDecls.get(declName);
|
public final com.sun.org.apache.xerces.internal.impl.xs.XSNotationDecl | getGlobalNotationDecl(java.lang.String declName)get one global notation
return(XSNotationDecl)fGlobalNotationDecls.get(declName);
|
public final com.sun.org.apache.xerces.internal.xs.XSTypeDefinition | getGlobalTypeDecl(java.lang.String declName)get one global type
return(XSTypeDefinition)fGlobalTypeDecls.get(declName);
|
public com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription | getGrammarDescription()
return fGrammarDescription;
|
public final com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint | getIDConstraintDecl(java.lang.String declName)get one identity constraint
return(IdentityConstraint)fGlobalIDConstraintDecls.get(declName);
|
public java.util.Vector | getImportedGrammars()
return fImported;
|
public com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition | getModelGroupDefinition(java.lang.String name)Convenience method. Returns a top-level model group definition.
return getGlobalGroupDecl(name);
|
public com.sun.org.apache.xerces.internal.xs.XSNotationDeclaration | getNotationDeclaration(java.lang.String name)Convenience method. Returns a top-level notation declaration.
return getGlobalNotationDecl(name);
|
final com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator[] | getRGLocators()get the error locator of all redefined groups
if (fRGCount < fRedefinedGroupDecls.length) {
fRedefinedGroupDecls = resize(fRedefinedGroupDecls, fRGCount);
fRGLocators = resize(fRGLocators, fRGCount/2);
}
return fRGLocators;
|
final com.sun.org.apache.xerces.internal.impl.xs.XSGroupDecl[] | getRedefinedGroupDecls()get all redefined groups: for later constraint checking
if (fRGCount < fRedefinedGroupDecls.length) {
fRedefinedGroupDecls = resize(fRedefinedGroupDecls, fRGCount);
fRGLocators = resize(fRGLocators, fRGCount/2);
}
return fRedefinedGroupDecls;
|
synchronized com.sun.org.apache.xerces.internal.parsers.SAXParser | getSAXParser()
if (fSAXParser != null) return fSAXParser;
// REVISIT: when schema handles XML 1.1, will need to
// revisit this (and the practice of not prepending an XML decl to the annotation string
IntegratedParserConfiguration config = new IntegratedParserConfiguration(fSymbolTable);
// note that this should never produce errors or require
// entity resolution, so just a barebones configuration with
// a couple of feature set will do fine
config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true);
config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE, false);
fSAXParser = new SAXParser(config);
return fSAXParser;
|
public java.lang.String | getSchemaNamespace()[schema namespace]
return fTargetNamespace;
|
final com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl[] | getSubstitutionGroups()get all substitution group information: for the 3 constraint checking
if (fSubGroupCount < fSubGroups.length)
fSubGroups = resize(fSubGroups, fSubGroupCount);
return fSubGroups;
|
public final java.lang.String | getTargetNamespace()Returns this grammar's target namespace.
return fTargetNamespace;
|
public com.sun.org.apache.xerces.internal.xs.XSTypeDefinition | getTypeDefinition(java.lang.String name)Convenience method. Returns a top-level simple or complex type
definition.
return getGlobalTypeDecl(name);
|
final com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator[] | getUncheckedCTLocators()get the error locator of all complex type decls
if (fCTCount < fCTLocators.length) {
fComplexTypeDecls = resize(fComplexTypeDecls, fCTCount);
fCTLocators = resize(fCTLocators, fCTCount);
}
return fCTLocators;
|
final com.sun.org.apache.xerces.internal.impl.xs.XSComplexTypeDecl[] | getUncheckedComplexTypeDecls()get all complex type decls: for later constraint checking
if (fCTCount < fComplexTypeDecls.length) {
fComplexTypeDecls = resize(fComplexTypeDecls, fCTCount);
fCTLocators = resize(fCTLocators, fCTCount);
}
return fComplexTypeDecls;
|
public final boolean | hasIDConstraints()get one identity constraint
return fGlobalIDConstraintDecls.getLength() > 0;
|
public boolean | isNamespaceAware()
return true;
|
static final com.sun.org.apache.xerces.internal.impl.xs.XSComplexTypeDecl[] | resize(com.sun.org.apache.xerces.internal.impl.xs.XSComplexTypeDecl[] oldArray, int newSize)
XSComplexTypeDecl[] newArray = new XSComplexTypeDecl[newSize];
System.arraycopy(oldArray, 0, newArray, 0, Math.min(oldArray.length, newSize));
return newArray;
|
static final com.sun.org.apache.xerces.internal.impl.xs.XSGroupDecl[] | resize(com.sun.org.apache.xerces.internal.impl.xs.XSGroupDecl[] oldArray, int newSize)
XSGroupDecl[] newArray = new XSGroupDecl[newSize];
System.arraycopy(oldArray, 0, newArray, 0, Math.min(oldArray.length, newSize));
return newArray;
|
static final com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl[] | resize(com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl[] oldArray, int newSize)
XSElementDecl[] newArray = new XSElementDecl[newSize];
System.arraycopy(oldArray, 0, newArray, 0, Math.min(oldArray.length, newSize));
return newArray;
|
static final com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator[] | resize(com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator[] oldArray, int newSize)
SimpleLocator[] newArray = new SimpleLocator[newSize];
System.arraycopy(oldArray, 0, newArray, 0, Math.min(oldArray.length, newSize));
return newArray;
|
public void | setImportedGrammars(java.util.Vector importedGrammars)
fImported = importedGrammars;
|
final void | setUncheckedTypeNum(int newSize)after the first-round checking, some types don't need to be checked
against UPA again. here we trim the array to the proper size.
fCTCount = newSize;
fComplexTypeDecls = resize(fComplexTypeDecls, fCTCount);
fCTLocators = resize(fCTLocators, fCTCount);
|
public com.sun.org.apache.xerces.internal.xs.XSModel | toXSModel()Return an XSModel that represents components in this schema
grammar.
return new XSModelImpl(new SchemaGrammar[]{this});
|
public com.sun.org.apache.xerces.internal.xs.XSModel | toXSModel(com.sun.org.apache.xerces.internal.xni.grammars.XSGrammar[] grammars)
if (grammars == null || grammars.length == 0)
return toXSModel();
int len = grammars.length;
boolean hasSelf = false;
for (int i = 0; i < len; i++) {
if (grammars[i] == this) {
hasSelf = true;
break;
}
}
SchemaGrammar[] gs = new SchemaGrammar[hasSelf ? len : len+1];
for (int i = 0; i < len; i++)
gs[i] = (SchemaGrammar)grammars[i];
if (!hasSelf)
gs[len] = this;
return new XSModelImpl(gs);
|