Tabnine Logo
ValidationException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.springframework.batch.item.validator.ValidationException
constructor

Best Java code snippets using org.springframework.batch.item.validator.ValidationException.<init> (Showing top 8 results out of 315)

origin: spring-projects/spring-batch

  @Override
  public Trade process(Trade item) throws Exception {
    if ((failedItem == null && index++ == failure) || (failedItem != null && failedItem.equals(item))) {
      failedItem = item;
      throw new ValidationException("Some bad data for " + failedItem);
    }
    return item;
  }
}
origin: spring-projects/spring-batch

@Override
public Exception getException(String msg) throws Exception {
  return new ValidationException(msg);
}
origin: spring-projects/spring-batch

@Override
public Exception getException(String msg, Throwable t) throws Exception {
  return new ValidationException(msg, t);
}
origin: spring-projects/spring-batch

/**
 * @see Validator#validate(Object)
 */
@Override
public void validate(T item) throws ValidationException {
  if (!validator.supports(item.getClass())) {
    throw new ValidationException("Validation failed for " + item + ": " + item.getClass().getName()
        + " class is not supported by validator.");
  }
  BeanPropertyBindingResult errors = new BeanPropertyBindingResult(item, "item");
  validator.validate(item, errors);
  if (errors.hasErrors()) {
    throw new ValidationException("Validation failed for " + item + ": " + errorsToString(errors), new BindException(errors));
  }
}
origin: spring-projects/spring-batch

  private String processFailedValidation(ValidatingItemProcessor<String> tested) {
    validator.validate(ITEM);
    when(validator).thenThrow(new ValidationException("invalid item"));

    return tested.process(ITEM);
  }
}
origin: SmartDataAnalytics/jena-sparql-api

@Override
public void validate(Quad quad) throws ValidationException {
  boolean isValid = predicate.apply(quad);
  if(!isValid) {
    throw new ValidationException("A quad failed validation: " + quad);
  }
}
origin: mminella/LearningSpringBatch

  @Override
  public void validate(Customer value) throws ValidationException {
    if(value.getFirstName().startsWith("A")) {
      throw new ValidationException("First names that begin with A are invalid: " + value);
    }
  }
}
origin: apache/servicemix-bundles

/**
 * @see Validator#validate(Object)
 */
@Override
public void validate(T item) throws ValidationException {
  if (!validator.supports(item.getClass())) {
    throw new ValidationException("Validation failed for " + item + ": " + item.getClass().getName()
        + " class is not supported by validator.");
  }
  BeanPropertyBindingResult errors = new BeanPropertyBindingResult(item, "item");
  validator.validate(item, errors);
  if (errors.hasErrors()) {
    throw new ValidationException("Validation failed for " + item + ": " + errorsToString(errors), new BindException(errors));
  }
}
org.springframework.batch.item.validatorValidationException<init>

Javadoc

Create a new ValidationException based on a message.

Popular methods of ValidationException

  • getCause
  • getMessage

Popular in Java

  • Making http post requests using okhttp
  • getExternalFilesDir (Context)
  • onCreateOptionsMenu (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now