Class Parser


  • public class Parser
    extends java.lang.Object
    Used to parse the ZUL file
    Author:
    tomyeh
    • Constructor Summary

      Constructors 
      Constructor Description
      Parser​(WebApp wapp, Locator locator)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Locator getLocator()
      returns locator for locating resources.
      PageDefinition parse​(java.io.File file, java.lang.String path)
      Parses the specified file.
      PageDefinition parse​(java.io.Reader reader, java.lang.String extension)
      Parses from the specified reader.
      PageDefinition parse​(java.net.URL url, java.lang.String path)
      Parses the specified URL.
      PageDefinition parse​(Document doc, java.lang.String extension)
      Parse the raw content directly from a DOM tree.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SIMPLIFIED_COMMAND_PARAM_PREFIX

        public static final java.lang.String SIMPLIFIED_COMMAND_PARAM_PREFIX
        See Also:
        Constant Field Values
    • Constructor Detail

      • Parser

        public Parser​(WebApp wapp,
                      Locator locator)
        Constructor.
        Parameters:
        locator - the locator used to locate taglib and other resources. If null, wapp is assumed (WebApp is also assumed).
    • Method Detail

      • parse

        public PageDefinition parse​(java.io.File file,
                                    java.lang.String path)
                             throws java.lang.Exception
        Parses the specified file.
        Parameters:
        path - the request path. It is used as Page.getRequestPath(), or null if not available.
        Throws:
        java.lang.Exception
      • parse

        public PageDefinition parse​(java.net.URL url,
                                    java.lang.String path)
                             throws java.lang.Exception
        Parses the specified URL.
        Parameters:
        path - the request path. It is used as Page.getRequestPath(), or null if not available.
        Throws:
        java.lang.Exception
      • parse

        public PageDefinition parse​(java.io.Reader reader,
                                    java.lang.String extension)
                             throws java.lang.Exception
        Parses from the specified reader.
        Parameters:
        extension - the default extension if doc (of reader) doesn't specify an language. Ignored if null. If extension is null and the content doesn't specify a language, the language called "xul/html" is assumed.
        Throws:
        java.lang.Exception
      • parse

        public PageDefinition parse​(Document doc,
                                    java.lang.String extension)
                             throws java.lang.Exception
        Parse the raw content directly from a DOM tree.
        Parameters:
        extension - the default extension if doc doesn't specify an language. Ignored if null. If extension is null and the content doesn't specify a language, the language called "xul/html" is assumed.
        Throws:
        java.lang.Exception
      • getLocator

        public Locator getLocator()
        returns locator for locating resources.