Save This Page
Home » sitemesh-2.3 » com.opensymphony.module » sitemesh » [javadoc | source]
com.opensymphony.module.sitemesh
public interface: Page [javadoc | source]

All Known Implementing Classes:
    Content2HTMLPage, TokenizedHTMLPage, AbstractPage, HTMLPage, AbstractHTMLPage, FastPage

The Page object wraps the contents of the original (undecorated) page.

The original data in its entirity can be written using the writePage() methods. It may also contain a set of properties - these vary among different com.opensymphony.module.sitemesh.PageParser implementations.

Typically a Page is no use to a com.opensymphony.module.sitemesh.Decorator as it needs specific details relevant to the content-type of that page (e.g. HTML pages). The appropriate com.opensymphony.module.sitemesh.PageParser is responsible for returning extended implementations of pages such as com.opensymphony.module.sitemesh.HTMLPage which are of more use to the Decorator. New media types (e.g. WML) could be added to the system by extending Page and implementing an appropriate PageParser.

Method from com.opensymphony.module.sitemesh.Page Summary:
addProperty,   getBody,   getBooleanProperty,   getContentLength,   getIntProperty,   getLongProperty,   getPage,   getProperties,   getProperty,   getPropertyKeys,   getRequest,   getTitle,   isPropertySet,   setRequest,   writeBody,   writePage
Method from com.opensymphony.module.sitemesh.Page Detail:
 public  void addProperty(String name,
    String value)
    Manually add a property to page.
 public String getBody()
    Convenience method to return the contents of the <body> tag.
 public boolean getBooleanProperty(String name)
    Get a property embedded into the Page as a boolean. Returns true if value starts with '1', 't' or 'y' (case-insensitive) - otherwise returns false.
 public int getContentLength()
    Length of the Page, in the format before it was parsed.
 public int getIntProperty(String name)
    Get a property embedded into the Page as an int. Returns 0 if property not specified or not valid number.
 public long getLongProperty(String name)
    Get a property embedded into the Page as a long. Returns 0L if property not specified or not valid number.
 public String getPage()
    Convenience method to return the contents of the Page in its original format.
 public Map getProperties()
    Get a Map representing all the properties in the Page.
 public String getProperty(String name)
    Get a property embedded into the Page as a String.
 public String[] getPropertyKeys()
    Get all available property keys for the Page.
 public HttpServletRequest getRequest()
    Return the request of the original page.
 public String getTitle()
    Get the Title of the document
 public boolean isPropertySet(String name)
    Determine whether a property embedded into the Page has been set.
 public  void setRequest(HttpServletRequest request)
    Create snapshot of Request. Subsequent modifications to the request by the servlet container will not be returned by #getRequest()
 public  void writeBody(Writer out) throws IOException
    Write the contents of the <body> tag.
 public  void writePage(Writer out) throws IOException
    Write the entire contents of the Page, in the format before it was parsed, to the Writer.