public final class Platform extends Object
Note that this utility class can only be used in a JSF environment and is thus not a Java EE general way to obtain platform services.
Modifier and Type | Method and Description |
---|---|
static Validator |
getBeanValidator()
Deprecated.
Since 3.8. Bean Validation utilities are migrated to
Validators .
Use Validators.getBeanValidator() instead. |
static ValidatorFactory |
getBeanValidatorFactory()
Deprecated.
Since 3.8. Bean Validation utilities are migrated to
Validators .
Use Validators.getBeanValidatorFactory() instead. |
static String |
getDefaultFacesServletMapping(ServletContext servletContext)
Determines and returns the default faces servlet mapping.
|
static Collection<String> |
getFacesServletMappings(ServletContext servletContext)
Returns the mappings associated with the
FacesServlet . |
static ServletRegistration |
getFacesServletRegistration(ServletContext servletContext)
Returns the
ServletRegistration associated with the FacesServlet . |
static boolean |
isBeanValidationAvailable()
Deprecated.
Since 3.8. Bean Validation utilities are migrated to
Validators .
Use Validators.isBeanValidationAvailable() instead. |
static Map<String,String> |
validateBean(Object bean,
Class<?>... groups)
Deprecated.
Since 3.8. This method should have returned actual constraint violations instead of abstracting them.
Use
Validators.validateBean(Object, Class...) instead. |
static Map<String,String> |
validateBeanProperty(Class<?> beanType,
String propertyName,
Object value,
Class<?>... groups)
Deprecated.
Since 3.8. This method should have returned actual constraint violations instead of abstracting them.
Use
Validators.validateBeanProperty(Class, String, Object, Class...) instead. |
@Deprecated public static boolean isBeanValidationAvailable()
Validators
.
Use Validators.isBeanValidationAvailable()
instead.true
if Bean Validation is available. This is remembered in the application scope.true
if Bean Validation is available.@Deprecated public static ValidatorFactory getBeanValidatorFactory()
Validators
.
Use Validators.getBeanValidatorFactory()
instead.@Deprecated public static Validator getBeanValidator()
Validators
.
Use Validators.getBeanValidator()
instead.Faces.getLocale()
@Deprecated public static Map<String,String> validateBean(Object bean, Class<?>... groups)
Validators.validateBean(Object, Class...)
instead.bean
- Bean to be validated.groups
- Bean validation groups, if any.@Deprecated public static Map<String,String> validateBeanProperty(Class<?> beanType, String propertyName, Object value, Class<?>... groups)
Validators.validateBeanProperty(Class, String, Object, Class...)
instead.beanType
- Type of target bean.propertyName
- Name of property on target bean.value
- Value to be validated.groups
- Bean validation groups, if any.public static ServletRegistration getFacesServletRegistration(ServletContext servletContext)
ServletRegistration
associated with the FacesServlet
.servletContext
- The context to get the ServletRegistration from.null
if the FacesServlet is not installed.public static Collection<String> getFacesServletMappings(ServletContext servletContext)
FacesServlet
.servletContext
- The context to get the FacesServlet
from.FacesServlet
, or an empty set.public static String getDefaultFacesServletMapping(ServletContext servletContext)
getFacesServletMappings(ServletContext)
and pick the first one starting with *.
or ending with /*
. If JSF is prefix mapped (e.g.
/faces/*
), then this returns the whole path, with a leading slash (e.g. /faces
). If JSF
is suffix mapped (e.g. *.xhtml
), then this returns the whole extension (e.g. .xhtml
). If
none is found, then this falls back to .xhtml
. This is for the first time determined in
ApplicationInitializer
and cached in the ServletContext
.Copyright © 2012–2022 OmniFaces. All rights reserved.