/** * Creates a component instance from the definition using a factory context. * * @param attributes Attribute map for initializing. * @return A component instance. May be null if creation is suppressed. */ public BaseComponent create(Map<String, String> attributes) { if (attributes != null) { for (Entry<String, Method> entry : def.getFactoryParameters().entrySet()) { String name = entry.getKey(); if (attributes.containsKey(name)) { Object value = ELEvaluator.getInstance().evaluate(attributes.remove(name)); ConvertUtil.invokeSetter(this, entry.getValue(), value); } } } try { return inactive ? null : clazz.newInstance(); } catch (Exception e) { throw MiscUtil.toUnchecked(e); } }
processAttributes(def.getFactoryParameters(), ct);