LOG.debug("includeField(Pl, Vec, Str):" + log("processing field", fieldName) + andlog("left", "" + names.size()));
}
// locate the field in the object's class
final ObjectSpecification nos = object.getSpecification();
ObjectAssociation field = null;
try {
// HACK: really want a ObjectSpecification.hasField method to
// check first.
field = nos.getAssociation(fieldName);
} catch (final ObjectSpecificationException ex) {
if (LOG.isInfoEnabled()) {
LOG.info("includeField(Pl, Vec, Str): could not locate field, skipping");
}
return false;
}
// locate the corresponding XML element
// (the corresponding XSD element will later be attached to xmlElement
// as its userData)
if (LOG.isDebugEnabled()) {
LOG.debug("includeField(Pl, Vec, Str): locating corresponding XML element");
}
final Vector xmlFieldElements = elementsUnder(xmlElement, field.getId());
if (xmlFieldElements.size() != 1) {
if (LOG.isInfoEnabled()) {
LOG.info("includeField(Pl, Vec, Str): could not locate " + log("field", field.getId()) + andlog("xmlFieldElements.size", "" + xmlFieldElements.size()));
}
return false;
}
final Element xmlFieldElement = (Element) xmlFieldElements.elementAt(0);
if (names.size() == 0 && annotation != null) {
// nothing left in the path, so we will apply the annotation now
isisMetaModel.setAnnotationAttribute(xmlFieldElement, annotation);
}
final Place fieldPlace = new Place(object, xmlFieldElement);
if (field instanceof OneToOneAssociation) {
if (field.getSpecification().getAssociations(Contributed.EXCLUDED).size() == 0) {
if (LOG.isDebugEnabled()) {
LOG.debug("includeField(Pl, Vec, Str): field is value; done");
}
return false;
}