if (fJAXPSource == null) {
return;
}
Class componentType = fJAXPSource.getClass().getComponentType();
XMLInputSource xis = null;
String sid = null;
if (componentType == null) {
// Not an array
if (fJAXPSource instanceof InputStream ||
fJAXPSource instanceof InputSource) {
SchemaGrammar g = (SchemaGrammar)fJAXPCache.get(fJAXPSource);
if (g != null) {
fGrammarBucket.putGrammar(g);
return;
}
}
fXSDDescription.reset();
xis = xsdToXMLInputSource(fJAXPSource);
sid = xis.getSystemId();
fXSDDescription.fContextType = XSDDescription.CONTEXT_PREPARSE;
if (sid != null) {
fXSDDescription.setBaseSystemId(xis.getBaseSystemId());
fXSDDescription.setLiteralSystemId(sid);
fXSDDescription.setExpandedSystemId(sid);
fXSDDescription.fLocationHints = new String[]{sid};
}
SchemaGrammar g = loadSchema(fXSDDescription, xis, locationPairs);
// it is possible that we won't be able to resolve JAXP schema-source location
if (g != null) {
if (fJAXPSource instanceof InputStream ||
fJAXPSource instanceof InputSource) {
fJAXPCache.put(fJAXPSource, g);
if (fIsCheckedFully) {
XSConstraints.fullSchemaChecking(fGrammarBucket, fSubGroupHandler, fCMBuilder, fErrorReporter);
}
}
fGrammarBucket.putGrammar(g);
}
return;
}
else if ( (componentType != Object.class) &&
(componentType != String.class) &&
(componentType != File.class) &&
(componentType != InputStream.class) &&
(componentType != InputSource.class) &&
!File.class.isAssignableFrom(componentType) &&
!InputStream.class.isAssignableFrom(componentType) &&
!InputSource.class.isAssignableFrom(componentType) &&
!componentType.isInterface()
) {
// Not an Object[], String[], File[], InputStream[], InputSource[]
MessageFormatter mf = fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN);
throw new XMLConfigurationException(
XMLConfigurationException.NOT_SUPPORTED,
mf.formatMessage(fErrorReporter.getLocale(), "jaxp12-schema-source-type.2",
new Object [] {componentType.getName()}));
}
// JAXP spec. allow []s of type String, File, InputStream,
// InputSource also, apart from [] of type Object.
Object[] objArr = (Object[]) fJAXPSource;
// make local vector for storing target namespaces of schemasources specified in object arrays.
ArrayList jaxpSchemaSourceNamespaces = new ArrayList();
for (int i = 0; i < objArr.length; i++) {
if (objArr[i] instanceof InputStream ||
objArr[i] instanceof InputSource) {
SchemaGrammar g = (SchemaGrammar)fJAXPCache.get(objArr[i]);
if (g != null) {
fGrammarBucket.putGrammar(g);
continue;
}
}
fXSDDescription.reset();
xis = xsdToXMLInputSource(objArr[i]);
sid = xis.getSystemId();
fXSDDescription.fContextType = XSDDescription.CONTEXT_PREPARSE;
if (sid != null) {
fXSDDescription.setBaseSystemId(xis.getBaseSystemId());
fXSDDescription.setLiteralSystemId(sid);
fXSDDescription.setExpandedSystemId(sid);
fXSDDescription.fLocationHints = new String[]{sid};
}
String targetNamespace = null ;