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 void
addProperty(String name, String value)
Manually add a property to page.String
getBody()
Convenience method to return the contents of the<body>
tag.boolean
getBooleanProperty(String name)
Get a property embedded into thePage
as aboolean
.int
getContentLength()
Length of thePage
, in the format before it was parsed.String
getHead()
Convenience method to return the contents of the<head>
tag as a String.int
getIntProperty(String name)
Get a property embedded into thePage
as anint
.long
getLongProperty(String name)
Get a property embedded into thePage
as along
.String
getPage()
Convenience method to return the contents of thePage
in its original format.Map
getProperties()
Get aMap
representing all the properties in thePage
.String
getProperty(String name)
Get a property embedded into thePage
as aString
.String[]
getPropertyKeys()
Get all available property keys for thePage
.javax.servlet.http.HttpServletRequest
getRequest()
Return the request of the original page.String
getTitle()
Get the Title of the documentboolean
isFrameSet()
Check to see if this page contains an HTML frameset.boolean
isPropertySet(String name)
Determine whether a property embedded into thePage
has been set.private String
noNull(String property)
void
setFrameSet(boolean frameset)
Marks this page as a frameset.void
setRequest(javax.servlet.http.HttpServletRequest request)
Create snapshot of Request.void
writeBody(Writer out)
Write the contents of the<body>
tag.void
writeHead(Writer out)
Write the contents of the<head>
tag.void
writePage(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:Page
Write the entire contents of thePage
, in the format before it was parsed, to theWriter
.- Specified by:
writePage
in interfacePage
- Parameters:
out
- Writer to write to.- Throws:
IOException
- Rethrown if cannot write to writer.
-
getPage
public String getPage()
Description copied from interface:Page
Convenience method to return the contents of thePage
in its original format.- Specified by:
getPage
in interfacePage
- See Also:
Page.writePage(java.io.Writer)
-
writeBody
public void writeBody(Writer out) throws IOException
Description copied from interface:Page
Write the contents of the<body>
tag.- Specified by:
writeBody
in interfacePage
- Throws:
IOException
-
getBody
public String getBody()
Description copied from interface:Page
Convenience method to return the contents of the<body>
tag.- Specified by:
getBody
in interfacePage
- See Also:
Page.writeBody(java.io.Writer)
-
writeHead
public void writeHead(Writer out) throws IOException
Description copied from interface:HTMLPage
Write the contents of the<head>
tag.- Specified by:
writeHead
in interfaceHTMLPage
- Throws:
IOException
-
getHead
public String getHead()
Description copied from interface:HTMLPage
Convenience method to return the contents of the<head>
tag as a String.- Specified by:
getHead
in interfaceHTMLPage
- See Also:
HTMLPage.writeHead(java.io.Writer)
-
getTitle
public String getTitle()
Description copied from interface:Page
Get the Title of the document
-
getContentLength
public int getContentLength()
Description copied from interface:Page
Length of thePage
, in the format before it was parsed.- Specified by:
getContentLength
in interfacePage
- Returns:
- Length of page data (in number of bytes).
-
getProperty
public String getProperty(String name)
Description copied from interface:Page
Get a property embedded into thePage
as aString
.- Specified by:
getProperty
in interfacePage
- Parameters:
name
- Name of property- Returns:
- Property value
-
getIntProperty
public int getIntProperty(String name)
Description copied from interface:Page
Get a property embedded into thePage
as anint
. Returns 0 if property not specified or not valid number.- Specified by:
getIntProperty
in interfacePage
- Parameters:
name
- Name of property- Returns:
- Property value
-
getLongProperty
public long getLongProperty(String name)
Description copied from interface:Page
Get a property embedded into thePage
as along
. Returns 0L if property not specified or not valid number.- Specified by:
getLongProperty
in interfacePage
- Parameters:
name
- Name of property- Returns:
- Property value
-
getBooleanProperty
public boolean getBooleanProperty(String name)
Description copied from interface:Page
Get a property embedded into thePage
as aboolean
. Returns true if value starts with '1', 't' or 'y' (case-insensitive) - otherwise returns false.- Specified by:
getBooleanProperty
in interfacePage
- Parameters:
name
- Name of property- Returns:
- Property value
-
isPropertySet
public boolean isPropertySet(String name)
Description copied from interface:Page
Determine whether a property embedded into thePage
has been set.- Specified by:
isPropertySet
in interfacePage
- Parameters:
name
- Name of property- Returns:
- Whether it has been set
-
getPropertyKeys
public String[] getPropertyKeys()
Description copied from interface:Page
Get all available property keys for thePage
.- Specified by:
getPropertyKeys
in interfacePage
- Returns:
- Property keys
-
getProperties
public Map getProperties()
Description copied from interface:Page
Get aMap
representing all the properties in thePage
.- Specified by:
getProperties
in interfacePage
- Returns:
- Properties map
-
isFrameSet
public boolean isFrameSet()
Description copied from interface:HTMLPage
Check to see if this page contains an HTML frameset.- Specified by:
isFrameSet
in interfaceHTMLPage
-
setFrameSet
public void setFrameSet(boolean frameset)
Description copied from interface:HTMLPage
Marks this page as a frameset.- Specified by:
setFrameSet
in interfaceHTMLPage
- See Also:
HTMLPage.isFrameSet()
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
Description copied from interface:Page
Return the request of the original page.- Specified by:
getRequest
in interfacePage
- See Also:
Page.getRequest()
-
setRequest
public void setRequest(javax.servlet.http.HttpServletRequest request)
Create snapshot of Request.- Specified by:
setRequest
in interfacePage
- See Also:
Page.getRequest()
-
addProperty
public void addProperty(String name, String value)
Description copied from interface:Page
Manually add a property to page.- Specified by:
addProperty
in interfacePage
-
-