Michael Pasternak has posted comments on this change.

Change subject: restapi: Add enum validations
......................................................................


Patch Set 2: I would prefer that you didn't submit this

(1 inline comment)

....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/ValidatorLocator.java
Line 43:         validators.put(SchedulingPolicy.class, new 
SchedulingPolicyValidator());
Line 44:         validators.put(StorageDomain.class, new 
StorageDomainValidator());
Line 45:         validators.put(Template.class, new TemplateValidator());
Line 46:         validators.put(Usb.class, new UsbValidator());
Line 47:         validators.put(VM.class, new VmValidator());
i'd prefer loading them dynamically rather than maintaining another manual map,
especially when we already have code loading/finding content at runtime code,
we using it in RSDL, add enum annotation inside & just specify the package:

List<Class<?>> classes = ReflectionHelper.getClasses(RESOURCES_PACKAGE)
Line 48:     }
Line 49: 
Line 50:     @SuppressWarnings("unchecked")
Line 51:     public static <E> Validator<E> getValidator(Class<E> entityType) {


--
To view, visit http://gerrit.ovirt.org/7218
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I32b575589a7c82cb2d9e6da8d4d852a50f0f595f
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ori Liel <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ori Liel <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to