Search in sources :

Example 1 with NamedExpression

use of org.kie.dmn.trisotech.model.api.NamedExpression in project drools by kiegroup.

the class NamedExpressionConverter method assignAttributes.

@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
    super.assignAttributes(reader, parent);
    NamedExpression exp = (NamedExpression) parent;
    String typeRef = reader.getAttribute("typeRef");
    exp.setTypeRef(MarshallingUtils.parseQNameString(typeRef));
}
Also used : TNamedExpression(org.kie.dmn.trisotech.model.v1_3.TNamedExpression) NamedExpression(org.kie.dmn.trisotech.model.api.NamedExpression)

Example 2 with NamedExpression

use of org.kie.dmn.trisotech.model.api.NamedExpression in project drools by kiegroup.

the class NamedExpressionConverter method assignChildElement.

@Override
protected void assignChildElement(Object parent, String nodeName, Object child) {
    NamedExpression namedExp = (NamedExpression) parent;
    if (child instanceof Expression) {
        namedExp.setExpression((Expression) child);
        namedExp.setName(nodeName);
    } else
        super.assignChildElement(parent, nodeName, child);
}
Also used : Expression(org.kie.dmn.model.api.Expression) TNamedExpression(org.kie.dmn.trisotech.model.v1_3.TNamedExpression) NamedExpression(org.kie.dmn.trisotech.model.api.NamedExpression) TNamedExpression(org.kie.dmn.trisotech.model.v1_3.TNamedExpression) NamedExpression(org.kie.dmn.trisotech.model.api.NamedExpression)

Example 3 with NamedExpression

use of org.kie.dmn.trisotech.model.api.NamedExpression in project drools by kiegroup.

the class NamedExpressionConverter method writeAttributes.

@Override
protected void writeAttributes(HierarchicalStreamWriter writer, Object parent) {
    super.writeAttributes(writer, parent);
    NamedExpression exp = (NamedExpression) parent;
    if (exp.getTypeRef() != null) {
        writer.addAttribute("typeRef", MarshallingUtils.formatQName(exp.getTypeRef(), exp));
    }
}
Also used : TNamedExpression(org.kie.dmn.trisotech.model.v1_3.TNamedExpression) NamedExpression(org.kie.dmn.trisotech.model.api.NamedExpression)

Example 4 with NamedExpression

use of org.kie.dmn.trisotech.model.api.NamedExpression in project drools by kiegroup.

the class NamedExpressionConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    NamedExpression namedExp = (NamedExpression) parent;
    writeChildrenNode(writer, context, namedExp.getExpression(), MarshallingUtils.defineExpressionNodeName(xstream, namedExp.getExpression()));
}
Also used : TNamedExpression(org.kie.dmn.trisotech.model.v1_3.TNamedExpression) NamedExpression(org.kie.dmn.trisotech.model.api.NamedExpression)

Example 5 with NamedExpression

use of org.kie.dmn.trisotech.model.api.NamedExpression 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);
    }
}
Also used : Expression(org.kie.dmn.model.api.Expression) TNamedExpression(org.kie.dmn.trisotech.model.v1_3.TNamedExpression) NamedExpression(org.kie.dmn.trisotech.model.api.NamedExpression) TNamedExpression(org.kie.dmn.trisotech.model.v1_3.TNamedExpression) NamedExpression(org.kie.dmn.trisotech.model.api.NamedExpression) Iterator(org.kie.dmn.trisotech.model.api.Iterator) TIterator(org.kie.dmn.trisotech.model.v1_3.TIterator)

Aggregations

NamedExpression (org.kie.dmn.trisotech.model.api.NamedExpression)5 TNamedExpression (org.kie.dmn.trisotech.model.v1_3.TNamedExpression)5 Expression (org.kie.dmn.model.api.Expression)2 Iterator (org.kie.dmn.trisotech.model.api.Iterator)1 TIterator (org.kie.dmn.trisotech.model.v1_3.TIterator)1