Top Inners Fields Constructors Methods
com.sun.faces.application.applicationimpl

public Class InstanceFactory

extends Object
Class Inheritance
Static Imports
com.sun.faces.application.ApplicationImpl.THIS_LIBRARY, com.sun.faces.config.WebConfiguration.BooleanWebContextInitParameter.DateTimeConverterUsesSystemTimezone, .WebConfiguration.BooleanWebContextInitParameter.RegisterConverterPropertyEditors, com.sun.faces.util.Util.isEmpty, .Util.loadClass, .Util.notNull, .Util.notNullNamedObject, jakarta.faces.application.Resource.COMPONENT_RESOURCE_KEY, jakarta.faces.component.UIComponent.ATTRS_WITH_DECLARED_DEFAULT_VALUES, .UIComponent.BEANINFO_KEY, .UIComponent.COMPOSITE_COMPONENT_TYPE_KEY, java.beans.PropertyEditorManager.findEditor, java.text.MessageFormat.format, java.util.Collections.unmodifiableMap, java.util.logging.Level.FINE, .Level.SEVERE, .Level.WARNING

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final ApplicationAssociate
private BeanManager
beanManager

Stores the bean manager.

private final ViewMemberInstanceFactoryMetadataMap<String, Object>
private static final String
private static final String
private static final String
private final ViewMemberInstanceFactoryMetadataMap<String, Object>
private static final String
private final ViewMemberInstanceFactoryMetadataMap<String, Object>
private final Map<Class<?>, Object>
private final Set<String>
private volatile Map<String, String>
private static final Logger
private final boolean
private final boolean
private final String[]
private static final Map<String, Class<?>[]>
private static final Map<Class<?>, String>
private TimeZone
private final ViewMemberInstanceFactoryMetadataMap<String, Object>

Constructor Summary

AccessConstructor and Description
public
InstanceFactory(ApplicationAssociate applicationAssociate)

Method Summary

Modifier and TypeMethod and Description
public void
addBehavior(String behaviorId, String behaviorClass)

public void
addComponent(String componentType, String componentClass)

public void
addConverter(String converterId, String converterClass)

public void
addConverter(Class<?> targetClass, String converterClass)

public synchronized void
private void
addPropertyEditorIfNecessary(Class<?>
the target class for which a PropertyEditory may or may not be created
targetClass
)

To enable EL Coercion to use Faces Custom converters, this method will call PropertyEditorManager.registerEditor(), passing the ConverterPropertyEditor class for the targetClass if the target class is not one of the standard by-type converter target classes.

public void
addValidator(String validatorId, String validatorClass)

private void
applyAnnotations(FacesContext ctx, String rendererType, UIComponent c)

Process any annotations associated with this component/renderer.

public Behavior
createBehavior(String behaviorId)

private Behavior
private Converter<?>
private Validator<?>
public UIComponent
createComponent(ValueExpression componentExpression, FacesContext context, String componentType)

public UIComponent
createComponent(String componentType)

public UIComponent
createComponent(FacesContext context, Resource componentResource, ExpressionFactory expressionFactory)

public UIComponent
createComponent(FacesContext context, String componentType, String rendererType)

public UIComponent
createComponent(ValueExpression componentExpression, FacesContext context, String componentType, String rendererType)

private UIComponent
private UIComponent
createComponentApplyAnnotations(FacesContext ctx, String componentType, String rendererType, boolean applyAnnotations)

Leveraged by Application#createComponent(String) and Application#createComponent(jakarta.faces.context.FacesContext, String, String) This method will apply any component and render annotations that may be present.

private UIComponent
createComponentFromScriptResource(FacesContext context, Resource scriptComponentResource, Resource componentResource)

public Converter<?>
createConverter(String converterId)

public Converter<T>
createConverter(Class<?> targetClass)

private Converter<T>
createConverterBasedOnClass(Class<?> targetClass, Class<?> baseClass)

public Validator<?>
createValidator(String validatorId)

private BeanManager

Returns:

the bean manager.
getBeanManager
()

Get the bean manager.

public Iterator<String>
public Iterator<String>
public Iterator<String>
public Iterator<Class<?>>
public Map<String, String>
public Iterator<String>
protected Object

Returns:

The new object instance.
newConverter
(Class<?>
Used to look up the value in the Map.
key
,
Map<Class<?>, Object>
The Map that will be searched.
map
,
Class<?>
the target class for the single argument ctor
targetClass
)

The same as newThing except that a single argument constructor that accepts a Class is looked for before calling the no-arg version.

