@Override protected void addImplicitRules(Interpreter interpreter) { // The following line adds the capability to parse nested components NestedComplexPropertyIA nestedComplexPropertyIA = new NestedComplexPropertyIA(); nestedComplexPropertyIA.setContext(context); interpreter.addImplicitAction(nestedComplexPropertyIA); NestedBasicPropertyIA nestedBasicIA = new NestedBasicPropertyIA(); nestedBasicIA.setContext(context); interpreter.addImplicitAction(nestedBasicIA); }
String errMsg = "Could not find an appropriate class for property [" + localName + "]"; addError(errMsg); return; addInfo("Assuming default type [" + componentClass.getName() + "] for [" + localName + "] property"); String msg = "Could not create component [" + localName + "] of type [" + className + "]"; addError(msg, oops);
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; } }
addError("The object on the top the of the stack is not the component pushed earlier."); } else { ec.popObject();
@Override protected void addImplicitRules(Interpreter interpreter) { NestedComplexPropertyIA nestedComplexIA = new NestedComplexPropertyIA(); nestedComplexIA.setContext(context); interpreter.addImplicitAction(nestedComplexIA); NestedBasicPropertyIA nestedSimpleIA = new NestedBasicPropertyIA(); nestedSimpleIA.setContext(context); interpreter.addImplicitAction(nestedSimpleIA); }
String errMsg = "Could not find an appropriate class for property [" + localName + "]"; addError(errMsg); return; addInfo("Assuming default type [" + componentClass.getName() + "] for [" + localName + "] property"); addInfo("Pushing component [" + localName + "] on top of the object stack."); ec.pushObject(actionData.getNestedComplexProperty()); String msg = "Could not create component [" + localName + "] of type [" + className + "]"; addError(msg, oops);
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; } }
@Override protected void addImplicitRules(Interpreter interpreter) { // The following line adds the capability to parse nested components NestedComplexPropertyIA nestedComplexPropertyIA = new NestedComplexPropertyIA(); nestedComplexPropertyIA.setContext(context); interpreter.addImplicitAction(nestedComplexPropertyIA); NestedBasicPropertyIA nestedBasicIA = new NestedBasicPropertyIA(); nestedBasicIA.setContext(context); interpreter.addImplicitAction(nestedBasicIA); }
String errMsg = "Could not find an appropriate class for property [" + localName + "]"; addError(errMsg); return; addInfo("Assuming default type [" + componentClass.getName() + "] for [" + localName + "] property"); String msg = "Could not create component [" + localName + "] of type [" + className + "]"; addError(msg, oops);
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; } }
@Override protected void addImplicitRules(Interpreter interpreter) { NestedComplexPropertyIA nestedComplexIA = new NestedComplexPropertyIA(); nestedComplexIA.setContext(context); interpreter.addImplicitAction(nestedComplexIA); NestedBasicPropertyIA nestedSimpleIA = new NestedBasicPropertyIA(); nestedSimpleIA.setContext(context); interpreter.addImplicitAction(nestedSimpleIA); }
actionData.inError = true; String errMsg = "Could not find an appropriate class for property [" + localName + "]"; addError(errMsg); return; addInfo("Assuming default type [" + componentClass.getName() + "] for [" + localName + "] property"); actionData.inError = true; String msg = "Could not create component [" + localName + "] of type [" + className + "]"; addError(msg, oops);
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; } }
@Override protected void addImplicitRules(Interpreter interpreter) { // The following line adds the capability to parse nested components NestedComplexPropertyIA nestedComplexPropertyIA = new NestedComplexPropertyIA(); nestedComplexPropertyIA.setContext(context); interpreter.addImplicitAction(nestedComplexPropertyIA); NestedBasicPropertyIA nestedBasicIA = new NestedBasicPropertyIA(); nestedBasicIA.setContext(context); interpreter.addImplicitAction(nestedBasicIA); }
actionData.inError = true; String errMsg = "Could not find an appropriate class for property [" + localName + "]"; addError(errMsg); return; addInfo("Assuming default type [" + componentClass.getName() + "] for [" + localName + "] property"); actionData.inError = true; String msg = "Could not create component [" + localName + "] of type [" + className + "]"; addError(msg, oops);
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; } }
@Override protected void addImplicitRules(Interpreter interpreter) { NestedComplexPropertyIA nestedComplexIA = new NestedComplexPropertyIA(); nestedComplexIA.setContext(context); interpreter.addImplicitAction(nestedComplexIA); NestedBasicPropertyIA nestedSimpleIA = new NestedBasicPropertyIA(); nestedSimpleIA.setContext(context); interpreter.addImplicitAction(nestedSimpleIA); }
actionData.inError = true; String errMsg = "Could not find an appropriate class for property [" + localName + "]"; addError(errMsg); return; addInfo("Assuming default type [" + componentClass.getName() + "] for [" + localName + "] property"); actionData.inError = true; String msg = "Could not create component [" + localName + "] of type [" + className + "]"; addError(msg, oops);
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; } }
@Override protected void addImplicitRules(Interpreter interpreter) { // The following line adds the capability to parse nested components NestedComplexPropertyIA nestedComplexPropertyIA = new NestedComplexPropertyIA(); nestedComplexPropertyIA.setContext(context); interpreter.addImplicitAction(nestedComplexPropertyIA); NestedBasicPropertyIA nestedBasicIA = new NestedBasicPropertyIA(); nestedBasicIA.setContext(context); interpreter.addImplicitAction(nestedBasicIA); }