|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.barracudamvc.core.view.ViewCapabilities
This class defines the the cpabilities & preferences of the client view. Specifically, it provides the component with 4 useful pieces of information:
Note that it's up to the components to actually respond to this. Just because a client supports HTML 4.0 doesn't mean the component can't render in HTML 3.2 (although the component does have an implicit responsibility to be well behaved and send back meaningful content that will work in the clients configuration)
It should also be noted that the FormatType, ScriptingType, and ClientType classes are all defined hierarchically. This is particularly important because it allows components to support a given range of functionality...if a component supports HTML 4x and HTML 4.1 comes out, the component should still work just fine.
Note that we don't determine the various types from the source until they are actually requested (unless of course they are manually specified).
Field Summary | |
protected Locale |
clientLocale
|
protected ClientType |
clientType
|
protected FormatType |
formatType
|
protected javax.servlet.http.HttpServletRequest |
req
|
protected javax.servlet.http.HttpServletResponse |
resp
|
protected ScriptingType |
scriptingType
|
Constructor Summary | |
ViewCapabilities()
Create an empty ViewCapabilities object. |
|
ViewCapabilities(FormatType formatType,
ClientType clientType,
ScriptingType scriptingType,
Locale clientLocale)
This constructor allows you to manually specify the various types for a ViewCapabilities object. |
|
ViewCapabilities(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
This constructor creates a ViewCapabilities object from the servlet response and request objects. |
Method Summary | |
Locale |
getClientLocale()
Get the current target locale |
ClientType |
getClientType()
Get the current client type |
FormatType |
getFormatType()
Get the current format type |
ScriptingType |
getScriptingType()
Get the current scripting type |
void |
setClientLocale(Locale iclientLocale)
Manually specify a target locale |
void |
setClientType(ClientType iclientType)
Manually specify a client type |
void |
setFormatType(FormatType iformatType)
Manually specify a format type |
void |
setScriptingType(ScriptingType iscriptingType)
Manually specify a scripting type |
void |
setSource(javax.servlet.http.HttpServletRequest ireq,
javax.servlet.http.HttpServletResponse iresp)
This convenience method allows you to specify the servlet req/resp source objects (from which the types will be automagically determined) |
String |
toString()
get a string representation of the ViewCapabilities |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected javax.servlet.http.HttpServletRequest req
protected javax.servlet.http.HttpServletResponse resp
protected FormatType formatType
protected ScriptingType scriptingType
protected ClientType clientType
protected Locale clientLocale
Constructor Detail |
public ViewCapabilities()
public ViewCapabilities(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
req
- the servlet requestresp
- the servlet responsepublic ViewCapabilities(FormatType formatType, ClientType clientType, ScriptingType scriptingType, Locale clientLocale)
formatType
- the format type for the viewclientType
- the actual client view typescriptingType
- the scripting type supported by the viewclientLocale
- the target client localeMethod Detail |
public void setSource(javax.servlet.http.HttpServletRequest ireq, javax.servlet.http.HttpServletResponse iresp)
ireq
- the servlet requestiresp
- the servlet responsepublic void setFormatType(FormatType iformatType)
iformatType
- the format type for the viewpublic FormatType getFormatType()
public void setClientType(ClientType iclientType)
iclientType
- the actual client view typepublic ClientType getClientType()
public void setScriptingType(ScriptingType iscriptingType)
iscriptingType
- the scripting type supported by the viewpublic ScriptingType getScriptingType()
public void setClientLocale(Locale iclientLocale)
iclientLocale
- the target client localepublic Locale getClientLocale()
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |