|
|||||||||
| Home >> All >> com >> sitemesh >> [ parser overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.sitemesh.parser
Class AbstractPage

java.lang.Objectcom.sitemesh.parser.AbstractPage
- All Implemented Interfaces:
- com.sitemesh.Page
- Direct Known Subclasses:
- AbstractHTMLPage, UnParsedPage
- public abstract class AbstractPage
- extends java.lang.Object
- implements com.sitemesh.Page
- extends java.lang.Object
Abstract implementation of com.sitemesh.Page .
Contains base methods for storing and accessing page properties.
Also stores pageData 55 as byte[] and implements write???()
methods.
Concrete implementations need only set the pageData 55 and
call addProperty(java.lang.String,java.lang.String) 55 to
add all the required information.
- Version:
- $Revision: 1.7 $
| Field Summary | |
protected byte[] |
pageData
Date of page contents. |
private java.util.Map |
properties
Map of all properties. |
javax.servlet.http.HttpServletRequest |
request
RequestURI of original Page. |
| Constructor Summary | |
AbstractPage()
|
|
| Method Summary | |
protected void |
addProperty(java.lang.String name,
java.lang.String value)
Add a property to the properties list. |
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. |
protected java.lang.String |
noNull(java.lang.String in)
Return String as is, or "" if null. |
void |
setRequest(javax.servlet.http.HttpServletRequest request)
Create snapshot of Request. |
boolean |
shouldCache()
Returns false. |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
properties
private java.util.Map properties
- Map of all properties.
Key is String. Value is java.util.List of multiple String values.
pageData
protected byte[] pageData
- Date of page contents.
request
public javax.servlet.http.HttpServletRequest request
- RequestURI of original Page.
| Constructor Detail |
AbstractPage
public AbstractPage()
| Method Detail |
writePage
public void writePage(java.io.OutputStream out) throws java.io.IOException
- Description copied from interface:
com.sitemesh.Page - Write the entire contents of the
Page, in the format before it was parsed, to theOutputStream.- Specified by:
writePagein interfacecom.sitemesh.Page
writePage
public void writePage(java.io.Writer out) throws java.io.IOException
- Description copied from interface:
com.sitemesh.Page - Write the entire contents of the
Page, in the format before it was parsed, to theWriter.- Specified by:
writePagein interfacecom.sitemesh.Page
getContentLength
public int getContentLength()
- Description copied from interface:
com.sitemesh.Page - Length of the
Page, in the format before it was parsed.- Specified by:
getContentLengthin interfacecom.sitemesh.Page
getProperty
public java.lang.String getProperty(java.lang.String name)
- Description copied from interface:
com.sitemesh.Page - Get a property embedded into the
Pageas aString.- Specified by:
getPropertyin interfacecom.sitemesh.Page
getIntProperty
public int getIntProperty(java.lang.String name)
- Description copied from interface:
com.sitemesh.Page - Get a property embedded into the
Pageas anint. Returns 0 if property not specified or not valid number.- Specified by:
getIntPropertyin interfacecom.sitemesh.Page
getLongProperty
public long getLongProperty(java.lang.String name)
- Description copied from interface:
com.sitemesh.Page - Get a property embedded into the
Pageas along. Returns 0L if property not specified or not valid number.- Specified by:
getLongPropertyin interfacecom.sitemesh.Page
getBooleanProperty
public boolean getBooleanProperty(java.lang.String name)
- Description copied from interface:
com.sitemesh.Page - Get a property embedded into the
Pageas aboolean. Returns true if value starts with '1', 't' or 'y' (case-insensitive) - otherwise returns false.- Specified by:
getBooleanPropertyin interfacecom.sitemesh.Page
getProperties
public java.lang.String[] getProperties(java.lang.String name)
- Description copied from interface:
com.sitemesh.Page - Get properties embedded into the
Pageas aString[]. Returns zero length array if no properties set.- Specified by:
getPropertiesin interfacecom.sitemesh.Page
isPropertySet
public boolean isPropertySet(java.lang.String name)
- Description copied from interface:
com.sitemesh.Page - Determine whether a property embedded into the
Pagehas been set.- Specified by:
isPropertySetin interfacecom.sitemesh.Page
getPropertySize
public int getPropertySize(java.lang.String name)
- Description copied from interface:
com.sitemesh.Page - Determine the number of properties embedded into the
Pagewith a given name.- Specified by:
getPropertySizein interfacecom.sitemesh.Page
getPropertyKeys
public java.lang.String[] getPropertyKeys()
- Description copied from interface:
com.sitemesh.Page - Get all available property keys for the
Page.- Specified by:
getPropertyKeysin interfacecom.sitemesh.Page
shouldCache
public boolean shouldCache()
- Returns false. Override as necessary.
- Specified by:
shouldCachein interfacecom.sitemesh.Page
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
- Description copied from interface:
com.sitemesh.Page - Return the request of the original page.
- Specified by:
getRequestin interfacecom.sitemesh.Page
setRequest
public void setRequest(javax.servlet.http.HttpServletRequest request)
- Create snapshot of Request.
- Specified by:
setRequestin interfacecom.sitemesh.Page
addProperty
protected void addProperty(java.lang.String name, java.lang.String value)
- Add a property to the properties list.
Duplicate keys are allowed... property will be given multiple values. Sub-classes should use this for adding properties to the page.
noNull
protected java.lang.String noNull(java.lang.String in)
- Return String as is, or "" if null. (Prevents NullPointerExceptions)
|
|||||||||
| Home >> All >> com >> sitemesh >> [ parser overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.sitemesh.parser.AbstractPage