constructs a ValidationMessage[] from a ValidationMessage Vector
773153
private static ValidationMessage[] vmFromVector(Vector v) {
        ValidationMessage[] vm = new ValidationMessage[v.size()];
        for (int i = 0; i < vm.length; i++) {
            vm[i] = (ValidationMessage) v.get(i);
        }
        return vm;
    }
635499
private StringBuffer buildFormJavascript(
			ValidatorResources validatorResources, String formName,
			Locale locale, String messageNS, boolean stopOnErrors) {
		Form form = validatorResources.getForm(locale, formName);
		return createDynamicJavascript(validatorResources, form, messageNS,
				stopOnErrors);
	}
1136233
private ObjectJS jsonMessage(String message, StringifierFactory jsonStringifierFactory) {
		ObjectJS callTreeJS = new ObjectJS();
		callTreeJS.setSimpleAttribute("message", message, jsonStringifierFactory.getStringifier(String.class));
		return callTreeJS;
	}
760480
function(validationInformation) {
        var fieldValidation;

        // Loop through the top level forms.
        for (var formName in validationInformation) {
            // Loop through each, individual, field that has validation tests attached to it.
            for (var fieldName in validationInformation[formName]) {
                // Get the current field's validation string.
                fieldValidation = validationInformation[formName][fieldName];

                // Go ahead and create a nicely formated array of each field validation; if there is only a single field validation then
                // we will use an array literal to create our array ourselves.
                validationInformation[formName][fieldName] = (fieldValidation.contains("|")) ? fieldValidation.split("|") : [fieldValidation];
            }
        }

        return validationInformation;
    }
418568
private ScriptValidationContext getScriptValidationContext(Element messageElement, String messageType) {
        ScriptValidationContext context = null;

        boolean done = false;
        List<?> validateElements = DomUtils.getChildElementsByTagName(messageElement, "validate");
        if (validateElements.size() > 0) {
            for (Iterator<?> iter = validateElements.iterator(); iter.hasNext();) {
                Element validateElement = (Element) iter.next();

                Element scriptElement = DomUtils.getChildElementByTagName(validateElement, "script");

                // check for nested validate script child node
                if (scriptElement != null) {
                    if (!done) {
                        done = true;
                    } else {
                        throw new BeanCreationException("Found multiple validation script definitions - " +
                                "only supporting a single validation script for message validation");
                    }

                    context = new ScriptValidationContext(messageType);
                    String type = scriptElement.getAttribute("type");
                    context.setScriptType(type);

                    String filePath = scriptElement.getAttribute("file");
                    if (StringUtils.hasText(filePath)) {
                        context.setValidationScriptResourcePath(filePath);
                        if (scriptElement.hasAttribute("charset")) {
                            context.setValidationScriptResourceCharset(scriptElement.getAttribute("charset"));
                        }
                    } else {
                        context.setValidationScript(DomUtils.getTextValue(scriptElement));
                    }
                }
            }
        }

        return context;
    }
590529
protected String buildMessage(ConstraintViolation violation) {
        Path propertyPath = violation.getPropertyPath();
        StringBuilder message = new StringBuilder();
        Iterator<Path.Node> i = propertyPath.iterator();
        while (i.hasNext()) {
            Path.Node node = i.next();
            if (node.getKind() == ElementKind.METHOD || node.getKind() == ElementKind.CONSTRUCTOR) {
                continue;
            }
            message.append(node.getName());
            if (i.hasNext()) {
                message.append('.');
            }
        }
        message.append(": ").append(violation.getMessage());
        return message.toString();
    }
1119341
private JsonMessageValidationContext getJsonMessageValidationContext(Element messageElement) {
        JsonMessageValidationContext context = new JsonMessageValidationContext();

        if (messageElement != null) {
            Set<String> ignoreExpressions = new HashSet<String>();
            List<?> ignoreElements = DomUtils.getChildElementsByTagName(messageElement, "ignore");
            for (Iterator<?> iter = ignoreElements.iterator(); iter.hasNext(); ) {
                Element ignoreValue = (Element) iter.next();
                ignoreExpressions.add(ignoreValue.getAttribute("path"));
            }
            context.setIgnoreExpressions(ignoreExpressions);

            addSchemaInformationToValidationContext(messageElement, context);
        }

        return context;
    }
