use of org.kie.dmn.trisotech.model.api.Iterator in project drools by kiegroup.
the class IteratorConverter method assignAttributes.
@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
super.assignAttributes(reader, parent);
Iterator filter = (Iterator) parent;
String type = reader.getAttribute(TYPE);
if (type == null) {
type = "for";
}
switch(type) {
case "for":
default:
filter.setIteratorType(Iterator.IteratorType.FOR);
break;
case "some":
filter.setIteratorType(Iterator.IteratorType.SOME);
break;
case "every":
filter.setIteratorType(Iterator.IteratorType.EVERY);
break;
}
filter.setVariable(reader.getAttribute(VARIABLE));
}
use of org.kie.dmn.trisotech.model.api.Iterator in project drools by kiegroup.
the class IteratorConverter method assignChildElement.
@Override
protected void assignChildElement(Object parent, String nodeName, Object child) {
Iterator filter = (Iterator) parent;
if (IN.equals(nodeName)) {
Expression expression = ((NamedExpression) child).getExpression();
if (((NamedExpression) child).getTypeRef() != null) {
expression.setTypeRef(((NamedExpression) child).getTypeRef());
}
filter.setIn(expression);
} else if (RETURN.equals(nodeName)) {
filter.setReturn(((NamedExpression) child).getExpression());
} else {
super.assignChildElement(parent, nodeName, child);
}
}
use of org.kie.dmn.trisotech.model.api.Iterator in project drools by kiegroup.
the class IteratorConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
Iterator it = (Iterator) parent;
writeChildrenNode(writer, context, new TNamedExpression(IN, it.getIn(), it.getTypeRef()), IN);
writeChildrenNode(writer, context, new TNamedExpression(RETURN, it.getReturn()), RETURN);
}
use of org.kie.dmn.trisotech.model.api.Iterator in project drools by kiegroup.
the class IteratorConverter method writeAttributes.
@Override
protected void writeAttributes(HierarchicalStreamWriter writer, Object parent) {
super.writeAttributes(writer, parent);
Iterator it = (Iterator) parent;
writer.addAttribute(TYPE, it.getIteratorType().toString().toLowerCase());
writer.addAttribute(VARIABLE, it.getVariable());
}
Aggregations