-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendProperty(StringBuilder builder, String name, Object value) static voidappendProperty(StringBuilder builder, String name, Object value, boolean quoteValue) static voidappendQuotedValue(StringBuilder builder, String script) static StringcreateValidECMAIdentifier(String origIdentifier) Replaces all occurrences of-with$_.static StringdetermineContentType(String accept, String serverSupportedTypes, String preferredType) Given an accept String from the client, and aStringof server supported content types, determine the best qualified content type for the client.static RenderKitgetCurrentRenderKit(FacesContext context) Return theRenderKitfor the current request.static UIFormgetForm(UIComponent component, FacesContext context) Utility method to return the client ID of the parent form.static StringgetFormClientId(UIComponent component, FacesContext context) Utility method to return the client ID of the parent form.static StringgetImageSource(FacesContext context, UIComponent component, String attrName) Determine the path value of an image value for a component such as UIGraphic or UICommand.static StringgetParameterName(FacesContext context, String name) If view root is instance of naming container, prepend its container client id to namespace given parameter name.static ResponseStateManagergetResponseStateManager(FacesContext context, String renderKitId) Obtain and return theResponseStateManagerfor the specified #renderKitId.static SelectItemsIterator<SelectItem> getSelectItems(FacesContext context, UIComponent component) Return a List ofSelectIteminstances representing the available options for this component, assembled from the set ofUISelectItemand/orUISelectItemscomponents that are direct children of this component.static voidinstallFacesJsIfNecessary(FacesContext context) Only install the Faces script resource if it doesn't exist.static booleanisFacesJsInstalled(FacesContext context) static booleanisOutputHtml5Doctype(FacesContext context) Returnstrueif the view root associated with the given faces context will be rendered with a HTML5 doctype.static booleanisPartialOrBehaviorAction(FacesContext context, String clientId) static booleanstatic StringprefixAttribute(String attrName, boolean isXhtml) static StringprefixAttribute(String attrName, ResponseWriter writer) static voidrenderFacesJsIfNecessary(FacesContext context) Renders the Javascript necessary to add and remove request parameters to the current form.static voidrenderFunction(FacesContext context, UIComponent component, Collection<ClientBehaviorContext.Parameter> params, String submitTarget) static voidstatic voidrenderOnchange(FacesContext context, UIComponent component, boolean incExec) static voidrenderOnclick(FacesContext context, UIComponent component, Collection<ClientBehaviorContext.Parameter> params, String submitTarget, boolean needsSubmit) static voidrenderPassThruAttributes(FacesContext context, ResponseWriter writer, UIComponent component, Attribute[] attributes) Render any "passthru" attributes, where we simply just output the raw name and value of the attribute.static voidrenderPassThruAttributes(FacesContext context, ResponseWriter writer, UIComponent component, Attribute[] attributes, Map<String, List<ClientBehavior>> behaviors) Render any "passthru" attributes, where we simply just output the raw name and value of the attribute.static voidrenderSelectOnclick(FacesContext context, UIComponent component, boolean incExec) static voidstatic voidrenderXHTMLStyleBooleanAttributes(ResponseWriter writer, UIComponent component) Renders the attributes fromBOOLEAN_ATTRIBUTESusingXHMTLsemantics (i.e., disabled="disabled").static voidrenderXHTMLStyleBooleanAttributes(ResponseWriter writer, UIComponent component, List<String> excludedAttributes) Renders the attributes fromBOOLEAN_ATTRIBUTESusingXHMTLsemantics (i.e., disabled="disabled").
-
Field Details
-
LOGGER
-
DEVELOPMENT_STAGE_MESSAGES_ID
- See Also:
-
-
Method Details
-
getCurrentRenderKit
Return the
RenderKitfor the current request.- Parameters:
context- theFacesContextof the current request- Returns:
- the
RenderKitfor the current request.
-
getResponseStateManager
public static ResponseStateManager getResponseStateManager(FacesContext context, String renderKitId) throws FacesException Obtain and return the
ResponseStateManagerfor the specified #renderKitId.- Parameters:
context- theFacesContextof the current requestrenderKitId-RenderKitID- Returns:
- the
ResponseStateManagerfor the specified #renderKitId - Throws:
FacesException- if an exception occurs while trying to obtain theResponseStateManager
-
getSelectItems
public static SelectItemsIterator<SelectItem> getSelectItems(FacesContext context, UIComponent component) Return a List of
SelectIteminstances representing the available options for this component, assembled from the set ofUISelectItemand/orUISelectItemscomponents that are direct children of this component. If there are no such children, an emptyIteratoris returned.- Parameters:
context- TheFacesContextfor the current request. If null, the UISelectItems behavior will not work.component- the component- Returns:
- a List of the select items for the specified component
- Throws:
IllegalArgumentException- ifcontextisnull
-
renderPassThruAttributes
public static void renderPassThruAttributes(FacesContext context, ResponseWriter writer, UIComponent component, Attribute[] attributes) throws IOException Render any "passthru" attributes, where we simply just output the raw name and value of the attribute. This method is aware of the set of HTML4 attributes that fall into this bucket. Examples are all the javascript attributes, alt, rows, cols, etc.
- Parameters:
context- the FacesContext for this requestwriter- writer theResponseWriterto be used when writing the attributescomponent- the componentattributes- an array of attributes to be processed- Throws:
IOException- if an error occurs writing the attributes
-
renderPassThruAttributes
public static void renderPassThruAttributes(FacesContext context, ResponseWriter writer, UIComponent component, Attribute[] attributes, Map<String, List<ClientBehavior>> behaviors) throws IOExceptionRender any "passthru" attributes, where we simply just output the raw name and value of the attribute. This method is aware of the set of HTML4 attributes that fall into this bucket. Examples are all the javascript attributes, alt, rows, cols, etc.
- Parameters:
context- the FacesContext for this requestwriter- writer theResponseWriterto be used when writing the attributescomponent- the componentattributes- an array of attributes to be processedbehaviors- the behaviors for this component, or null if component is not a ClientBehaviorHolder- Throws:
IOException- if an error occurs writing the attributes
-
renderOnchange
public static void renderOnchange(FacesContext context, UIComponent component, boolean incExec) throws IOException - Throws:
IOException
-
renderSelectOnclick
public static void renderSelectOnclick(FacesContext context, UIComponent component, boolean incExec) throws IOException - Throws:
IOException
-
renderOnclick
public static void renderOnclick(FacesContext context, UIComponent component, Collection<ClientBehaviorContext.Parameter> params, String submitTarget, boolean needsSubmit) throws IOException - Throws:
IOException
-
renderFunction
public static void renderFunction(FacesContext context, UIComponent component, Collection<ClientBehaviorContext.Parameter> params, String submitTarget) throws IOException - Throws:
IOException
-
prefixAttribute
-
prefixAttribute
-
renderXHTMLStyleBooleanAttributes
public static void renderXHTMLStyleBooleanAttributes(ResponseWriter writer, UIComponent component) throws IOException Renders the attributes from
BOOLEAN_ATTRIBUTESusingXHMTLsemantics (i.e., disabled="disabled").- Parameters:
writer- writer theResponseWriterto be used when writing the attributescomponent- the component- Throws:
IOException- if an error occurs writing the attributes
-
renderXHTMLStyleBooleanAttributes
public static void renderXHTMLStyleBooleanAttributes(ResponseWriter writer, UIComponent component, List<String> excludedAttributes) throws IOException Renders the attributes from
BOOLEAN_ATTRIBUTESusingXHMTLsemantics (i.e., disabled="disabled").- Parameters:
writer- writer theResponseWriterto be used when writing the attributescomponent- the componentexcludedAttributes- aListof attributes that are to be excluded from rendering- Throws:
IOException- if an error occurs writing the attributes
-
determineContentType
public static String determineContentType(String accept, String serverSupportedTypes, String preferredType) Given an accept String from the client, and a
Stringof server supported content types, determine the best qualified content type for the client. If no match is found, or either of the arguments arenull,nullis returned.- Parameters:
accept- The client accept StringserverSupportedTypes- The types that the server supportspreferredType- The preferred content type if another type is found with the same highest quality factor.- Returns:
- The content type
String
-
isXml
- Parameters:
contentType- the content type in question- Returns:
trueif the content type is a known XML-based content type, otherwise,false
-
createValidECMAIdentifier
-
installFacesJsIfNecessary
Only install the Faces script resource if it doesn't exist. The resource component will be installed with the target "head".
- Parameters:
context- theFacesContextfor the current request
-
renderFacesJsIfNecessary
Renders the Javascript necessary to add and remove request parameters to the current form.
- Parameters:
context- theFacesContextfor the current request- Throws:
IOException- if an error occurs writing to the response
-
isFacesJsInstalled
-
renderUnhandledMessages
-
renderHtmlErrorPage
-
isPartialOrBehaviorAction
-
getFormClientId
Utility method to return the client ID of the parent form.
- Parameters:
component- typically a command componentcontext- theFacesContextfor the current request- Returns:
- the client ID of the parent form, if any
-
getForm
Utility method to return the client ID of the parent form.
- Parameters:
component- typically a command componentcontext- theFacesContextfor the current request- Returns:
- the parent form, if any
-
getImageSource
Determine the path value of an image value for a component such as UIGraphic or UICommand.
- Parameters:
context- theFacesContextfor the current request.component- the component to obtain the image information fromattrName- the attribute name that needs to be queried if the name and library attributes are not specified- Returns:
- the encoded path to the image source
-
getParameterName
If view root is instance of naming container, prepend its container client id to namespace given parameter name.- Parameters:
context- Involved faces context.name- Request parameter name.- Returns:
- The request parameter name, if necessary namespaced.
-
isOutputHtml5Doctype
Returnstrueif the view root associated with the given faces context will be rendered with a HTML5 doctype.- Parameters:
context- Involved faces context.- Returns:
trueif the view root associated with the given faces context will be rendered with a HTML5 doctype.
-
appendProperty
-
appendProperty
public static void appendProperty(StringBuilder builder, String name, Object value, boolean quoteValue) -
appendQuotedValue
-