private <T> T

Returns:

The new object instance.
newThing
(String
Used to look up the value in the Map.
key
,
ViewMemberInstanceFactoryMetadataMap<String, Object>
The Map that will be searched.
map
)

PRECONDITIONS: the values in the Map are either Strings representing fully qualified java class names, or java.lang.Class instances.

private void
pushDeclaredDefaultValuesToAttributesMap(FacesContext context, BeanInfo componentMetadata, Map<String, Object> attrs, UIComponent component, ExpressionFactory expressionFactory)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

associateback to summary
private final ApplicationAssociate associate
beanManagerback to summary
private BeanManager beanManager

Stores the bean manager.

behaviorMapback to summary
private final ViewMemberInstanceFactoryMetadataMap<String, Object> behaviorMap
COMPONENT_CLASSback to summary
private static final String COMPONENT_CLASS
COMPONENT_EXPRESSIONback to summary
private static final String COMPONENT_EXPRESSION
COMPONENT_TYPEback to summary
private static final String COMPONENT_TYPE
componentMapback to summary
private final ViewMemberInstanceFactoryMetadataMap<String, Object> componentMap
CONTEXTback to summary
private static final String CONTEXT
converterIdMapback to summary
private final ViewMemberInstanceFactoryMetadataMap<String, Object> converterIdMap
converterTypeMapback to summary
private final Map<Class<?>, Object> converterTypeMap
defaultValidatorIdsback to summary
private final Set<String> defaultValidatorIds
defaultValidatorInfoback to summary
private volatile Map<String, String> defaultValidatorInfo
LOGGERback to summary
private static final Logger LOGGER
passDefaultTimeZoneback to summary
private final boolean passDefaultTimeZone
registerPropertyEditorsback to summary
private final boolean registerPropertyEditors
STANDARD_BY_TYPE_CONVERTER_CLASSESback to summary
private final String[] STANDARD_BY_TYPE_CONVERTER_CLASSES
STANDARD_CONV_ID_TO_TYPE_MAPback to summary
private static final Map<String, Class<?>[]> STANDARD_CONV_ID_TO_TYPE_MAP
STANDARD_TYPE_TO_CONV_ID_MAPback to summary
private static final Map<Class<?>, String> STANDARD_TYPE_TO_CONV_ID_MAP
systemTimeZoneback to summary
private TimeZone systemTimeZone
validatorMapback to summary
private final ViewMemberInstanceFactoryMetadataMap<String, Object> validatorMap

Constructor Detail

InstanceFactoryback to summary
public InstanceFactory(ApplicationAssociate applicationAssociate)

Method Detail

addBehaviorback to summary
public void addBehavior(String behaviorId, String behaviorClass)
addComponentback to summary
public void addComponent(String componentType, String componentClass)
addConverterback to summary
public void addConverter(String converterId, String converterClass)
addConverterback to summary
public void addConverter(Class<?> targetClass, String converterClass)
addDefaultValidatorIdback to summary
public synchronized void addDefaultValidatorId(String validatorId)
addPropertyEditorIfNecessaryback to summary
private void addPropertyEditorIfNecessary(Class<?> targetClass)

To enable EL Coercion to use Faces Custom converters, this method will call PropertyEditorManager.registerEditor(), passing the ConverterPropertyEditor class for the targetClass if the target class is not one of the standard by-type converter target classes.

Parameters
targetClass:Class<?>

the target class for which a PropertyEditory may or may not be created

addValidatorback to summary
public void addValidator(String validatorId, String validatorClass)
applyAnnotationsback to summary
private void applyAnnotations(FacesContext ctx, String rendererType, UIComponent c)

Process any annotations associated with this component/renderer.

createBehaviorback to summary
public Behavior createBehavior(String behaviorId) throws FacesException
createCDIBehaviorback to summary
private Behavior createCDIBehavior(String behaviorId)
createCDIConverterback to summary
private Converter<?> createCDIConverter(String converterId)
createCDIValidatorback to summary
private Validator<?> createCDIValidator(String validatorId)
createComponentback to summary
public UIComponent createComponent(ValueExpression componentExpression, FacesContext context, String componentType) throws FacesException
createComponentback to summary
public UIComponent createComponent(String componentType) throws FacesException
createComponentback to summary
public UIComponent createComponent(FacesContext context, Resource componentResource, ExpressionFactory expressionFactory) throws FacesException
createComponentback to summary
public UIComponent createComponent(FacesContext context, String componentType, String rendererType)
createComponentback to summary
public UIComponent createComponent(ValueExpression componentExpression, FacesContext context, String componentType, String rendererType)
createComponentApplyAnnotationsback to summary
private UIComponent createComponentApplyAnnotations(FacesContext ctx, ValueExpression componentExpression, String componentType, String rendererType, boolean applyAnnotations)

