|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.barracuda.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 java.util.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,
java.util.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 | |
java.util.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(java.util.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) |
java.lang.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 java.util.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, java.util.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)
public void setFormatType(FormatType iformatType)
public FormatType getFormatType()
public void setClientType(ClientType iclientType)
public ClientType getClientType()
public void setScriptingType(ScriptingType iscriptingType)
public ScriptingType getScriptingType()
public void setClientLocale(java.util.Locale iclientLocale)
public java.util.Locale getClientLocale()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |