/** * Return true if and only if the end of the path is a collection. * @return the end-is-collection flag */ public boolean endIsCollection() { if (endFld == null) { return false; } return endFld.isCollection(); }
/** * Return true if and only if the end of the path is a collection. * @return the end-is-collection flag */ public boolean endIsCollection() { if (endFld == null) { return false; } return endFld.isCollection(); }
.append("public Class<?> getElementType(final String fieldName) {\n"); for (FieldDescriptor field : cld.getAllFieldDescriptors()) { if (field.isCollection()) { sb.append(INDENT + INDENT) .append("if (\"" + field.getName() + "\".equals(fieldName)) {\n")
.append("public Class<?> getElementType(final String fieldName) {\n"); for (FieldDescriptor field : cld.getAllFieldDescriptors()) { if (field.isCollection()) { sb.append(INDENT + INDENT) .append("if (\"" + field.getName() + "\".equals(fieldName)) {\n")
.append(INDENT + INDENT); for (FieldDescriptor field : cld.getAllFieldDescriptors()) { if (field.isCollection()) { String fieldName = field.getName(); if ("fieldName".equals(fieldName)) {
.append(INDENT + INDENT); for (FieldDescriptor field : cld.getAllFieldDescriptors()) { if (field.isCollection()) { String fieldName = field.getName(); if ("fieldName".equals(fieldName)) {
FieldDescriptor fieldDescriptor = elementClassDescriptors.get(i) .getFieldDescriptorByName(fieldName); if (fieldDescriptor.isReference() || fieldDescriptor.isCollection()) { String referencedClassName = ((ReferenceDescriptor) fieldDescriptor).getReferencedClassName();
FieldDescriptor fieldDescriptor = elementClassDescriptors.get(i) .getFieldDescriptorByName(fieldName); if (fieldDescriptor.isReference() || fieldDescriptor.isCollection()) { String referencedClassName = ((ReferenceDescriptor) fieldDescriptor).getReferencedClassName();
if (!field.isCollection()) { getPriorities(clazz, field.getName()); if ((field != null) && (!field.isCollection())) { getPriorities(clazz, fieldName); } else {
if (!field.isCollection()) { getPriorities(clazz, field.getName()); if ((field != null) && (!field.isCollection())) { getPriorities(clazz, fieldName); } else {
} else if (!field.isCollection()) { referenceMap.put(field.getName(), (ReferenceDescriptor) field); if (f instanceof AttributeDescriptor) { attributes.add((AttributeDescriptor) f); } else if (!f.isCollection()) { references.add((ReferenceDescriptor) f);
} else if (!field.isCollection()) { referenceMap.put(field.getName(), (ReferenceDescriptor) field); if (f instanceof AttributeDescriptor) { attributes.add((AttributeDescriptor) f); } else if (!f.isCollection()) { references.add((ReferenceDescriptor) f);
if (fld.isCollection()) { this.containsCollections = true;
if (fld.isCollection()) { this.containsCollections = true;
/** * Attach the model. Throws IllegalArgumentExceptions if node doesn't map onto the model. * * @param model model to attach * @throws IllegalArgumentException if class or field are not found in the model */ public void setModel(Model model) { ClassDescriptor cld = model.getClassDescriptorByName(getParentType()); if (cld == null) { throw new IllegalArgumentException("No class '" + getParentType() + "' found in model '" + model.getName() + "'."); } fd = cld.getFieldDescriptorByName(fieldName); if (fd == null) { throw new IllegalArgumentException("Class '" + cld.getName() + "' does not have field '" + fieldName + "'."); } type = TypeUtil.unqualifiedName(fd.isAttribute() ? ((AttributeDescriptor) fd).getType() : ((ReferenceDescriptor) fd) .getReferencedClassDescriptor().getName()); attribute = fd.isAttribute(); reference = fd.isReference(); collection = fd.isCollection(); this.model = model; }
/** * Attach the model. Throws IllegalArgumentExceptions if node doesn't map onto the model. * * @param model model to attach * @throws IllegalArgumentException if class or field are not found in the model */ public void setModel(Model model) { ClassDescriptor cld = model.getClassDescriptorByName(getParentType()); if (cld == null) { throw new IllegalArgumentException("No class '" + getParentType() + "' found in model '" + model.getName() + "'."); } fd = cld.getFieldDescriptorByName(fieldName); if (fd == null) { throw new IllegalArgumentException("Class '" + cld.getName() + "' does not have field '" + fieldName + "'."); } type = TypeUtil.unqualifiedName(fd.isAttribute() ? ((AttributeDescriptor) fd).getType() : ((ReferenceDescriptor) fd) .getReferencedClassDescriptor().getName()); attribute = fd.isAttribute(); reference = fd.isReference(); collection = fd.isCollection(); this.model = model; }
/** * If the last element in the path is a reference or collection return the ClassDescriptor that * the reference or collection references. If the path has one element (eg. "Employee"), * return its ClassDescriptor. If the last element in the path is an attribute, return null. * @return the ClassDescriptor */ public ClassDescriptor getEndClassDescriptor() { if (getEndFieldDescriptor() == null) { return getStartClassDescriptor(); } if (!getEndFieldDescriptor().isAttribute()) { if (getEndFieldDescriptor().isCollection()) { CollectionDescriptor collDesc = (CollectionDescriptor) getEndFieldDescriptor(); return collDesc.getReferencedClassDescriptor(); } if (getEndFieldDescriptor().isReference()) { ReferenceDescriptor refDesc = (ReferenceDescriptor) getEndFieldDescriptor(); return refDesc.getReferencedClassDescriptor(); } } return null; }
/** * If the last element in the path is a reference or collection return the ClassDescriptor that * the reference or collection references. If the path has one element (eg. "Employee"), * return its ClassDescriptor. If the last element in the path is an attribute, return null. * @return the ClassDescriptor */ public ClassDescriptor getEndClassDescriptor() { if (getEndFieldDescriptor() == null) { return getStartClassDescriptor(); } if (!getEndFieldDescriptor().isAttribute()) { if (getEndFieldDescriptor().isCollection()) { CollectionDescriptor collDesc = (CollectionDescriptor) getEndFieldDescriptor(); return collDesc.getReferencedClassDescriptor(); } if (getEndFieldDescriptor().isReference()) { ReferenceDescriptor refDesc = (ReferenceDescriptor) getEndFieldDescriptor(); return refDesc.getReferencedClassDescriptor(); } } return null; }
if (fd.isCollection()) { Object fieldValue = company.getFieldValue(fd.getName()); DisplayCollection dc = new DisplayCollection((Collection<?>) fieldValue,