Package org.apache.myfaces.trinidadinternal.share.xml

Examples of org.apache.myfaces.trinidadinternal.share.xml.TreeBuilder$StackEntry


{
  static public TestScript getTestScript(File file, FacesConfigInfo info)
    throws IOException, SAXException
  {
    TestScript script = new TestScript();
    TreeBuilder builder = new TreeBuilder();
    InputStream inputStream = new FileInputStream(file);

    try
    {
      InputSource source = new InputSource(inputStream);
      source.setSystemId(file.getAbsolutePath());
      builder.parse(source, new TestScriptParser(script, info));
    }
    finally
    {
      inputStream.close();
    }
View Full Code Here


      // Set up the NameResolver if we have one
      if (resolver != null)
        XMLUtils.setResolver(context, resolver);

      // Create the TreeBuilder
      TreeBuilder builder = new TreeBuilder(parserManager,
                                            SkinsNode.class);
      skinsNode = ((SkinsNode)builder.parse(provider, input, context));
  
    }
    catch (IOException ioe)
    {
      _LOG.warning(ioe);
View Full Code Here

    return _components.get(componentType);
  }
 
  public void load(String file) throws IOException, SAXException
  {
    TreeBuilder builder = new TreeBuilder();
    XMLValidityTestCase.ER er = new XMLValidityTestCase.ER();
    String publicID =
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN";
    // TODO: fall back on RI location if MyFaces can't be found
    URL dtdSource = getClass().getClassLoader().getResource(
       "org/apache/myfaces/resource/web-facesconfig_1_1.dtd");
    er.registerPublicId(publicID, dtdSource);
    builder.setEntityResolver(er);

    Enumeration<URL> resources = getClass().getClassLoader().getResources(file);
    while (resources.hasMoreElements())
    {
      URL resource = resources.nextElement();
      _LOG.info("PARSING " + resource);
      InputStream inputStream = null;
      // Try to get the inputStream off of a file
      if ("file".equalsIgnoreCase(resource.getProtocol()))
      {
        File resourceFile = new File(resource.getFile().replaceAll("%20", " "));
        if (resourceFile.exists())
        {
          inputStream = new FileInputStream(resourceFile);
        }
      }

      if (inputStream == null)
        inputStream = resource.openStream();

      try
      {
        InputSource source = new InputSource(inputStream);
        source.setSystemId(resource.toExternalForm());
        builder.parse(source, new FacesConfigParser(this));
      }
      finally
      {
        inputStream.close();
      }
View Full Code Here

  {
    // Get the ParserManager
    ParserManager manager = _getDefaultManager();

    // Create the builder.
    TreeBuilder builder = new TreeBuilder(manager, expectedClass);

    // Set up the parse context
    ParseContextImpl parseContext = new ParseContextImpl();

    // Transfer properties from the ImageContext to the ParseContext
    ResourceBundle bundle = (ResourceBundle)context.getProperty(
                              ImageConstants.TECATE_NAMESPACE,
                              XMLConstants.RESOURCE_BUNDLE_PROPERTY);
    if (bundle != null)
    {
      parseContext.setProperty(ImageConstants.TECATE_NAMESPACE,
                               XMLConstants.RESOURCE_BUNDLE_PROPERTY,
                               bundle);

    }

    parseContext.setProperty(ImageConstants.TECATE_NAMESPACE,
                             XMLConstants.LOCALE_CONTEXT_PROPERTY,
                             context.getLocaleContext());

    // Parse it!
    return builder.parse(provider, source, parseContext);
  }
View Full Code Here

      InputSource source = new InputSource(stream);
      source.setSystemId(capUrl.toExternalForm());

      ParseContextImpl pc = new ParseContextImpl ();
      pc.setProperty(NS_URI, __BASE_URL, capUrl);
      TreeBuilder builder =  new  TreeBuilder();
      return (CapabilitiesDocument) builder.parse(null, source, pc, parser);

    }
    catch (SAXException saxe)
    {
      //Logging handled by tree builder
View Full Code Here

      InputSource source = new InputSource(stream);
      source.setSystemId(srcUrl.toExternalForm());

      ParseContextImpl pc = new ParseContextImpl ();
      TreeBuilder builder =  new  TreeBuilder();
      return (Object[]) builder.parse(null, source, pc, parser);
    }
    catch (SAXException saxe)
    {
      _LOG.severe("FAIL_PARSE_CAPABILITIES_DATA_DOCUMENT", saxe);
    }
View Full Code Here

      // Set up the NameResolver if we have one
      if (resolver != null)
        XMLUtils.setResolver(context, resolver);

      // Create the TreeBuilder
      TreeBuilder builder = new TreeBuilder(parserManager,
                                            SkinsNode.class);
      skinsNode = ((SkinsNode)builder.parse(provider, input, context));
  
    }
    catch (IOException ioe)
    {
      _LOG.warning(ioe);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.share.xml.TreeBuilder$StackEntry

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.