Leveraged by Application#createComponent(jakarta.el.ValueExpression, jakarta.faces.context.FacesContext, String) and Application#createComponent(jakarta.el.ValueExpression, jakarta.faces.context.FacesContext, String, String). This method will apply any component and render annotations that may be present.

createComponentApplyAnnotationsback to summary
private UIComponent createComponentApplyAnnotations(FacesContext ctx, String componentType, String rendererType, boolean applyAnnotations)

Leveraged by Application#createComponent(String) and Application#createComponent(jakarta.faces.context.FacesContext, String, String) This method will apply any component and render annotations that may be present.

createComponentFromScriptResourceback to summary
private UIComponent createComponentFromScriptResource(FacesContext context, Resource scriptComponentResource, Resource componentResource)
createConverterback to summary
public Converter<?> createConverter(String converterId)
createConverterback to summary
public Converter<T> createConverter(Class<?> targetClass)
createConverterBasedOnClassback to summary
private Converter<T> createConverterBasedOnClass(Class<?> targetClass, Class<?> baseClass)
createValidatorback to summary
public Validator<?> createValidator(String validatorId) throws FacesException
getBeanManagerback to summary
private BeanManager getBeanManager()

Get the bean manager.

Returns:BeanManager

the bean manager.

getBehaviorIdsback to summary
public Iterator<String> getBehaviorIds()
getComponentTypesback to summary
public Iterator<String> getComponentTypes()
getConverterIdsback to summary
public Iterator<String> getConverterIds()
getConverterTypesback to summary
public Iterator<Class<?>> getConverterTypes()
getDefaultValidatorInfoback to summary
public Map<String, String> getDefaultValidatorInfo()
getValidatorIdsback to summary
public Iterator<String> getValidatorIds()
newConverterback to summary
protected Object newConverter(Class<?> key, Map<Class<?>, Object> map, Class<?> targetClass)

The same as newThing except that a single argument constructor that accepts a Class is looked for before calling the no-arg version.

PRECONDITIONS: the values in the Map are either Strings representing fully qualified java class names, or java.lang.Class instances.

ALGORITHM: Look in the argument map for a value for the argument key. If found, if the value is instanceof String, assume the String specifies a fully qualified java class name and obtain the java.lang.Class instance for that String using Util.loadClass(). Replace the String instance in the argument map with the Class instance. If the value is instanceof Class, proceed. Assert that the value is either instanceof java.lang.Class or java.lang.String.

Now that you have a java.lang.class, call its newInstance and return it as the result of this method.

Parameters
key:Class<?>

Used to look up the value in the Map.

map:Map<Class<?>, Object>

The Map that will be searched.

targetClass:Class<?>

the target class for the single argument ctor

Returns:Object

The new object instance.

newThingback to summary
private <T> T newThing(String key, ViewMemberInstanceFactoryMetadataMap<String, Object> map)

PRECONDITIONS: the values in the Map are either Strings representing fully qualified java class names, or java.lang.Class instances.

ALGORITHM: Look in the argument map for a value for the argument key. If found, if the value is instanceof String, assume the String specifies a fully qualified java class name and obtain the java.lang.Class instance for that String using Util.loadClass(). Replace the String instance in the argument map with the Class instance. If the value is instanceof Class, proceed. Assert that the value is either instanceof java.lang.Class or java.lang.String.

Now that you have a java.lang.class, call its newInstance and return it as the result of this method.

Parameters
key:String

Used to look up the value in the Map.

map:ViewMemberInstanceFactoryMetadataMap<String, Object>

The Map that will be searched.

Returns:T

The new object instance.

Annotations
@SuppressWarnings:unchecked
pushDeclaredDefaultValuesToAttributesMapback to summary
private void pushDeclaredDefaultValuesToAttributesMap(FacesContext context, BeanInfo componentMetadata, Map<String, Object> attrs, UIComponent component, ExpressionFactory expressionFactory)
Annotations
@SuppressWarnings:unchecked
com.sun.faces.application.applicationimpl back to summary

private final Class InstanceFactory.ComponentResourceClassNotFound

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.faces.application.applicationimpl.InstanceFactory.ComponentResourceClassNotFound

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ComponentResourceClassNotFoundback to summary
private ComponentResourceClassNotFound()