com.mycompany.jsf.pl
Class XMLViewHandler

java.lang.Object
  extended byjavax.faces.application.ViewHandler
      extended bycom.mycompany.jsf.pl.ClassViewHandler
          extended bycom.mycompany.jsf.pl.XMLViewHandler

public class XMLViewHandler
extends ClassViewHandler

This class is a JSF ViewHandler that works with views defined by a combination of a view specification file and a template file.

Version:
1.0
Author:
Hans Bergsten, Gefion Software

Nested Class Summary
private static class XMLViewHandler.TemplateHandler
          This class is a SAX DefaultHandler for processing the template file.
private static class XMLViewHandler.ViewSpecHandler
          This class is a SAX DefaultHandler for processing the view specification file.
 
Field Summary
 
Fields inherited from class com.mycompany.jsf.pl.ClassViewHandler
origViewHandler
 
Fields inherited from class javax.faces.application.ViewHandler
CHARACTER_ENCODING_KEY, DEFAULT_SUFFIX, DEFAULT_SUFFIX_PARAM_NAME
 
Constructor Summary
XMLViewHandler(javax.faces.application.ViewHandler origViewHandler)
          Creates an instance and saves a reference to the previously registered ViewHandler.
 
Method Summary
protected  javax.faces.component.UIViewRoot createViewRoot(javax.faces.context.FacesContext context, java.lang.String viewId)
          Returns the UIViewRoot for the specified view, by parsing the view specification file and processing the elements in the specification with an instance of the ViewSpecHandler class.
protected  void renderResponse(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Renders the view represented by the provided root component by parsing the template file for the view and processing the elements in the template with an instance of the TemplateHandler class.
 
Methods inherited from class com.mycompany.jsf.pl.ClassViewHandler
calculateLocale, calculateRenderKitId, createView, getActionURL, getResourceURL, renderView, restoreView, writeState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLViewHandler

public XMLViewHandler(javax.faces.application.ViewHandler origViewHandler)
Creates an instance and saves a reference to the previously registered ViewHandler.

Method Detail

createViewRoot

protected javax.faces.component.UIViewRoot createViewRoot(javax.faces.context.FacesContext context,
                                                          java.lang.String viewId)
Returns the UIViewRoot for the specified view, by parsing the view specification file and processing the elements in the specification with an instance of the ViewSpecHandler class.

Overrides:
createViewRoot in class ClassViewHandler

renderResponse

protected void renderResponse(javax.faces.context.FacesContext context,
                              javax.faces.component.UIComponent component)
                       throws java.io.IOException
Renders the view represented by the provided root component by parsing the template file for the view and processing the elements in the template with an instance of the TemplateHandler class.

Overrides:
renderResponse in class ClassViewHandler
Throws:
java.io.IOException