use of lucee.transformer.expression.Expression in project Lucee by lucee.
the class Component method evaluate.
@Override
public TagLibTag evaluate(TagLibTag tagLibTag, Tag tag) throws AttributeEvaluatorException {
tagLibTag.setParseBody(false);
Attribute attr = tag.getAttribute("output");
if (attr != null) {
Expression expr = attr.getValue();
if (!(expr instanceof LitBoolean))
throw new AttributeEvaluatorException("Attribute output of the Tag Component, must be a static boolean value (true or false)");
if (((LitBoolean) expr).getBooleanValue())
tagLibTag.setParseBody(true);
}
return tagLibTag;
}
use of lucee.transformer.expression.Expression in project Lucee by lucee.
the class Function method evaluate.
@Override
public TagLibTag evaluate(TagLibTag tagLibTag, Tag tag) throws AttributeEvaluatorException {
tagLibTag.setParseBody(false);
Attribute attrOutput = tag.getAttribute("output");
if (attrOutput == null)
return tagLibTag;
Expression expr = CastBoolean.toExprBoolean(attrOutput.getValue());
if (!(expr instanceof LitBoolean))
throw new AttributeEvaluatorException("Attribute output of the Tag Function, must be a literal boolean value (true or false)");
boolean output = ((LitBoolean) expr).getBooleanValue();
if (output)
tagLibTag.setParseBody(true);
return tagLibTag;
}
use of lucee.transformer.expression.Expression in project Lucee by lucee.
the class ArrayToList method execute.
@Override
public void execute(BIF bif, FunctionLibFunction flf) throws TemplateException {
Argument[] args = bif.getArguments();
Argument arg = args[0];
Expression value = arg.getValue();
if (value instanceof Cast) {
value = ((Cast) value).getExpr();
}
if (value instanceof Variable) {
((Variable) value).setAsCollection(Boolean.TRUE);
}
}
use of lucee.transformer.expression.Expression in project Lucee by lucee.
the class IsNull method execute.
@Override
public void execute(BIF bif, FunctionLibFunction flf) throws TemplateException {
Argument arg = bif.getArguments()[0];
Expression value = arg.getValue();
// set all member to safe navigated
if (value instanceof Variable) {
Variable var = ((Variable) value);
/* LDEV-1201 List<Member> members = var.getMembers();
for(Member m:members) {
m.setSafeNavigated(true);
}*/
var.setDefaultValue(value.getFactory().createNull());
}
}
use of lucee.transformer.expression.Expression in project Lucee by lucee.
the class PrecisionEvaluate method toOpBigDecimal.
private OpBigDecimal toOpBigDecimal(OpDouble op) {
Expression left = op.getLeft();
Expression right = op.getRight();
if (left instanceof OpDouble)
left = toOpBigDecimal((OpDouble) left);
if (right instanceof OpDouble)
right = toOpBigDecimal((OpDouble) right);
return new OpBigDecimal(left, right, op.getOperation());
}
Aggregations