in beanmodel/src/main/java/org/apache/tapestry5/beanmodel/internal/services/PropertyConduitSourceImpl.java [794:891]
private Type implementSubexpression(InstructionBuilder builder, Type activeType, Tree node)
{
Term term;
while (true)
{
switch (node.getType())
{
case IDENTIFIER:
case INVOKE:
if (activeType == null)
{
invokeGetRootMethod(builder);
activeType = rootType;
}
term = buildTerm(activeType, node);
term.callback.doBuild(builder);
return term.type;
case INTEGER:
builder.loadConstant(Long.valueOf(node.getText()));
return long.class;
case DECIMAL:
builder.loadConstant(Double.valueOf(node.getText()));
return double.class;
case STRING:
builder.loadConstant(node.getText());
return String.class;
case DEREF:
case SAFEDEREF:
if (activeType == null)
{
invokeGetRootMethod(builder);
activeType = rootType;
}
term = analyzeDerefNode(activeType, node);
term.callback.doBuild(builder);
activeType = GenericsUtils.asClass(term.type);
node = node.getChild(1);
break;
case TRUE:
case FALSE:
builder.loadConstant(node.getType() == TRUE ? 1 : 0);
return boolean.class;
case LIST:
return implementListConstructor(builder, node);
case MAP:
return implementMapConstructor(builder, node);
case NOT:
return implementNotExpression(builder, node);
case THIS:
invokeGetRootMethod(builder);
return rootType;
case NULL:
builder.loadNull();
return Void.class;
default:
throw unexpectedNodeType(node, TRUE, FALSE, INTEGER, DECIMAL, STRING, DEREF, SAFEDEREF,
IDENTIFIER, INVOKE, LIST, NOT, THIS, NULL);
}
}
}