public static List<Input> getLocalizedInputs(TranslationProvider i18nProvider, List<Input> inputs, Bundle bundle, String uid, Locale locale) { List<Input> linputs = new ArrayList<Input>(); if (inputs != null) { for (Input input : inputs) { String inputName = input.getName(); String ilabel = ModuleTypeI18nUtil.getInputLabel(i18nProvider, bundle, uid, inputName, input.getLabel(), locale); String idescription = ModuleTypeI18nUtil.getInputDescription(i18nProvider, bundle, uid, inputName, input.getDescription(), locale); linputs.add(new Input(inputName, input.getType(), ilabel, idescription, input.getTags(), input.isRequired(), input.getReference(), input.getDefaultValue())); } } return linputs; }
private static String getInputRecord(Input input) { return " name=\"" + input.getName() + "\", label=\"" + input.getLabel() + "\", decription=\"" + input.getDescription() + "\", type=\"" + input.getType() + "\", " + (input.isRequired() ? REQUIRED : NOT_REQUIRED) + (input.getDefaultValue() != null ? "\", default=\"" + input.getDefaultValue() : ""); }
String name = input.getName(); Connection connection = connectionsMap.get(name); if (connection != null) { checkConnection(mtRegistry, connection, input, triggers); } else if (input.isRequired()) { throw new IllegalArgumentException("Required input \"" + name + "\" of the condition \"" + condition.getId() + "\" not connected");
private boolean isConnected(Input input, Set<Connection> connections) { for (Connection connection : connections) { if (connection.getInputName().equals(input.getName())) { return true; } } return false; }
for (Output output : outputs) { if (output.getName().equals(outputName)) { if (input.getType().equals("*")) { return; } else { try { Class<?> outputType = Class.forName(output.getType()); Class<?> inputType = Class.forName(input.getType()); if (inputType.isAssignableFrom(outputType)) { return; } else { throw new IllegalArgumentException(msg + " Incompatible types : \"" + output.getType() + "\" and \"" + input.getType() + "\"."); if (output.getType().equals(input.getType())) { return; } else { throw new IllegalArgumentException(msg + " Incompatible types : \"" + output.getType() + "\" and \"" + input.getType() + "\".");
if (paramAnnotations.length == 0) { input = new Input("p" + i, param.getType().getCanonicalName(), "", "", Collections.<String> emptySet(), false, "", ""); } else if (paramAnnotations.length == 1) { input = new Input(inp.name(), type, inp.label(), inp.description(), Arrays.stream(inp.tags()).collect(Collectors.toSet()), inp.required(), inp.reference(), inp.defaultValue());
String name = input.getName(); Connection connection = connectionsMap.get(name); if (connection == null && input.isRequired()) { throw new IllegalArgumentException("Required input \"" + name + "\" of the condition \"" + action.getId() + "\" not connected");
private boolean hasInput(ActionType moduleType, String in) { for (Input i : moduleType.getInputs()) { if (i.getName().equals(in)) { return true; } } return false; }