- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface - 
Field Summary
Fields - 
Method Summary
Modifier and TypeMethodDescriptionstatic voidcanSetAppArtifact(ApplicationAssociate applicationAssociate, String artifactName) static voidcheckIdUniqueness(FacesContext context, UIComponent component, Set<String> componentIds) Utility method to validate ID uniqueness for the tree represented bycomponent.static booleanclassHasAnnotations(Class<?> clazz) static <T> Tcoalesce(T... objects) Returns the first non-nullobject of the argument list, ornullif there is no such element.static booleancomponentIsDisabled(UIComponent component) static booleancomponentIsDisabledOrReadonly(UIComponent component) static DocumentBuilderFactorystatic DocumentBuilderFactorystatic SAXParserFactorystatic SchemaFactorystatic TransformerFactorystatic Stringstatic intextractFirstNumericSegment(String clientId, char separatorChar) Extract first numeric segment from given client ID.static StringfileExtension(String filename) static StringgenerateCreatedBy(FacesContext facesContext) static ELAwareBeanManagergetCdiBeanManager(FacesContext facesContext) Get the CDI bean manager.static StringgetClientWindowId(FacesContext context) static StringgetContentTypeFromResponse(Object response) PRECONDITION: argumentresponseis non-null and has a method calledgetContentTypethat takes no arguments and returns a String, with no side-effects.static ClassLoaderIdentify and return the class loader that is associated with the calling web application.static ConvertergetConverterForClass(Class converterClass, FacesContext context) static ConvertergetConverterForIdentifer(String converterId, FacesContext context) static ClassLoadergetCurrentLoader(Object fallbackClass) static Doctypestatic StringgetFacesConfigXmlVersion(FacesContext facesContext) Get the faces-config.xml version (if any).static HttpServletMappinggetFacesMapping(FacesContext context) Returns the URL pattern of theFacesServletthat is executing the current request.static Optional<ServletRegistration> getFacesServletRegistration(FacesContext context) static HttpServletMappinggetFirstWildCardMappingToFacesServlet(ExternalContext externalContext) static longgetLastModified(URL url) static ObjectgetListenerInstance(ValueExpression type, ValueExpression binding) Factory method for creating the various Faces listener instances that may be referenced bytypeorbinding.static LocalegetLocaleFromContextOrSystem(FacesContext context) static LocalegetLocaleFromString(String localeStr) static StringgetNamingContainerPrefix(FacesContext context) If view root is instance of naming container, return its container client id, suffixed with separator character.static StringLeverage the Throwable.getStackTrace() method to produce a String version of the stack trace, with a "\n" before each line.static StateManagergetStateManager(FacesContext context) static ClassgetTypeFromString(String type) static ValueExpressiongetValueExpressionNullSafe(UIComponent component, String name) static ViewHandlergetViewHandler(FacesContext context) static StringgetViewStateId(FacesContext context) static StringgetWebXmlVersion(FacesContext facesContext) Get the web.xml version (if any).static Stringstatic intindexOfSet(String str, char[] set, int fromIndex) static booleanisAllEmpty(Object... values) Returns true if all values are empty, false if at least one value is not empty.static booleanstatic booleanisAnyEmpty(Object... values) Returnstrueif at least one value is empty.static booleanstatic booleanReturns true if the given string is null or is blank.static booleanReturnstrueif the given value is null or is empty.static booleanReturnstrueif the given array is null or is empty.static booleanReturns true if the given string is null or is empty.static booleanisEmpty(Collection<?> collection) Returnstrueif the given collection is null or is empty.static booleanisNestedInIterator(FacesContext context, UIComponent component) static <T> booleanisOneOf(T object, T... objects) Returnstrueif the given object equals one of the given objects.static booleanisPortletRequest(FacesContext context) Convenience method for determining if the request associated with the specifiedFacesContextis a PortletRequest submitted by the JSR-301 bridge.static booleanisPrefixMapped(String mapping) Returns true if the providedurl-mappingis a prefix path mapping (starts with/).static booleanisResourceExactMappedToFacesServlet(ExternalContext externalContext, String resource) Checks if the FacesServlet is exact mapped to the given resource.static booleanisSpecialAttributeName(String name) static booleanstatic booleanChecks if the FacesServlet is exact mapped to the given resource.static booleanisViewPopulated(FacesContext ctx, UIViewRoot viewToRender) static Classstatic Class<?> loadClass2(String name, Object fallbackClass) static <T> TnewInstance(Class<?> clazz) static voidnotNegative(String varname, long number) static voidstatic voidnotNullAttribute(String attributeName, Object attribute) static voidnotNullNamedObject(Object object, String objectId, String logMsg) static voidnotNullViewId(String viewId) static Stringstatic Stringstatic Stringstatic StringremoveLastPathSegment(String input) static <T> List<T> static voidstatic voidstatic voidsetUnitTestModeEnabled(boolean enabled) static voidsetViewPopulated(FacesContext ctx, UIViewRoot viewToRender) Flag the specifiedUIViewRootas populated.static String[]split(ServletContext sc, String toSplit, String regex) static String[]A slightly more efficient version ofString.split()which caches thePatterns in an LRUMap instead of creating a newPatternon each invocation.static String[]A slightly more efficient version ofString.split()which caches thePatterns in an LRUMap instead of creating a newPatternon each invocation.static booleanstartsWithOneOf(String string, String... prefixes) Returnstrueif the given string starts with one of the given prefixes.static <T> Stream<T> static <E> Set<E> unmodifiableSet(E... elements)  
- 
Field Details
- 
primitiveTypes
 
 - 
 - 
Method Details
- 
getFacesServletRegistration
 - 
isPortletRequest
Convenience method for determining if the request associated with the specified
FacesContextis a PortletRequest submitted by the JSR-301 bridge.- Parameters:
 context- theFacesContextassociated with the request.
 - 
generateCreatedBy
 - 
getListenerInstance
Factory method for creating the various Faces listener instances that may be referenced by
typeorbinding.If
bindingis notnulland the evaluation result is notnullreturn that instance. Otherwise try to instantiate an instances based ontype.- Parameters:
 type- theListenertypebinding- aValueExpressionwhich resolves to aListenerinstance- Returns:
 - a 
Listenerinstance based off the providedtypeandbinding 
 - 
setUnitTestModeEnabled
public static void setUnitTestModeEnabled(boolean enabled)  - 
isUnitTestModeEnabled
public static boolean isUnitTestModeEnabled() - 
createTransformerFactory
 - 
createSAXParserFactory
 - 
createDocumentBuilderFactory
 - 
createLocalDocumentBuilderFactory
 - 
createSchemaFactory
 - 
loadClass
- Throws:
 ClassNotFoundException
 - 
loadClass2
 - 
newInstance
 - 
getCurrentLoader
 - 
getContextClassLoader2
Identify and return the class loader that is associated with the calling web application.
- Throws:
 FacesException- if the web application class loader cannot be identified
 - 
removeAllButLastSlashPathSegment
 - 
fileExtension
 - 
removeAllButNextToLastSlashPathSegment
 - 
removeLastPathSegment
 - 
notNegative
 - 
notNull
 - 
notNullViewId
 - 
notNullNamedObject
 - 
canSetAppArtifact
public static void canSetAppArtifact(ApplicationAssociate applicationAssociate, String artifactName)  - 
notNullAttribute
 - 
getValueExpressionNullSafe
 - 
isEmpty
Returns true if the given string is null or is empty.- Parameters:
 string- The string to be checked on emptiness.- Returns:
 - True if the given string is null or is empty.
 
 - 
isBlank
Returns true if the given string is null or is blank.- Parameters:
 string- The string to be checked.- Returns:
 - True if the given string is null or is blank.
 
 - 
nullIfBlank
 - 
isEmpty
Returnstrueif the given array is null or is empty.- Parameters:
 array- The array to be checked on emptiness.- Returns:
 trueif the given array is null or is empty.
 - 
isEmpty
Returnstrueif the given collection is null or is empty.- Parameters:
 collection- The collection to be checked on emptiness.- Returns:
 trueif the given collection is null or is empty.
 - 
isEmpty
Returnstrueif the given value is null or is empty. Types of String, Collection, Map, Optional and Array are recognized. If none is recognized, then examine the emptiness of the toString() representation instead.- Parameters:
 value- The value to be checked on emptiness.- Returns:
 trueif the given value is null or is empty.
 - 
isAllEmpty
Returns true if all values are empty, false if at least one value is not empty.- Parameters:
 values- the values to be checked on emptiness- Returns:
 - True if all values are empty, false otherwise
 
 - 
isAnyEmpty
Returnstrueif at least one value is empty.- Parameters:
 values- the values to be checked on emptiness- Returns:
 trueif any value is empty andfalseif no values are empty
 - 
isAllNull
 - 
isAnyNull
 - 
isOneOf
Returnstrueif the given object equals one of the given objects.- Type Parameters:
 T- The generic object type.- Parameters:
 object- The object to be checked if it equals one of the given objects.objects- The argument list of objects to be tested for equality.- Returns:
 trueif the given object equals one of the given objects.
 - 
coalesce
Returns the first non-nullobject of the argument list, ornullif there is no such element.- Type Parameters:
 T- The generic object type.- Parameters:
 objects- The argument list of objects to be tested for non-null.- Returns:
 - The first non-
nullobject of the argument list, ornullif there is no such element. 
 - 
reverse
 - 
startsWithOneOf
Returnstrueif the given string starts with one of the given prefixes.- Parameters:
 string- The object to be checked if it starts with one of the given prefixes.prefixes- The argument list of prefixes to be checked- Returns:
 trueif the given string starts with one of the given prefixes.
 - 
getLocaleFromContextOrSystem
- Parameters:
 context- theFacesContextfor the current request- Returns:
 - the Locale from the UIViewRoot, the the value of Locale.getDefault()
 
 - 
getConverterForClass
 - 
getConverterForIdentifer
 - 
getStateManager
- Throws:
 FacesException
 - 
getTypeFromString
- Throws:
 ClassNotFoundException
 - 
getViewHandler
- Throws:
 FacesException
 - 
componentIsDisabled
 - 
componentIsDisabledOrReadonly
 - 
getLocaleFromString
- Throws:
 IllegalArgumentException
 - 
indexOfSet
- Parameters:
 str- local stringset- the substringfromIndex- starting index- Returns:
 - starting at 
fromIndex, the index of the first occurrence of any substring fromsetintoSearch, or -1 if no such match is found 
 - 
getStackTraceString
Leverage the Throwable.getStackTrace() method to produce a String version of the stack trace, with a "\n" before each line.
- Parameters:
 e- the Throwable to obtain the stacktrace from- Returns:
 - the String representation ofthe stack trace obtained by calling getStackTrace() on the passed in exception. If null is passed in, we return the empty String.
 
 - 
getContentTypeFromResponse
PRECONDITION: argument
responseis non-null and has a method calledgetContentTypethat takes no arguments and returns a String, with no side-effects.This method allows us to get the contentType in both the servlet and portlet cases, without introducing a compile-time dependency on the portlet api.
- Parameters:
 response- the current response- Returns:
 - the content type of the response
 
 - 
split
A slightly more efficient version of
String.split()which caches thePatterns in an LRUMap instead of creating a newPatternon each invocation.- Parameters:
 appMap- the Application MaptoSplit- the string to splitregex- the regex used for splitting- Returns:
 - the result of 
Pattern.spit(String, int) 
 - 
split
public static String[] split(Map<String, Object> appMap, String toSplit, String regex, int splitLimit) A slightly more efficient version of
String.split()which caches thePatterns in an LRUMap instead of creating a newPatternon each invocation. Limited by splitLimit.- Parameters:
 appMap- the Application MaptoSplit- the string to splitregex- the regex used for splittingsplitLimit- split result threshold- Returns:
 - the result of 
Pattern.spit(String, int) 
 - 
split
 - 
getFacesMapping
Returns the URL pattern of the
If no mapping can be determined, it most likely means that this particular request wasn't dispatched through theFacesServletthat is executing the current request. If there are multiple URL patterns, the value returned byHttpServletRequest.getServletPath()andHttpServletRequest.getPathInfo()is used to determine which mapping to return.FacesServlet.- Parameters:
 context- theFacesContextof the current request- Returns:
 - the URL pattern of the 
FacesServletornullif no mapping can be determined - Throws:
 NullPointerException- ifcontextis null
 - 
isViewIdExactMappedToFacesServlet
Checks if the FacesServlet is exact mapped to the given resource.Not to be confused with
isExactMapped(String), which checks if a string representing a mapping, not a resource, is an exact mapping.- Parameters:
 viewId- the view id to test- Returns:
 - true if the FacesServlet is exact mapped to the given viewId, false otherwise
 
 - 
isResourceExactMappedToFacesServlet
public static boolean isResourceExactMappedToFacesServlet(ExternalContext externalContext, String resource) Checks if the FacesServlet is exact mapped to the given resource.Not to be confused with
isExactMapped(String), which checks if a string representing a mapping, not a resource, is an exact mapping.- Parameters:
 externalContext- the external context for this requestresource- the resource to test- Returns:
 - true if the FacesServlet is exact mapped to the given resource, false otherwise
 
 - 
getFirstWildCardMappingToFacesServlet
public static HttpServletMapping getFirstWildCardMappingToFacesServlet(ExternalContext externalContext)  - 
isPrefixMapped
Returns true if the provided
url-mappingis a prefix path mapping (starts with/).- Parameters:
 mapping- aurl-pattern- Returns:
 - true if the mapping starts with 
/ 
 - 
isSpecialAttributeName
 - 
isViewPopulated
- Parameters:
 ctx- theFacesContextfor the current requestviewToRender- theUIViewRootto check- Returns:
 trueif theFacesContextattributes map contains a reference to theUIViewRoot's view ID
 - 
setViewPopulated
Flag the specified
UIViewRootas populated.- Parameters:
 ctx- theFacesContextfor the current requestviewToRender- theUIViewRootto mark as populated
 - 
checkIdUniqueness
public static void checkIdUniqueness(FacesContext context, UIComponent component, Set<String> componentIds) Utility method to validate ID uniqueness for the tree represented bycomponent. - 
classHasAnnotations
 - 
getNamingContainerPrefix
If view root is instance of naming container, return its container client id, suffixed with separator character.- Parameters:
 context- Involved faces context.- Returns:
 - The naming container prefix, or an empty string if the view root is not an instance of naming container.
 
 - 
getViewStateId
 - 
getClientWindowId
 - 
saveDOCTYPEToFacesContextAttributes
 - 
getDOCTYPEFromFacesContextAttributes
 - 
saveXMLDECLToFacesContextAttributes
 - 
getXMLDECLFromFacesContextAttributes
 - 
getLastModified
 - 
getFacesConfigXmlVersion
Get the faces-config.xml version (if any).- Parameters:
 facesContext- the Faces context.- Returns:
 - the version found, or "" if none found.
 
 - 
getWebXmlVersion
Get the web.xml version (if any).- Parameters:
 facesContext- the Faces context.- Returns:
 - the version found, or "" if none found.
 
 - 
getCdiBeanManager
Get the CDI bean manager.- Parameters:
 facesContext- the Faces context to consult- Returns:
 - the CDI bean manager.
 
 - 
stream
 - 
unmodifiableSet
 - 
isNestedInIterator
 - 
ensureLeadingSlash
 - 
extractFirstNumericSegment
Extract first numeric segment from given client ID.- 'table:1:button' should return 1
 - 'table:2' should return 2
 - '3:button' should return 3
 - '4' should return 4
 
- Parameters:
 clientId- the client IDseparatorChar- the separator character- Returns:
 - first numeric segment from given client ID.
 - Throws:
 NumberFormatException- when given client ID doesn't have any numeric segment at all.
 
 -