@@ -0,0 +1,1089 @@
+package api.v1.Utils;%0A%0Aimport net.minidev.json.JSONObject;%0A%0A/**%0A * Created by Vlad Stefan on 5/17/2017.%0A */%0Apublic class JSONStepValidator implements Validator %7B%0A%0A%0A    /**%0A     * Validate if a  JsonObject respects the step structure%0A     * (name, description)%0A     *%0A     * @return a boolean, the validation result%0A     * @recipe the JSONObject to validate%0A     */%0A    public boolean isValid(Object toValidate) %7B%0A%0A        JSONObject step;%0A        try %7B%0A            step = (JSONObject) toValidate;%0A        %7D catch (Exception e) %7B%0A            return false;%0A        %7D%0A%0A        String taskName;%0A        String description;%0A        try %7B%0A            taskName = step.getAsString(%22task%22);%0A            description = step.getAsString(%22description%22);%0A        %7D catch (Exception e) %7B%0A            System.out.println(%22Cast%22);%0A%0A            return false;%0A        %7D%0A        // invalid taskName%0A%0A        if (taskName.trim() == %22%22) %7B%0A            return false;%0A        %7D%0A%0A        // invalid description%0A        if (description.trim() == %22%22) %7B%0A            return false;%0A        %7D%0A%0A        return true;%0A    %7D%0A%7D

add StepValidator