org.cruxframework.crux.core.declarativeui
Class ViewParser

java.lang.Object
  extended by org.cruxframework.crux.core.declarativeui.ViewParser

public class ViewParser
extends Object

Parses Crux view pages to extract metadata and generate the equivalent html for host pages.

Author:
Thiago da Rosa de Bustamante

Field Summary
static String CRUX_VIEW_PREFIX
           
 
Constructor Summary
ViewParser(String viewId, boolean escapeXML, boolean indentOutput, boolean xhtmlInput)
          Constructor.
 
Method Summary
 String extractCruxMetaData(Document view)
          Extract the view metadata form the current document
 void generateHTMLHostPage(Document cruxPageDocument, Writer out)
          Generates the HTML page from the given .crux.xml page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CRUX_VIEW_PREFIX

public static final String CRUX_VIEW_PREFIX
See Also:
Constant Field Values
Constructor Detail

ViewParser

public ViewParser(String viewId,
                  boolean escapeXML,
                  boolean indentOutput,
                  boolean xhtmlInput)
           throws ViewParserException
Constructor.

Parameters:
escapeXML - If true will escape all inner text nodes to ensure that the generated outputs will be parsed correctly by a XML parser.
indentOutput - True makes the generated outputs be indented.
xhtmlInput - True if the given document represents a valid XHTML page. If false, parser will assume that the input is composed by a root tag representing a the view.
Throws:
ViewParserException
Method Detail

extractCruxMetaData

public String extractCruxMetaData(Document view)
                           throws ViewParserException
Extract the view metadata form the current document

Parameters:
element -
Throws:
ViewParserException

generateHTMLHostPage

public void generateHTMLHostPage(Document cruxPageDocument,
                                 Writer out)
                          throws ViewParserException
Generates the HTML page from the given .crux.xml page.

Parameters:
viewId - The id of the screen associated with the .crux.xml page.
cruxPageDocument - a XML Document representing the .crux.xml page.
out - Where the generated HTML will be written.
Throws:
ViewParserException


Copyright © 2014. All rights reserved.