public ExpressionItem toExpressionItem() throws IllegalStateException { ArchetypeElementVO archetypeElementVO = getArchetypeElementRuleLineElement().getArchetypeElementVO(); if (archetypeElementVO != null) { String gtCode = getArchetypeElementRuleLineElement().getValue().getValue(); if (getSecondArchetypeElementRuleLineElement().getValue() == null) { throw new IllegalStateException("No expression set"); } String secondGtCode = getSecondArchetypeElementRuleLineElement().getValue().getValue(); OperatorKind operatorKind = getComparisonOperatorRuleLineElement().getValue(); if (operatorKind == null) { throw new IllegalStateException("No operator kind set"); } String name = getArchetypeManager().getArchetypeElements().getText(archetypeElementVO, getLanguage()); return new BinaryExpression( new Variable(gtCode, null, name), new Variable(secondGtCode), operatorKind); } else { throw new IllegalStateException("Invalid rule line: " + getArchetypeElementRuleLineElement()); } } }
eccrl.getArchetypeElementRuleLineElement().setValue(gtCodeRuleLineElement); eccrl.getSecondArchetypeElementRuleLineElement().setValue(gtCodeElementMap.get(gtCodeAux).getGTCodeRuleLineElement()); eccrl.getComparisonOperatorRuleLineElement().setValue(binaryExpression.getOperator()); } else { throw new InternalErrorException(new Exception("Unknown expression '" + binaryExpression.getRight().getClass().getName() + "'"));