Package com.sun.jsftemplating.util

Examples of com.sun.jsftemplating.util.IncludeInputStream


      DocumentBuilder builder = DbFactory.getInstance();
      builder.setErrorHandler(new ParsingErrorHandler());
      is = this.url.openStream();
      bs = new BufferedInputStream(is);
      document = builder.parse(new IncludeInputStream(bs));
  } catch (Exception e) {
      throw new LayoutDefinitionException(e);
  } finally {
      Util.closeStream(bs);
      Util.closeStream(is);
View Full Code Here


// FIXME: It is possible while evaluating the file an #include may need to log a message to the screen!  Provide a callback mechanism to do this in a Template-specific way
  // Create the reader from the stream
  _reader = new BufferedReader(
    new InputStreamReader(
    new IncludeInputStream(
    new BufferedInputStream(getInputStream()))));

  // Initialize the queue we will use to push values back
  _stack = new Stack<Character>();
    }
View Full Code Here

     *
     *  @throws  IOException
     */
    public LayoutDefinition read() throws IOException {
  // Open the URL
  InputStream inputStream = new IncludeInputStream(
    new BufferedInputStream(getURL().openStream()));
  Document doc = null;

  try {
      // Get a DocumentBuilderFactory and set it up
      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      dbf.setNamespaceAware(true);
      dbf.setValidating(true);
      dbf.setIgnoringComments(true);
      dbf.setIgnoringElementContentWhitespace(false);
      dbf.setCoalescing(false);
      // The opposite of creating entity ref nodes is expanding inline
      dbf.setExpandEntityReferences(true);

      // Get a DocumentBuilder...
      DocumentBuilder db = null;
      try {
    db = dbf.newDocumentBuilder();
      } catch (ParserConfigurationException ex) {
    throw new RuntimeException(ex);
      }
      if (getEntityResolver() != null) {
    db.setEntityResolver(getEntityResolver());
      }
      if (getErrorHandler() != null) {
    db.setErrorHandler(getErrorHandler());
      }

      // Parse the XML file
      try {
    doc = db.parse(inputStream, getBaseURI());
      } catch (IOException ex) {
    throw new SyntaxException("Unable to parse XML file!", ex);
      } catch (SAXException ex) {
    throw new SyntaxException(ex);
      }
  } finally {
      try {
    inputStream.close();
      } catch (Exception ex) {
    // Ignore...
      }
  }

View Full Code Here

TOP

Related Classes of com.sun.jsftemplating.util.IncludeInputStream

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.