Class InstanceFactory
public class InstanceFactory extends Object
-
Constructor Summary
Constructors Constructor Description InstanceFactory(ApplicationAssociate applicationAssociate) -
Method Summary
Modifier and Type Method Description voidaddBehavior(String behaviorId, String behaviorClass)voidaddComponent(String componentType, String componentClass)voidaddConverter(Class<?> targetClass, String converterClass)voidaddConverter(String converterId, String converterClass)voidaddDefaultValidatorId(String validatorId)voidaddValidator(String validatorId, String validatorClass)BehaviorcreateBehavior(String behaviorId)UIComponentcreateComponent(jakarta.el.ValueExpression componentExpression, FacesContext context, String componentType)UIComponentcreateComponent(jakarta.el.ValueExpression componentExpression, FacesContext context, String componentType, String rendererType)UIComponentcreateComponent(FacesContext context, Resource componentResource, jakarta.el.ExpressionFactory expressionFactory)UIComponentcreateComponent(FacesContext context, String componentType, String rendererType)UIComponentcreateComponent(ValueBinding componentBinding, FacesContext context, String componentType)UIComponentcreateComponent(String componentType)ConvertercreateConverter(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 ObjectnewConverter(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- TheMapthat will be searched.targetClass- the target class for the single argument ctor- Returns:
- The new object instance.
-