private static class ConfigManager.ParseTask extends java.lang.Object implements java.util.concurrent.Callable<DocumentInfo>
This Callable
will be used by ConfigManager.getConfigDocuments(javax.servlet.ServletContext, java.util.List, java.util.concurrent.ExecutorService, boolean)
.
It represents a single configuration resource to be parsed into a DOM.
Modifier and Type | Field and Description |
---|---|
private java.net.URI |
documentURI |
private static java.lang.String |
EMPTY_FACES_CONFIG |
private static java.lang.String |
FACELET_TAGLIB_TAGNAME |
private static java.lang.String |
FACES_CONFIG_TAGNAME |
private javax.xml.parsers.DocumentBuilderFactory |
factory |
private static java.lang.String |
JAVAEE_SCHEMA_DEFAULT_NS |
private static java.lang.String |
JAVAEE_SCHEMA_LEGACY_DEFAULT_NS |
private javax.servlet.ServletContext |
servletContext |
private boolean |
validating |
Constructor and Description |
---|
ParseTask(javax.servlet.ServletContext servletContext,
boolean validating,
java.net.URI documentURI)
Constructs a new ParseTask instance
|
Modifier and Type | Method and Description |
---|---|
DocumentInfo |
call() |
private javax.xml.parsers.DocumentBuilder |
getBuilderForSchema(javax.xml.validation.Schema schema) |
private org.w3c.dom.Document |
getDocument() |
private static java.io.InputStream |
getInputStream(java.net.URL url) |
private javax.xml.parsers.DocumentBuilder |
getNonValidatingBuilder() |
private static javax.xml.transform.Transformer |
getTransformer(java.lang.String documentNS)
Obtain a
Transformer using the style sheet
referenced by the XSL constant. |
private boolean |
streamIsZeroLengthOrEmpty(java.io.InputStream is) |
private static final java.lang.String JAVAEE_SCHEMA_LEGACY_DEFAULT_NS
private static final java.lang.String JAVAEE_SCHEMA_DEFAULT_NS
private static final java.lang.String EMPTY_FACES_CONFIG
private static final java.lang.String FACES_CONFIG_TAGNAME
private static final java.lang.String FACELET_TAGLIB_TAGNAME
private javax.servlet.ServletContext servletContext
private java.net.URI documentURI
private javax.xml.parsers.DocumentBuilderFactory factory
private boolean validating
public ParseTask(javax.servlet.ServletContext servletContext, boolean validating, java.net.URI documentURI) throws java.lang.Exception
Constructs a new ParseTask instance
servletContext
- the servlet context.validating
- whether or not we're validatingdocumentURI
- a URL to the configuration resource to be parsedjava.lang.Exception
- general errorpublic DocumentInfo call() throws java.lang.Exception
call
in interface java.util.concurrent.Callable<DocumentInfo>
java.lang.Exception
- if an error occurs during the parsing processprivate org.w3c.dom.Document getDocument() throws java.lang.Exception
Document
based on documentURI
.java.lang.Exception
- if an error occurs during the process of building a
Document
private boolean streamIsZeroLengthOrEmpty(java.io.InputStream is) throws java.io.IOException
java.io.IOException
private static javax.xml.transform.Transformer getTransformer(java.lang.String documentNS) throws java.lang.Exception
Transformer
using the style sheet
referenced by the XSL
constant.java.lang.Exception
- if a Tranformer instance could not be createdprivate static java.io.InputStream getInputStream(java.net.URL url) throws java.io.IOException
url
- source URL
InputStream
to the resource referred to by
url
java.io.IOException
- if an error occursprivate javax.xml.parsers.DocumentBuilder getNonValidatingBuilder() throws java.lang.Exception
java.lang.Exception
private javax.xml.parsers.DocumentBuilder getBuilderForSchema(javax.xml.validation.Schema schema) throws java.lang.Exception
java.lang.Exception
Copyright © 2002-2013 Oracle America, Inc. All Rights Reserved.