* Processes annotations at the class level.
*/
@Override
protected AbstractClassMetaData processClassAnnotations(PackageMetaData pmd, Class cls,
AnnotationObject[] annotations, ClassLoaderResolver clr) {
AbstractClassMetaData acmd = new ForceClassMetaData(pmd, cls.getSimpleName());
if (annotations != null && annotations.length > 0) {
for (int i = 0; i < annotations.length; i++) {
AnnotationObject annotation = annotations[i];
if (annotation.getName().equals(CustomObject.class.getName())) {
Map nameValues = annotation.getNameValueMap();
for (Method m : CustomObject.class.getDeclaredMethods()) {
Object value = nameValues.get(m.getName());
if (value != null && !value.equals(m.getDefaultValue())) {
// Only store the non-default values
acmd.addExtension(ForceStoreManager.FORCE_KEY, m.getName(), value.toString());
}
}
} else {
throw new NucleusUserException("Unknown Force.com annotation: " + annotation.getName());
}