title: Spring - Instantiating an Errors object
body: <p>I have a method like this:</p>
  
  <pre><code>public boolean validateMessage(String message, Errors errors) {
    if (!StringUtils.hasLength(message)) {
      errors.rejectValue(wrapperName + "message", "EMPTY_MESSAGE", EMPTY_MESSAGE_ERRORMSG) ;
              return false ;
          }
          return true ;
      }
  </code></pre>
  
  <p>I want to call this method with a new <code>Errors</code> object, like:</p>
  
  <pre><code>boolean result = validateMessage("hi", new Errors()) ;
  </code></pre>
  
  <p>However, this kind of instantiation is not allowed for <code>Errors</code>. Please advice.</p>
  
  <p>If not with <code>Errors</code>, can I achieve this using an empty (new) <code>BindingResult</code></p>