A set of utilities for use in RenderKits.
| Modifier and Type | Class and Description |
|---|---|
| private static enum | |
| public static enum |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | ATTRIBUTES_THAT_ARE_SET_KEY
Implementation Note This must be kept in sync with the Key in UIComponentBase$AttributesMap and HtmlComponentGenerator. |
| private static final String[] | BOOLEAN_ATTRIBUTES
|
| private static final String | CONTENT_TYPE_DELIMITER
The character that is used to delimit content types in an accept String. |
| private static final String | CONTENT_TYPE_SUBTYPE_DELIMITER
The character that is used to delimit the type and subtype portions of a content type in an accept String. |
| protected static final Logger | |
| private static final int | MAX_CONTENT_TYPE_PARTS
The maximum number of content type parts. |
| private static final String | OPTIMIZED_PACKAGE
This represents the base package that can leverage the
|
| private static final String | XHTML_ATTR_PREFIX
The prefix to append to certain attributes when renderking
|
| private static final String[] | XHTML_PREFIX_ATTRIBUTES
An array of attributes that must be prefixed by
|
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | appendBehaviorsToChain(StringBuilder builder, FacesContext context, UIComponent component, List<ClientBehavior> behaviors, String behaviorEventName, Collection<ClientBehaviorContext.
|
| public static void | |
| public static void | |
| public static void | |
| private static void | |
| private static String[][] | Returns: an two dimensional array containing content-type/quality infoAn accept accept)StringThis method builds a two element array structure as follows: Example: Given the following accept string: text/html; level=1, text/plain; q=0.5 [0][0] 1 (quality is 1 if none specified) [0][1] "text" (type) [0][2] "html; level=1" (subtype) [0][3] 1 (level, if specified; null if not) [1][0] .5 [1][1] "text" [1][2] "plain" [1][3] (level, if specified; null if not) The array is used for comparison purposes in the findMatch method. |
| private static boolean | Returns: true if the component is within the
javax.faces.component or javax.faces.component.html
packages, otherwise return falsethe UIComponent in question component, Map<String, List<ClientBehavior>> behaviors)
|
| private static ClientBehaviorContext | createClientBehaviorContext(FacesContext context, UIComponent component, String behaviorEventName, Collection<ClientBehaviorContext.
|
| private static UIComponent | |
| public static String | Returns: an ECMA valid identiferthe original identifer that needs to be
'ECMA-ized' origIdentifier)Replaces all occurrences of |
| public static String | Returns: The content typeStringThe client accept String accept, String The types that the server supports serverSupportedTypes, String The preferred content type if another type is found
with the same highest quality factor. preferredType)Given an accept String from the client, and a |
| private static String[][] | Returns: Anarray containing the parts of the preferred content type for the
client. The information is stored as outlined in @{link #buildTypeArrayFromString}.An clientContentTypes, String[][] array of accept String
information for the client built from @{link #buildTypeArrayFromString}.An serverSupportedContentTypes, String[][] array of accept String
information for the server supported types built from @{link #buildTypeArrayFromString}.An preferredContentType)array of preferred content type information.For each server supported type, compare client (browser) specified types. |
| private static String | getChainedHandler(FacesContext context, UIComponent component, List<ClientBehavior> behaviors, Collection<ClientBehaviorContext.
|
| private static List | |
| public static RenderKit | Returns: theRenderKit for the current request.the context)FacesContext of the current requestReturn the |
| public static UIForm | Returns: the parent form, if anytypically a command component component, FacesContext the context)FacesContext for the current requestUtility method to return the client ID of the parent form. |
| public static String | Returns: the client ID of the parent form, if anytypically a command component component, FacesContext the context)FacesContext for the current requestUtility method to return the client ID of the parent form. |
| private static RenderKitUtils. | getHandlerType(List<ClientBehavior> behaviors, Collection<ClientBehaviorContext.
|
| public static String | Returns: the encoded path to the image sourcethe context, UIComponent FacesContext for the current request.the component to obtain the image information from component, String the attribute name that needs to be queried if the
name and library attributes are not specified attrName)Determine the path value of an image value for a component such as UIGraphic or UICommand. |
| private static String | |
| public static String | Returns: The request parameter name, if necessary namespaced.Involved faces context. context, String Request parameter name. name)If view root is instance of naming container, prepend its container client id to namespace given parameter name. |
| public static ResponseStateManager | Returns: theResponseStateManager for the specified
#renderKitIdthe context, String FacesContext of the current requestRenderKit IDObtain and return the |
| public static SelectItemsIterator | Returns: a List of the select items for the specified componentThe context, UIComponent javax.faces.context.FacesContext for the current request.
If null, the UISelectItems behavior will not work.the component component)Return a List of |
| private static String | |
| private static String | getSingleBehaviorHandler(FacesContext context, UIComponent component, ClientBehavior behavior, Collection<ClientBehaviorContext.
|
| private static String | getSubmitHandler(FacesContext context, UIComponent component, Collection<ClientBehaviorContext.
|
| public static void | installJsfJsIfNecessary(FacesContext
the context)FacesContext for the current requestOnly install the JSF script resource if it doesn't exist. |
| private static boolean | |
| private static boolean | Returns: true if the attribute name is not in the exclude list.the attribute name that is to be tested for exclusion attributeName, List<String> the list of attribute names that are to be excluded from rendering excludedAttributes)This method expects a |
| public static boolean | |
| public static boolean | |
| private static boolean | |
| public static boolean | |
| private static void | |
| public static String | |
| public static String | |
| public static void | renderFunction(FacesContext context, UIComponent component, Collection<ClientBehaviorContext.
|
| private static void | renderHandler(FacesContext
the FacesContext for this request. context, UIComponent the UIComponent that we are rendering component, Collection<ClientBehaviorContext.any parameters that should be included by "submitting"
scripts. params,the name of the handler attribute to render (eg.
"onclick" or "ommouseover") handlerName, Object the user-specified value for the handler attribute handlerValue, String the name of the behavior event that corresponds
to this handler (eg. "action" or "mouseover"). behaviorEventName, String submitTarget, boolean indicates whether the mojarra.jsfcljs()
"submit" script is required by the component. Most components
do not need this, either because they submit themselves
(eg. commandButton), or because they do not perform submits
(eg. non-command components). This flag is mainly here for
the commandLink case, where we need to render the submit
script to make the link submit. needsSubmit, boolean includeExec)Renders a handler script, which may require chaining together the user-specified event handler, any scripts required by attached Behaviors, and also possibly the mojarra.jsfcljs() "submit" script. |
| public static void | |
| public static void | renderJsfJsIfNecessary(FacesContext
the context)FacesContext for the current requestRenders the Javascript necessary to add and remove request parameters to the current form. |
| public static void | |
| public static void | renderOnclick(FacesContext context, UIComponent component, Collection<ClientBehaviorContext.
|
| public static void | renderPassThruAttributes(FacesContext
the FacesContext for this request context, ResponseWriter writer the writer, UIComponent javax.faces.context.ResponseWriter to be used when writing
the attributesthe component component, Attribute[] an array of attributes to be processed attributes)Render any "passthru" attributes, where we simply just output the raw name and value of the attribute. |
| public static void | renderPassThruAttributes(FacesContext
the FacesContext for this request context, ResponseWriter writer the writer, UIComponent javax.faces.context.ResponseWriter to be used when writing
the attributesthe component component, Attribute[] an array of attributes to be processed attributes, Map<String, List<ClientBehavior>> the behaviors for this component, or null if
component is not a ClientBehaviorHolder behaviors)Render any "passthru" attributes, where we simply just output the raw name and value of the attribute. |
| private static void | renderPassThruAttributesOptimized(FacesContext
the context, ResponseWriter FacesContext of the current requestthe current writer writer, UIComponent the component whose attributes we're rendering component, Attribute[] an array of pass-through attributes supported by
this component knownAttributes, List<String> a setAttributes, Map<String, List<ClientBehavior>> List of attributes that have been set
on the provided componentthe non-null behaviors map for this request. behaviors)For each attribute in |
| private static void | renderPassThruAttributesUnoptimized(FacesContext
the context, ResponseWriter FacesContext of the current requestthe current writer writer, UIComponent the component whose attributes we're rendering component, Attribute[] an array of pass-through attributes supported by
this component knownAttributes, Map<String, List<ClientBehavior>> the non-null behaviors map for this request. behaviors)Loops over all known attributes and attempts to render each one. |
| public static void | |
| public static void | |
| public static void | renderXHTMLStyleBooleanAttributes(ResponseWriter
writer the writer, UIComponent ResponseWriter to be used when writing
the attributesthe component component)Renders the attributes from |
| public static void | renderXHTMLStyleBooleanAttributes(ResponseWriter
writer the writer, UIComponent ResponseWriter to be used when writing
the attributesthe component component, List<String> a excludedAttributes)List of attributes that are to be excluded from renderingRenders the attributes from |
| private static boolean | Returns: true if and only if #attributeVal is
an instance of a wrapper for a primitive type and its value is
equal to the default value for that type as given in the specification.the attribute value attributeVal)Determines if an attribute should be rendered based on the specified #attributeVal. |