256125
private void parseXPathValidationElements(Element messageElement, XpathMessageValidationContext context) {
        //check for validate elements, these elements can either have script, xpath or namespace validation information
        //for now we only handle xpath validation
        Map<String, Object> validateXpathExpressions = new HashMap<>();

        List<?> validateElements = DomUtils.getChildElementsByTagName(messageElement, "validate");
        if (validateElements.size() > 0) {
            for (Iterator<?> iter = validateElements.iterator(); iter.hasNext();) {
                Element validateElement = (Element) iter.next();
                extractXPathValidateExpressions(validateElement, validateXpathExpressions);
            }

            context.setXpathExpressions(validateXpathExpressions);
        }
    }
411544
protected ValidationMessage translateMessage(ConstraintViolation invalidValue) {
		return new DefaultValidationMessage(invalidValue.getPropertyPath().toString(), Severity.ERROR,
				resolveObjectName(invalidValue.getPropertyPath().toString()) + " " + invalidValue.getMessage());
	}
566320
public function getValidationMessage(): array{
        $fields = [];
        foreach ($this->validations as $validation) {
            /* @var Validation $validation */
            if ($validation->getStatus() == Validation::ERROR) {
                if (!isset($fields[$validation->getField()])) {
                    $fields[$validation->getField()] = [];
                }
                var_dump($validation->getMessage());
                array_push($fields[$validation->getField()], $validation->getMessage());
            }
        }
        return $fields;
    }
610257
private static void validateMessageText(String messageML) throws InvalidInputException {
    if (messageML == null) { throw new InvalidInputException("Message input is NULL"); }

    for (char ch : messageML.toCharArray()) {
      if (ch != '\n' && ch != '\r' && ch != '\t' && (ch < ' ')) {
        throw new InvalidInputException("Invalid control characters in message");
      }
    }
  }
898954
private Validator<ValueType> validateLeft() {
        Validator<ValueType> result = null;
        Collection<Validator<ValueType>> subValidators = onGetLeftErrorMessage();

        if (subValidators != null) {
            for (Validator<ValueType> validator : subValidators) {
                notifyOnValidationFailure(validator);

                if (result == null) {
                    result = validator;
                }
            }
        }

        for (Validator<ValueType> validator : validators) {
            if (!validator.validate(getValue())) {
                notifyOnValidationFailure(validator);

                if (result == null) {
                    result = validator;
                }
            }
        }

        return result;
    }
984111
public static void mapValidationMessageFieldNames(ValidationMessageV3[] validation_messages, String[] from, String[]
      to) {
    if (from == null && to == null)
      return;
    if (from == null || to == null)
      throw new IllegalArgumentException("Bad parameter name translation arrays; one is null and the other isn't.");
    Map<String, String> translations = new HashMap<>();
    for (int i = 0; i < from.length; i++) {
      translations.put(from[i], to[i]);
    }

    for (ValidationMessageV3 vm : validation_messages) {
      if (null == vm) {
        Log.err("Null ValidationMessageV3 for ModelBuilderSchema.");
        continue;
      }

      if (null == vm.field_name) {
        Log.err("Null field_name: " + vm);
        continue;
      }
      if (translations.containsKey(vm.field_name))
        vm.field_name = translations.get(vm.field_name);
    }
  }
981770
public function buildMessages(
        string $fieldName,
        ValidationResult $validationResult,
        array $messages = [],
        array $options = []
    ): array {
        if ($validationResult instanceof ValidationResultFields) {
            $options[Field::KEY_FIELD_NAME] = $fieldName;
            $subMessages = $this->buildMessagesValidationFields(
                $validationResult->getFieldResults(),
                [],
                $options
            );

            $messages = $this->flattenSubMessages(
                $fieldName,
                $subMessages,
                $messages
            );

            return $messages;
        }

        $options[Field::KEY_FIELD_NAME] = $fieldName;
        $messages[$fieldName] = $this->getMessagesValidationResult->__invoke(
            $validationResult,
            $options
        );

        return $messages;
    }
156666
public static ValidationException error(String messageKey, 
			Object... params) {
		return new ValidationException(
				ValidationMessage.error(messageKey, params));		
	}
1239228
@Nonnull
  protected static EValidity validateMessage (@Nonnull final String sMsg)
  {
    ValueEnforcer.notNull (sMsg, "Msg");

    return validateMessage (sMsg.toCharArray ());
  }
1109065
def generate_message_lengths_array(outf, msgs):
    """"""

    # form message lengths array
    lengths = []
    for msg in msgs:
        lengths.append("%u: %u" % (msg.id, msg.wire_length))

    t.write(outf, """


/**
    Message lengths array for known messages length validation
*/
private let messageLengths: [UInt8: UInt8] = [${ARRAY_CONTENT}]
""", {'ARRAY_CONTENT' : ", ".join(lengths)})