public class InstanceFactory extends Object
Constructor and Description |
---|
InstanceFactory(ApplicationAssociate applicationAssociate) |
Modifier and Type | Method and 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(FacesContext context,
Resource componentResource,
javax.el.ExpressionFactory expressionFactory) |
UIComponent |
createComponent(FacesContext context,
String componentType,
String rendererType) |
UIComponent |
createComponent(String componentType) |
UIComponent |
createComponent(ValueBinding componentBinding,
FacesContext context,
String componentType) |
UIComponent |
createComponent(javax.el.ValueExpression componentExpression,
FacesContext context,
String componentType) |
UIComponent |
createComponent(javax.el.ValueExpression componentExpression,
FacesContext context,
String componentType,
String rendererType) |
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.
|
public InstanceFactory(ApplicationAssociate applicationAssociate)
public UIComponent createComponent(javax.el.ValueExpression componentExpression, FacesContext context, String componentType) throws FacesException
FacesException
public UIComponent createComponent(String componentType) throws FacesException
FacesException
public UIComponent createComponent(FacesContext context, Resource componentResource, javax.el.ExpressionFactory expressionFactory) throws FacesException
FacesException
public UIComponent createComponent(FacesContext context, String componentType, String rendererType)
public UIComponent createComponent(javax.el.ValueExpression componentExpression, FacesContext context, String componentType, String rendererType)
public UIComponent createComponent(ValueBinding componentBinding, FacesContext context, String componentType) throws FacesException
FacesException
public Iterator<String> getComponentTypes()
Application.getComponentTypes()
public void addBehavior(String behaviorId, String behaviorClass)
Application.addBehavior(String, String)
public Behavior createBehavior(String behaviorId) throws FacesException
FacesException
Application.createBehavior(String)
public Iterator<String> getBehaviorIds()
Application.getBehaviorIds()
public void addConverter(Class<?> targetClass, String converterClass)
Application.addConverter(Class, String)
public Converter<?> createConverter(String converterId)
Application.createConverter(String)
public Converter createConverter(Class<?> targetClass)
Application.createConverter(Class)
public Iterator<String> getConverterIds()
Application.getConverterIds()
public Iterator<Class<?>> getConverterTypes()
Application.getConverterTypes()
public void addValidator(String validatorId, String validatorClass)
Application.addValidator(String, String)
public Validator<?> createValidator(String validatorId) throws FacesException
FacesException
Application.createValidator(String)
public Iterator<String> getValidatorIds()
Application.getValidatorIds()
public void addDefaultValidatorId(String validatorId)
public Map<String,String> getDefaultValidatorInfo()
Application.getDefaultValidatorInfo()
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.
key
- Used to look up the value in the Map
.map
- The Map
that will be searched.targetClass
- the target class for the single argument ctorCopyright © 1997–2019 Eclipse Foundation. All rights reserved.