public ExternalTaskFactory(Repository repository, TaskInformation information) { super(repository); this.output = new ValueType(information.output); this.pathArguments = information.pathArguments; this.prefixes = information.prefixes; this.constants = information.constants; this.id = information.id; if (information.id == null) throw new AssertionError("Task ID is not defined"); // Add inputs for (Map.Entry<String, InputInformation> entry : information.inputs.entrySet()) { String name = entry.getKey(); final InputInformation field = entry.getValue(); Input input = new JsonInput(getType(field)); input.setDocumentation(field.help); input.setOptional(!field.required); input.setCopyTo(field.copyTo); input.nestedDependencies(field.dependencies); if (field.defaultvalue != null && !field.defaultvalue.isJsonNull()) { input.setDefaultValue(Json.toJSON(field.defaultvalue)); } inputs.put(name, input); } // Add paths for (PathArgument pathArgument : information.pathArguments) { Input input = new JsonInput(Type.XP_PATH); input.setOptional(true); // We are lying -- we will set it! inputs.put(pathArgument.jsonName, input); } }