Top Description Fields Constructors Methods
com.sun.faces.config.manager.tasks

public Class ParseConfigResourceToDOMTask

extends Object
implements Callable<DocumentInfo>
Class Inheritance
All Implemented Interfaces
java.util.concurrent.Callable
Static Imports
com.sun.faces.config.manager.DbfFactory.FACES_ENTITY_RESOLVER, .DbfFactory.FACES_ERROR_HANDLER, com.sun.faces.util.Util.createTransformerFactory, java.text.MessageFormat.format

This Callable will be used by ConfigManager#getXMLDocuments(javax.servlet.ServletContext, java.util.List, java.util.concurrent.ExecutorService, boolean). It represents a single configuration resource to be parsed into a DOM.

Field Summary

Modifier and TypeField and Description
private URI
private static final String
private static final String
private static final String
private static final String
FACELETS_TO_2_0_XSL

Stylesheet to convert 1.0 facelet-taglib documents from 1.0 to 2.0 for schema validation purposes.

private static final String
private static final String
private static final String
FACES_TO_1_1_PRIVATE_XSL

Stylesheet to convert 1.0 and 1.1 based faces-config documents to our private 1.1 schema for validation.

private DocumentBuilderFactory
private static final String
private static final String
private static final Logger
private ServletContext
private boolean
public static final String
WEB_INF_MARKER

Name of the attribute added by ParseTask to indicate a Document instance as a representation of /WEB-INF/faces-config.xml.

Constructor Summary

AccessConstructor and Description
public
ParseConfigResourceToDOMTask(ServletContext
the servlet context.
servletContext
,
boolean
whether or not we're validating
validating
,
URI
a URL to the configuration resource to be parsed
documentURI
)

Constructs a new ParseTask instance

Method Summary

Modifier and TypeMethod and Description
public DocumentInfo

Returns:

the result of the parse operation (a DOM)
call
()

Implements java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.
private DocumentBuilder
private Document

Returns:

Document based on documentURI.
getDocument
()

private static InputStream

Returns:

an InputStream to the resource referred to by url
getInputStream
(URL
source URL
url
)

private DocumentBuilder
private static Transformer

Returns:

a new Tranformer instance
getTransformer
(String documentNS)

Obtain a Transformer using the style sheet referenced by the XSL constant.

private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

documentURIback to summary
private URI documentURI
EMPTY_FACES_CONFIGback to summary
private static final String EMPTY_FACES_CONFIG
FACELET_TAGLIB_TAGNAMEback to summary
private static final String FACELET_TAGLIB_TAGNAME
FACELETS_1_0_DEFAULT_NSback to summary
private static final String FACELETS_1_0_DEFAULT_NS
FACELETS_TO_2_0_XSLback to summary
private static final String FACELETS_TO_2_0_XSL

Stylesheet to convert 1.0 facelet-taglib documents from 1.0 to 2.0 for schema validation purposes.

FACES_CONFIG_1_X_DEFAULT_NSback to summary
private static final String FACES_CONFIG_1_X_DEFAULT_NS
FACES_CONFIG_TAGNAMEback to summary
private static final String FACES_CONFIG_TAGNAME
FACES_TO_1_1_PRIVATE_XSLback to summary
private static final String FACES_TO_1_1_PRIVATE_XSL

Stylesheet to convert 1.0 and 1.1 based faces-config documents to our private 1.1 schema for validation.

factoryback to summary
private DocumentBuilderFactory factory
JAVAEE_SCHEMA_DEFAULT_NSback to summary
private static final String JAVAEE_SCHEMA_DEFAULT_NS
JAVAEE_SCHEMA_LEGACY_DEFAULT_NSback to summary
private static final String JAVAEE_SCHEMA_LEGACY_DEFAULT_NS
LOGGERback to summary
private static final Logger LOGGER
servletContextback to summary
private ServletContext servletContext
validatingback to summary
private boolean validating
WEB_INF_MARKERback to summary
public static final String WEB_INF_MARKER

Name of the attribute added by ParseTask to indicate a Document instance as a representation of /WEB-INF/faces-config.xml.

Constructor Detail

ParseConfigResourceToDOMTaskback to summary
public ParseConfigResourceToDOMTask(ServletContext servletContext, boolean validating, URI documentURI) throws Exception

Constructs a new ParseTask instance

Parameters
servletContext:ServletContext

the servlet context.

validating:boolean

whether or not we're validating

documentURI:URI

a URL to the configuration resource to be parsed

Exceptions
Exception:
general error

Method Detail

callback to summary
public DocumentInfo call() throws Exception

Implements java.util.concurrent.Callable.call.

Doc from java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

Returns:DocumentInfo

the result of the parse operation (a DOM)

Annotations
@Override
Exceptions
Exception:
if an error occurs during the parsing process
getBuilderForSchemaback to summary
private DocumentBuilder getBuilderForSchema(Schema schema) throws Exception
getDocumentback to summary
private Document getDocument() throws Exception
Returns:Document

Document based on documentURI.

Exceptions
Exception:
if an error occurs during the process of building a Document
getInputStreamback to summary
private static InputStream getInputStream(URL url) throws IOException
Parameters
url:URL

source URL

Returns:InputStream

an InputStream to the resource referred to by url

Exceptions
IOException:
if an error occurs
getNonValidatingBuilderback to summary
private DocumentBuilder getNonValidatingBuilder() throws Exception
getTransformerback to summary
private static Transformer getTransformer(String documentNS) throws Exception

Obtain a Transformer using the style sheet referenced by the XSL constant.

Returns:Transformer

a new Tranformer instance

Exceptions
Exception:
if a Tranformer instance could not be created
streamIsZeroLengthOrEmptyback to summary
private boolean streamIsZeroLengthOrEmpty(InputStream is) throws IOException