Package org.apache.xerces.xni.grammars

Examples of org.apache.xerces.xni.grammars.XMLGrammarPool


        XMLEntityResolver entityResolver =  config.getEntityResolver();
        if (entityResolver != null) {
            fConfiguration.setEntityResolver(entityResolver);
        }
       
        XMLGrammarPool pool = (XMLGrammarPool)config.getProperty(DOMValidationConfiguration.GRAMMAR_POOL);
        if (pool != null) {
            // copy the grammar pool
            XMLGrammarPool grammarPool = new XMLGrammarPoolImpl();
            grammarPool.cacheGrammars(XMLGrammarDescription.XML_SCHEMA, 
                                      pool.retrieveInitialGrammarSet(XMLGrammarDescription.XML_SCHEMA));
            fConfiguration.setProperty(DOMValidationConfiguration.GRAMMAR_POOL, grammarPool);
        }
    }
View Full Code Here


        // REVISIT:  so shouldn't we attempt to clear the
        // grammarPool before adding stuff to it?  - NG
        fAbstractSchema = (ASModelImpl)abstractSchema;

        // make sure the GrammarPool is properly initialized.
        XMLGrammarPool grammarPool = (XMLGrammarPool)fConfiguration.getProperty(StandardParserConfiguration.XMLGRAMMAR_POOL);
        // if there is no grammar pool, create one
        // REVISIT: ASBuilder should always create one.
        if (grammarPool == null) {
            // something's not right in this situation...
            grammarPool = new XMLGrammarPoolImpl();
View Full Code Here

   */
  protected void setupValidation(NestedValidatorContext context)
  {
  super.setupValidation(context);
   
  XMLGrammarPool xsdGrammarPool = new InlineSchemaModelGrammarPoolImpl();
  XMLGrammarPool xmlGrammarPool = new XMLGrammarPoolImpl();
 
  xsdGrammarPools.put(context, xsdGrammarPool);
  xmlGrammarPools.put(context, xmlGrammarPool);
  }
View Full Code Here

   *
   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#teardownValidation(org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
   */
  protected void teardownValidation(NestedValidatorContext context)
  {
    XMLGrammarPool xsdGrammarPool = (XMLGrammarPool)xsdGrammarPools.remove(context);
    if(xsdGrammarPool != null)
      xsdGrammarPool.clear();
    XMLGrammarPool xmlGrammarPool = (XMLGrammarPool)xmlGrammarPools.remove(context);
    if(xmlGrammarPool != null)
      xmlGrammarPool.clear();
   
    super.teardownValidation(context);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#validate(java.lang.String, java.io.InputStream, org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
   */
  public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context)
  {
  XMLGrammarPool xsdGrammarPool = (XMLGrammarPool)xsdGrammarPools.get(context);
  XMLGrammarPool xmlGrammarPool = (XMLGrammarPool)xmlGrammarPools.get(context);
 
  WSDLValidator validator = WSDLValidator.getInstance();
 
  WSDLValidationConfiguration configuration = new WSDLValidationConfiguration();
  configuration.setProperty(Constants.XMLSCHEMA_CACHE_ATTRIBUTE, xsdGrammarPool);
View Full Code Here

    ValidateErrorHandler errorHandler = new ValidateErrorHandler();
    errorHandler.getErrorMessages().clear();
    try
    {
    XMLGrammarPreparser grammarPreparser = new XMLGrammarPreparser();
    XMLGrammarPool grammarPool = new XMLGrammarPoolImpl();
    grammarPreparser.setGrammarPool(grammarPool);
  
      grammarPreparser.setErrorHandler(errorHandler);
      if (entityResolver != null)
      {
View Full Code Here

    xmlValidator.setURIResolver(uriResolver);
    xmlValidator.setFile(valInfo.getFileURI());
    if (xmlValidator instanceof DefaultXMLValidator)
    {
        ((DefaultXMLValidator)xmlValidator).setInputStream(inputStream);
        XMLGrammarPool grammarPool = (XMLGrammarPool)valInfo.getAttribute(Constants.XML_CACHE_ATTRIBUTE);
        if(grammarPool != null)
          ((DefaultXMLValidator)xmlValidator).setGrammarPool(grammarPool);
    }
    //xmlValidator.setValidationInfo(valInfo);
    xmlValidator.run();
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.wst.wsdl.validation.internal.wsdl11.IWSDL11ValidationInfo#getSchemaCache()
   */
  public XMLGrammarPool getSchemaCache()
  {
  XMLGrammarPool grammarPool = (XMLGrammarPool)valinfo.getAttribute(Constants.XMLSCHEMA_CACHE_ATTRIBUTE);
  return grammarPool;
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.wst.wsdl.validation.internal.wsdl11.IWSDL11ValidationInfo#getXMLCache()
   */
  public XMLGrammarPool getXMLCache()
  {
  XMLGrammarPool grammarPool = (XMLGrammarPool)valinfo.getAttribute(Constants.XML_CACHE_ATTRIBUTE);
  return grammarPool;
  }
View Full Code Here

    xmlValidator.setFile(uri);
    xmlValidator.setURIResolver(valinfo.getURIResolver());
    //xmlValidator.setValidationInfo(valInfo);
    if(xmlValidator instanceof DefaultXMLValidator)
    {
      XMLGrammarPool grammarPool = valinfo.getXMLCache();
        if(grammarPool != null)
          ((DefaultXMLValidator)xmlValidator).setGrammarPool(grammarPool);
    }
    xmlValidator.run();
    // if there are no xml conformance problems go on to check the wsdl stuff
View Full Code Here

TOP

Related Classes of org.apache.xerces.xni.grammars.XMLGrammarPool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.