@Override public Grammar loadGrammar(XMLInputSource source) throws IOException, XNIException {
  reset(fLoaderConfig);
  fSettingsChanged=false;
  XSDDescription desc=new XSDDescription();
  desc.fContextType=XSDDescription.CONTEXT_PREPARSE;
  desc.setBaseSystemId(source.getBaseSystemId());
  desc.setLiteralSystemId(source.getSystemId());
  Hashtable locationPairs=new Hashtable();
  processExternalHints(fExternalSchemas,fExternalNoNSSchema,locationPairs,fErrorReporter);
  SchemaGrammar grammar=loadSchema(desc,source,locationPairs);
  if (grammar != null && fGrammarPool != null) {
    fGrammarPool.cacheGrammars(XMLGrammarDescription.XML_SCHEMA,fGrammarBucket.getGrammars());
    if (fIsCheckedFully && fJAXPCache.get(grammar) != grammar) {
      XSConstraints.fullSchemaChecking(fGrammarBucket,fSubGroupHandler,fCMBuilder,fErrorReporter);
    }
  }
  return grammar;
}

@ Override public Grammar loadGrammar ( XMLInputSource source ) throws IOException , XNIException { reset ( fLoaderConfig ) ; fSettingsChanged = false ; XSDDescription desc = new XSDDescription ( ) ; desc . fContextType = XSDDescription . CONTEXT_PREPARSE ; desc . setBaseSystemId ( source . getBaseSystemId ( ) ) ; desc . setLiteralSystemId ( source . getSystemId ( ) ) ; Hashtable locationPairs = new Hashtable ( ) ; processExternalHints ( fExternalSchemas , fExternalNoNSSchema , locationPairs , fErrorReporter ) ; SchemaGrammar grammar = loadSchema ( desc , source , locationPairs ) ; if ( grammar != null && fGrammarPool != null ) { fGrammarPool . cacheGrammars ( XMLGrammarDescription . XML_SCHEMA , fGrammarBucket . getGrammars ( ) ) ; if ( fIsCheckedFully && fJAXPCache . get ( grammar ) != grammar ) { XSConstraints . fullSchemaChecking ( fGrammarBucket , fSubGroupHandler , fCMBuilder , fErrorReporter ) ; } } return grammar ; }
returns a grammar object by parsing the contents of the entity pointed to by source .
