Class InstanceFactory
public class InstanceFactory extends Object
-
Constructor Summary
Constructors Constructor Description InstanceFactory(ApplicationAssociate applicationAssociate)
-
Method Summary
Modifier and Type Method Description void
addBehavior(String behaviorId, String behaviorClass)
void
addComponent(String componentType, String componentClass)
void
addConverter(Class<?> targetClass, String converterClass)
void
addConverter(String converterId, String converterClass)
void
addDefaultValidatorId(String validatorId)
void
addValidator(String validatorId, String validatorClass)
Behavior
createBehavior(String behaviorId)
UIComponent
createComponent(jakarta.el.ValueExpression componentExpression, FacesContext context, String componentType)
UIComponent
createComponent(jakarta.el.ValueExpression componentExpression, FacesContext context, String componentType, String rendererType)
UIComponent
createComponent(FacesContext context, Resource componentResource, jakarta.el.ExpressionFactory expressionFactory)
UIComponent
createComponent(FacesContext context, String componentType, String rendererType)
UIComponent
createComponent(ValueBinding componentBinding, FacesContext context, String componentType)
UIComponent
createComponent(String componentType)
Converter
createConverter(Class<?> targetClass)
Converter<?>
createConverter(String converterId)
Validator<?>
createValidator(String validatorId)
Iterator<String>
getBehaviorIds()
Iterator<String>
getComponentTypes()
Iterator<String>
getConverterIds()
Iterator<Class<?>>
getConverterTypes()
Map<String,String>
getDefaultValidatorInfo()
Iterator<String>
getValidatorIds()
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.
-
Constructor Details
-
Method Details
-
addComponent
-
createComponent
public UIComponent createComponent(jakarta.el.ValueExpression componentExpression, FacesContext context, String componentType) throws FacesException- Throws:
FacesException
-
createComponent
- Throws:
FacesException
-
createComponent
public UIComponent createComponent(FacesContext context, Resource componentResource, jakarta.el.ExpressionFactory expressionFactory) throws FacesException- Throws:
FacesException
-
createComponent
public UIComponent createComponent(FacesContext context, String componentType, String rendererType) -
createComponent
public UIComponent createComponent(jakarta.el.ValueExpression componentExpression, FacesContext context, String componentType, String rendererType) -
createComponent
public UIComponent createComponent(ValueBinding componentBinding, FacesContext context, String componentType) throws FacesException- Throws:
FacesException
-
getComponentTypes
- See Also:
Application.getComponentTypes()
-
addBehavior
- See Also:
Application.addBehavior(String, String)
-
createBehavior
- Throws:
FacesException
- See Also:
Application.createBehavior(String)
-
getBehaviorIds
- See Also:
Application.getBehaviorIds()
-
addConverter
-
addConverter
- See Also:
Application.addConverter(Class, String)
-
createConverter
- See Also:
Application.createConverter(String)
-
createConverter
- See Also:
Application.createConverter(Class)
-
getConverterIds
- See Also:
Application.getConverterIds()
-
getConverterTypes
- See Also:
Application.getConverterTypes()
-
addValidator
- See Also:
Application.addValidator(String, String)
-
createValidator
- Throws:
FacesException
- See Also:
Application.createValidator(String)
-
getValidatorIds
- See Also:
Application.getValidatorIds()
-
addDefaultValidatorId
-
getDefaultValidatorInfo
- See Also:
Application.getDefaultValidatorInfo()
-
newConverter
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
- Used to look up the value in theMap
.map
- TheMap
that will be searched.targetClass
- the target class for the single argument ctor- Returns:
- The new object instance.
-