// get all fields of the parent class
Class clazz = this.getClass();
Field[] fields = clazz.getFields();
for(Field f : fields) {
// get the xpath value provided through the annotation
XPathRef bind = f.getAnnotation(XPathRef.class);
if(bind == null) continue;
// skip if value is already set
try {
if(f.get(this) != null) continue;
} catch (IllegalAccessException e) {
log.error(e.getMessage(), e);
ret = false;
}
String expr = bind.xpath();
String cond = bind.condition();
boolean optional = bind.optional();
try {
// make ns available
if(!bind.nsUri().equals("")) {
NamespaceContext nsContext = new NamespaceContext();
nsContext.addPrefix(bind.nsUri(), bind.nsPrefix());
xpath.setNamespaceContext(nsContext);
}
// check if condition applies before evaluation xpath
if(!cond.equals("")) {