|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 PageParser
implementations.
Typically a Page is no use to a Decorator
as it needs
specific details relevant to the content-type of that page (e.g. HTML
pages). The appropriate PageParser
is responsible
for returning extended implementations of pages such as 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 Summary | |
boolean |
getBooleanProperty(java.lang.String name)
Get a property embedded into the Page as a boolean . |
int |
getContentLength()
Length of the Page , in the format before
it was parsed. |
int |
getIntProperty(java.lang.String name)
Get a property embedded into the Page as an int . |
long |
getLongProperty(java.lang.String name)
Get a property embedded into the Page as a long . |
java.lang.String[] |
getProperties(java.lang.String name)
Get properties embedded into the Page as a String[] . |
java.lang.String |
getProperty(java.lang.String name)
Get a property embedded into the Page as a String . |
java.lang.String[] |
getPropertyKeys()
Get all available property keys for the Page . |
int |
getPropertySize(java.lang.String name)
Determine the number of properties embedded into the Page with
a given name. |
javax.servlet.http.HttpServletRequest |
getRequest()
Return the request of the original page. |
boolean |
isPropertySet(java.lang.String name)
Determine whether a property embedded into the Page has been set. |
void |
setRequest(javax.servlet.http.HttpServletRequest request)
Create snapshot of Request. |
boolean |
shouldCache()
Determine whether this Page can be cached or not. |
void |
writePage(java.io.OutputStream out)
Write the entire contents of the Page , in the format before
it was parsed, to the OutputStream . |
void |
writePage(java.io.Writer out)
Write the entire contents of the Page , in the format before
it was parsed, to the Writer . |
Method Detail |
public void writePage(java.io.OutputStream out) throws java.io.IOException
Page
, in the format before
it was parsed, to the OutputStream
.out
- OutputStream to write to.writePage(java.io.Writer)
public void writePage(java.io.Writer out) throws java.io.IOException
Page
, in the format before
it was parsed, to the Writer
.out
- Writer to write to.writePage(java.io.OutputStream)
public int getContentLength()
Page
, in the format before
it was parsed.public java.lang.String getProperty(java.lang.String name)
Page
as a String
.name
- Name of propertypublic int getIntProperty(java.lang.String name)
Page
as an int
.
Returns 0 if property not specified or not valid number.name
- Name of propertypublic long getLongProperty(java.lang.String name)
Page
as a long
.
Returns 0L if property not specified or not valid number.name
- Name of propertypublic boolean getBooleanProperty(java.lang.String name)
Page
as a boolean
.
Returns true if value starts with '1', 't' or 'y' (case-insensitive) -
otherwise returns false.name
- Name of propertypublic java.lang.String[] getProperties(java.lang.String name)
Page
as a String[]
.
Returns zero length array if no properties set.name
- Name of propertypublic boolean isPropertySet(java.lang.String name)
Page
has been set.name
- Name of propertypublic int getPropertySize(java.lang.String name)
Page
with
a given name.name
- Name of propertypublic java.lang.String[] getPropertyKeys()
Page
.public boolean shouldCache()
Page
can be cached or not. If allowed to
be cached for a specified period of time, true
should be initially
returned, and repeated calls to this method will determine whether the page
is still allowed to remain cached.public javax.servlet.http.HttpServletRequest getRequest()
public void setRequest(javax.servlet.http.HttpServletRequest request)
getRequest()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |