public boolean isApplicable(ElementPath elementPath, Attributes attributes, InterpretationContext ic) { String nestedElementTagName = elementPath.peekLast(); // calling ic.peekObject with an empty stack will throw an exception if (ic.isEmpty()) { return false; } Object o = ic.peekObject(); PropertySetter parentBean = new PropertySetter(o); parentBean.setContext(context); AggregationType aggregationType = parentBean .computeAggregationType(nestedElementTagName); switch (aggregationType) { case NOT_FOUND: case AS_BASIC_PROPERTY: case AS_BASIC_PROPERTY_COLLECTION: return false; // we only push action data if NestComponentIA is applicable case AS_COMPLEX_PROPERTY_COLLECTION: case AS_COMPLEX_PROPERTY: IADataForComplexProperty ad = new IADataForComplexProperty(parentBean, aggregationType, nestedElementTagName); actionDataStack.push(ad); return true; default: addError("PropertySetter.computeAggregationType returned " + aggregationType); return false; } }
.getComplexPropertyName(), actionData.getAggregationType(), ec .getDefaultNestedComponentRegistry()); actionData.setNestedComplexProperty(componentClass.newInstance()); if (actionData.getNestedComplexProperty() instanceof ContextAware) { ((ContextAware) actionData.getNestedComplexProperty()) .setContext(this.context); ec.pushObject(actionData.getNestedComplexProperty());
.getNestedComplexProperty()); nestedBean.setContext(context); Object nestedComplexProperty = actionData.getNestedComplexProperty(); if (nestedComplexProperty instanceof LifeCycle && NoAutoStartUtil.notMarkedWithNoAutoStart(nestedComplexProperty)) { if (o != actionData.getNestedComplexProperty()) { addError("The object on the top the of the stack is not the component pushed earlier."); } else { case AS_COMPLEX_PROPERTY: actionData.parentBean.setComplexProperty(tagName, actionData .getNestedComplexProperty()); .getNestedComplexProperty());
public Class findUnequivocallyInstantiableClass( IADataForComplexProperty actionData) { Class<?> clazz; AggregationType at = actionData.getAggregationType(); switch (at) { case AS_COMPLEX_PROPERTY: Method setterMethod = findSetterMethod(actionData .getComplexPropertyName()); clazz = getParameterClassForMethod(setterMethod); if (clazz != null && isUnequivocallyInstantiable(clazz)) { return clazz; } else { return null; } case AS_COMPLEX_PROPERTY_COLLECTION: Method adderMethod = findAdderMethod(actionData.getComplexPropertyName()); clazz = getParameterClassForMethod(adderMethod); if (clazz != null && isUnequivocallyInstantiable(clazz)) { return clazz; } else { return null; } default: throw new IllegalArgumentException(at + " is not valid type in this method"); } }
.getNestedComplexProperty()); nestedBean.setContext(context); Object nestedComplexProperty = actionData.getNestedComplexProperty(); if (nestedComplexProperty instanceof LifeCycle && NoAutoStartUtil.notMarkedWithNoAutoStart(nestedComplexProperty)) { if (o != actionData.getNestedComplexProperty()) { addError("The object on the top the of the stack is not the component pushed earlier."); } else { case AS_COMPLEX_PROPERTY: actionData.parentBean.setComplexProperty(tagName, actionData .getNestedComplexProperty()); .getNestedComplexProperty());
.getComplexPropertyName(), actionData.getAggregationType(), ec .getDefaultNestedComponentRegistry()); actionData.setNestedComplexProperty(componentClass.getConstructor().newInstance()); if (actionData.getNestedComplexProperty() instanceof ContextAware) { ((ContextAware) actionData.getNestedComplexProperty()) .setContext(this.context); ec.pushObject(actionData.getNestedComplexProperty());
public boolean isApplicable(ElementPath elementPath, Attributes attributes, InterpretationContext ic) { String nestedElementTagName = elementPath.peekLast(); // calling ic.peekObject with an empty stack will throw an exception if (ic.isEmpty()) { return false; } Object o = ic.peekObject(); PropertySetter parentBean = new PropertySetter(beanDescriptionCache, o); parentBean.setContext(context); AggregationType aggregationType = parentBean.computeAggregationType(nestedElementTagName); switch (aggregationType) { case NOT_FOUND: case AS_BASIC_PROPERTY: case AS_BASIC_PROPERTY_COLLECTION: return false; // we only push action data if NestComponentIA is applicable case AS_COMPLEX_PROPERTY_COLLECTION: case AS_COMPLEX_PROPERTY: IADataForComplexProperty ad = new IADataForComplexProperty(parentBean, aggregationType, nestedElementTagName); actionDataStack.push(ad); return true; default: addError("PropertySetter.computeAggregationType returned " + aggregationType); return false; } }
.getNestedComplexProperty()); nestedBean.setContext(context); Object nestedComplexProperty = actionData.getNestedComplexProperty(); if (nestedComplexProperty instanceof LifeCycle && NoAutoStartUtil.notMarkedWithNoAutoStart(nestedComplexProperty)) { if (o != actionData.getNestedComplexProperty()) { addError("The object on the top the of the stack is not the component pushed earlier."); } else { case AS_COMPLEX_PROPERTY: actionData.parentBean.setComplexProperty(tagName, actionData .getNestedComplexProperty()); .getNestedComplexProperty());
componentClass = parentBean.getClassNameViaImplicitRules(actionData.getComplexPropertyName(), actionData.getAggregationType(), ec.getDefaultNestedComponentRegistry()); actionData.setNestedComplexProperty(componentClass.newInstance()); if (actionData.getNestedComplexProperty() instanceof ContextAware) { ((ContextAware) actionData.getNestedComplexProperty()).setContext(this.context); ec.pushObject(actionData.getNestedComplexProperty());
public boolean isApplicable(ElementPath elementPath, Attributes attributes, InterpretationContext ic) { String nestedElementTagName = elementPath.peekLast(); // calling ic.peekObject with an empty stack will throw an exception if (ic.isEmpty()) { return false; } Object o = ic.peekObject(); PropertySetter parentBean = new PropertySetter(beanDescriptionCache, o); parentBean.setContext(context); AggregationType aggregationType = parentBean.computeAggregationType(nestedElementTagName); switch (aggregationType) { case NOT_FOUND: case AS_BASIC_PROPERTY: case AS_BASIC_PROPERTY_COLLECTION: return false; // we only push action data if NestComponentIA is applicable case AS_COMPLEX_PROPERTY_COLLECTION: case AS_COMPLEX_PROPERTY: IADataForComplexProperty ad = new IADataForComplexProperty(parentBean, aggregationType, nestedElementTagName); actionDataStack.push(ad); return true; default: addError("PropertySetter.computeAggregationType returned " + aggregationType); return false; } }
.getNestedComplexProperty()); nestedBean.setContext(context); Object nestedComplexProperty = actionData.getNestedComplexProperty(); if (nestedComplexProperty instanceof LifeCycle && NoAutoStartUtil.notMarkedWithNoAutoStart(nestedComplexProperty)) { if (o != actionData.getNestedComplexProperty()) { addError("The object on the top the of the stack is not the component pushed earlier."); } else { case AS_COMPLEX_PROPERTY: actionData.parentBean.setComplexProperty(tagName, actionData .getNestedComplexProperty()); .getNestedComplexProperty());
componentClass = parentBean.getClassNameViaImplicitRules(actionData.getComplexPropertyName(), actionData.getAggregationType(), ec.getDefaultNestedComponentRegistry()); actionData.setNestedComplexProperty(componentClass.newInstance()); if (actionData.getNestedComplexProperty() instanceof ContextAware) { ((ContextAware) actionData.getNestedComplexProperty()).setContext(this.context); ec.pushObject(actionData.getNestedComplexProperty());
public boolean isApplicable(ElementPath elementPath, Attributes attributes, InterpretationContext ic) { String nestedElementTagName = elementPath.peekLast(); // calling ic.peekObject with an empty stack will throw an exception if (ic.isEmpty()) { return false; } Object o = ic.peekObject(); PropertySetter parentBean = new PropertySetter(beanDescriptionCache, o); parentBean.setContext(context); AggregationType aggregationType = parentBean.computeAggregationType(nestedElementTagName); switch (aggregationType) { case NOT_FOUND: case AS_BASIC_PROPERTY: case AS_BASIC_PROPERTY_COLLECTION: return false; // we only push action data if NestComponentIA is applicable case AS_COMPLEX_PROPERTY_COLLECTION: case AS_COMPLEX_PROPERTY: IADataForComplexProperty ad = new IADataForComplexProperty(parentBean, aggregationType, nestedElementTagName); actionDataStack.push(ad); return true; default: addError("PropertySetter.computeAggregationType returned " + aggregationType); return false; } }
.getNestedComplexProperty()); nestedBean.setContext(context); Object nestedComplexProperty = actionData.getNestedComplexProperty(); if (nestedComplexProperty instanceof LifeCycle && NoAutoStartUtil.notMarkedWithNoAutoStart(nestedComplexProperty)) { if (o != actionData.getNestedComplexProperty()) { addError("The object on the top the of the stack is not the component pushed earlier."); } else { case AS_COMPLEX_PROPERTY: actionData.parentBean.setComplexProperty(tagName, actionData .getNestedComplexProperty()); .getNestedComplexProperty());
componentClass = parentBean.getClassNameViaImplicitRules(actionData.getComplexPropertyName(), actionData.getAggregationType(), ec.getDefaultNestedComponentRegistry()); actionData.setNestedComplexProperty(componentClass.newInstance()); if (actionData.getNestedComplexProperty() instanceof ContextAware) { ((ContextAware) actionData.getNestedComplexProperty()).setContext(this.context); ec.pushObject(actionData.getNestedComplexProperty());
public boolean isApplicable(ElementPath elementPath, Attributes attributes, InterpretationContext ic) { String nestedElementTagName = elementPath.peekLast(); // calling ic.peekObject with an empty stack will throw an exception if (ic.isEmpty()) { return false; } Object o = ic.peekObject(); PropertySetter parentBean = new PropertySetter(o); parentBean.setContext(context); AggregationType aggregationType = parentBean .computeAggregationType(nestedElementTagName); switch (aggregationType) { case NOT_FOUND: case AS_BASIC_PROPERTY: case AS_BASIC_PROPERTY_COLLECTION: return false; // we only push action data if NestComponentIA is applicable case AS_COMPLEX_PROPERTY_COLLECTION: case AS_COMPLEX_PROPERTY: IADataForComplexProperty ad = new IADataForComplexProperty(parentBean, aggregationType, nestedElementTagName); actionDataStack.push(ad); return true; default: addError("PropertySetter.computeAggregationType returned " + aggregationType); return false; } }
PropertySetter nestedBean = new PropertySetter(beanDescriptionCache, actionData.getNestedComplexProperty()); nestedBean.setContext(context); Object nestedComplexProperty = actionData.getNestedComplexProperty(); if (nestedComplexProperty instanceof LifeCycle && NoAutoStartUtil.notMarkedWithNoAutoStart(nestedComplexProperty)) { ((LifeCycle) nestedComplexProperty).start(); if (o != actionData.getNestedComplexProperty()) { addError("The object on the top the of the stack is not the component pushed earlier."); } else { actionData.parentBean.setComplexProperty(tagName, actionData.getNestedComplexProperty()); actionData.parentBean.addComplexProperty(tagName, actionData.getNestedComplexProperty()); break; default:
.getComplexPropertyName(), actionData.getAggregationType(), ec .getDefaultNestedComponentRegistry()); actionData.setNestedComplexProperty(componentClass.newInstance()); if (actionData.getNestedComplexProperty() instanceof ContextAware) { ((ContextAware) actionData.getNestedComplexProperty()) .setContext(this.context); ec.pushObject(actionData.getNestedComplexProperty());
public boolean isApplicable(Pattern pattern, Attributes attributes, InterpretationContext ic) { String nestedElementTagName = pattern.peekLast(); // calling ic.peekObject with an empty stack will throw an exception if (ic.isEmpty()) { return false; } Object o = ic.peekObject(); PropertySetter parentBean = new PropertySetter(o); parentBean.setContext(context); AggregationType aggregationType = parentBean .computeAggregationType(nestedElementTagName); switch (aggregationType) { case NOT_FOUND: case AS_BASIC_PROPERTY: case AS_BASIC_PROPERTY_COLLECTION: return false; // we only push action data if NestComponentIA is applicable case AS_COMPLEX_PROPERTY_COLLECTION: case AS_COMPLEX_PROPERTY: IADataForComplexProperty ad = new IADataForComplexProperty(parentBean, aggregationType, nestedElementTagName); actionDataStack.push(ad); return true; default: addError("PropertySetter.computeAggregationType returned " + aggregationType); return false; } }
PropertySetter nestedBean = new PropertySetter(beanDescriptionCache, actionData.getNestedComplexProperty()); nestedBean.setContext(context); Object nestedComplexProperty = actionData.getNestedComplexProperty(); if (nestedComplexProperty instanceof LifeCycle && NoAutoStartUtil.notMarkedWithNoAutoStart(nestedComplexProperty)) { ((LifeCycle) nestedComplexProperty).start(); if (o != actionData.getNestedComplexProperty()) { addError("The object on the top the of the stack is not the component pushed earlier."); } else { actionData.parentBean.setComplexProperty(tagName, actionData.getNestedComplexProperty()); actionData.parentBean.addComplexProperty(tagName, actionData.getNestedComplexProperty()); break; default: