Class Content2HTMLPage
- java.lang.Object
-
- com.opensymphony.sitemesh.compatability.Content2HTMLPage
-
-
Constructor Summary
Constructors Constructor Description Content2HTMLPage(Content content)Content2HTMLPage(Content content, javax.servlet.http.HttpServletRequest request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProperty(String name, String value)Manually add a property to page.StringgetBody()Convenience method to return the contents of the<body>tag.booleangetBooleanProperty(String name)Get a property embedded into thePageas aboolean.intgetContentLength()Length of thePage, in the format before it was parsed.StringgetHead()Convenience method to return the contents of the<head>tag as a String.intgetIntProperty(String name)Get a property embedded into thePageas anint.longgetLongProperty(String name)Get a property embedded into thePageas along.StringgetPage()Convenience method to return the contents of thePagein its original format.MapgetProperties()Get aMaprepresenting all the properties in thePage.StringgetProperty(String name)Get a property embedded into thePageas aString.String[]getPropertyKeys()Get all available property keys for thePage.javax.servlet.http.HttpServletRequestgetRequest()Return the request of the original page.StringgetTitle()Get the Title of the documentbooleanisFrameSet()Check to see if this page contains an HTML frameset.booleanisPropertySet(String name)Determine whether a property embedded into thePagehas been set.private StringnoNull(String property)voidsetFrameSet(boolean frameset)Marks this page as a frameset.voidsetRequest(javax.servlet.http.HttpServletRequest request)Create snapshot of Request.voidwriteBody(Writer out)Write the contents of the<body>tag.voidwriteHead(Writer out)Write the contents of the<head>tag.voidwritePage(Writer out)Write the entire contents of thePage, in the format before it was parsed, to theWriter.
-
-
-
Field Detail
-
content
private final Content content
-
request
private javax.servlet.http.HttpServletRequest request
-
-
Method Detail
-
writePage
public void writePage(Writer out) throws IOException
Description copied from interface:PageWrite the entire contents of thePage, in the format before it was parsed, to theWriter.- Specified by:
writePagein interfacePage- Parameters:
out- Writer to write to.- Throws:
IOException- Rethrown if cannot write to writer.
-
getPage
public String getPage()
Description copied from interface:PageConvenience method to return the contents of thePagein its original format.- Specified by:
getPagein interfacePage- See Also:
Page.writePage(java.io.Writer)
-
writeBody
public void writeBody(Writer out) throws IOException
Description copied from interface:PageWrite the contents of the<body>tag.- Specified by:
writeBodyin interfacePage- Throws:
IOException
-
getBody
public String getBody()
Description copied from interface:PageConvenience method to return the contents of the<body>tag.- Specified by:
getBodyin interfacePage- See Also:
Page.writeBody(java.io.Writer)
-
writeHead
public void writeHead(Writer out) throws IOException
Description copied from interface:HTMLPageWrite the contents of the<head>tag.- Specified by:
writeHeadin interfaceHTMLPage- Throws:
IOException
-
getHead
public String getHead()
Description copied from interface:HTMLPageConvenience method to return the contents of the<head>tag as a String.- Specified by:
getHeadin interfaceHTMLPage- See Also:
HTMLPage.writeHead(java.io.Writer)
-
getTitle
public String getTitle()
Description copied from interface:PageGet the Title of the document
-
getContentLength
public int getContentLength()
Description copied from interface:PageLength of thePage, in the format before it was parsed.- Specified by:
getContentLengthin interfacePage- Returns:
- Length of page data (in number of bytes).
-
getProperty
public String getProperty(String name)
Description copied from interface:PageGet a property embedded into thePageas aString.- Specified by:
getPropertyin interfacePage- Parameters:
name- Name of property- Returns:
- Property value
-
getIntProperty
public int getIntProperty(String name)
Description copied from interface:PageGet a property embedded into thePageas anint. Returns 0 if property not specified or not valid number.- Specified by:
getIntPropertyin interfacePage- Parameters:
name- Name of property- Returns:
- Property value
-
getLongProperty
public long getLongProperty(String name)
Description copied from interface:PageGet a property embedded into thePageas along. Returns 0L if property not specified or not valid number.- Specified by:
getLongPropertyin interfacePage- Parameters:
name- Name of property- Returns:
- Property value
-
getBooleanProperty
public boolean getBooleanProperty(String name)
Description copied from interface:PageGet a property embedded into thePageas aboolean. Returns true if value starts with '1', 't' or 'y' (case-insensitive) - otherwise returns false.- Specified by:
getBooleanPropertyin interfacePage- Parameters:
name- Name of property- Returns:
- Property value
-
isPropertySet
public boolean isPropertySet(String name)
Description copied from interface:PageDetermine whether a property embedded into thePagehas been set.- Specified by:
isPropertySetin interfacePage- Parameters:
name- Name of property- Returns:
- Whether it has been set
-
getPropertyKeys
public String[] getPropertyKeys()
Description copied from interface:PageGet all available property keys for thePage.- Specified by:
getPropertyKeysin interfacePage- Returns:
- Property keys
-
getProperties
public Map getProperties()
Description copied from interface:PageGet aMaprepresenting all the properties in thePage.- Specified by:
getPropertiesin interfacePage- Returns:
- Properties map
-
isFrameSet
public boolean isFrameSet()
Description copied from interface:HTMLPageCheck to see if this page contains an HTML frameset.- Specified by:
isFrameSetin interfaceHTMLPage
-
setFrameSet
public void setFrameSet(boolean frameset)
Description copied from interface:HTMLPageMarks this page as a frameset.- Specified by:
setFrameSetin interfaceHTMLPage- See Also:
HTMLPage.isFrameSet()
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
Description copied from interface:PageReturn the request of the original page.- Specified by:
getRequestin interfacePage- See Also:
Page.getRequest()
-
setRequest
public void setRequest(javax.servlet.http.HttpServletRequest request)
Create snapshot of Request.- Specified by:
setRequestin interfacePage- See Also:
Page.getRequest()
-
addProperty
public void addProperty(String name, String value)
Description copied from interface:PageManually add a property to page.- Specified by:
addPropertyin interfacePage
-
-