/** * Returns true if the grammar pool contains a grammar associated * to the specified description. * * @param desc The description of the grammar. */ public boolean containsGrammar(XMLGrammarDescription desc) { return super.containsGrammar(desc); } // containsGrammar(XMLGrammarDescription):boolean
/** * Returns the grammar associated to the specified description. * * @param desc The description of the grammar. */ public Grammar getGrammar(XMLGrammarDescription desc) { if (super.containsGrammar(desc)) { return super.getGrammar(desc); } return null; } // getGrammar(XMLGrammarDescription):Grammar
public void putGrammar(Grammar grammar) { if (grammar == null) return; // we overide this method to perform 'selective' caching of schemas XMLGrammarDescription description = grammar.getGrammarDescription(); if (!fPoolIsLocked && !containsGrammar(grammar.getGrammarDescription())) { // in order to avoid caching the inline schemas // we ensure the literal system id does not end with wsdl // before we attempt to 'put' the grammar String litSysId = description.getLiteralSystemId(); String basSysId = description.getBaseSystemId(); if (litSysId != null && litSysId.endsWith("xsd") && basSysId != null && basSysId.endsWith("wsdl")) { /* * System.out.println("putGramamr : " + * schemaDescription.getNamespace() + ", " + * schemaDescription.getExpandedSystemId() + ", " + * schemaDescription.getBaseSystemId()); */ super.putGrammar(grammar); } } } }