use of com.dexels.navajo.document.base.BaseExpressionTagImpl in project navajo by Dexels.
the class NavascriptSaxHandler method text.
@Override
public void text(Reader r) throws Exception {
StringWriter sw = new StringWriter();
copyTextBuffer(sw, (PushbackReader) r);
String text = sw.toString();
BaseNode n = currentNode.lastElement();
if (n instanceof BaseCheckTagImpl) {
((BaseCheckTagImpl) n).setRule(text);
} else if (n instanceof BaseExpressionTagImpl) {
((BaseExpressionTagImpl) n).setConstant(text);
} else if (n instanceof BaseFieldTagImpl) {
((BaseFieldTagImpl) n).setConstant(text);
} else if (n instanceof ValueTag) {
((ValueTag) n).setValue(text);
} else if (n instanceof DefineTag) {
((DefineTag) n).setExpression(text);
} else {
logger.info("Cannot place text under node, it must be a field tag. Correct.");
if (currentNode.lastElement() instanceof MapTag) {
currentMap.pop();
} else {
throw new Exception("Expected a MapTag to be corrected for a FieldTag not a " + currentNode.lastElement() + " tag.");
}
currentNode.pop();
FieldTag ft = new FieldTag(currentMap.lastElement(), null, ((MapTag) n).getRefAttribute());
ft.setConstant(text);
BaseNode p = currentNode.lastElement();
if (p instanceof MessageTag) {
MessageTag mt = (MessageTag) p;
mt.removeLastChild();
mt.addField(ft);
}
currentNode.push(ft);
currentField.push(ft);
}
}
Aggregations