String lastVariableType = null;
List<String> names = new ArrayList<String>();
for (int i = 0; i < node.jjtGetNumChildren(); i++) {
StringBuffer sb1 = new StringBuffer();
Node subChild = node.jjtGetChild(i);
if (subChild instanceof AstIdentifier) {
String variableName = subChild.getImage();
if (componentBean.containsVariable(variableName)) {
lastVariableType = componentBean.getVariableType(
variableName).getName();
names.add(variableName);
} else {
processingIdentifier((AstIdentifier) subChild, sb1,
componentBean);
}
} else if (subChild instanceof AstDotSuffix) {
String propertyName = subChild.getImage();
log.debug("Object: " + lastVariableType
+ ", property: " + propertyName);
if (lastVariableType != null) {
try {
Class<?> clazz = componentBean.loadClass(lastVariableType);
PropertyDescriptor propertyDescriptor = getPropertyDescriptor(
clazz, propertyName, componentBean);
if (propertyDescriptor == null) {
throw new PropertyNotFoundException("property: "
+ propertyName + " not found in class: "
+ lastVariableType);
}
log.debug("propertyObject: "
+ propertyDescriptor.getPropertyType()
.getName());
StringBuffer tmpbuf = new StringBuffer();
tmpbuf.append(propertyDescriptor.getReadMethod()
.getName());
tmpbuf.append("()");
names.add(tmpbuf.toString());
lastVariableType = propertyDescriptor.getPropertyType()
.getName();
} catch (ClassNotFoundException e) {
log.error(e.getLocalizedMessage(), e);
}
} else {
sb1.append("getProperty(");
sb1.append(lastIndexValue);
sb1.append(",");
sb1.append("\"");
sb1.append(subChild.getImage());
sb1.append("\")");
}
} else if (subChild instanceof AstBracketSuffix) {
String bracketSuffix = processingBracketSuffix(
(AstBracketSuffix) subChild, componentBean);