class LimitCheckingItemSkipPolicy implements SkipPolicy {

	private long skipLimit;

	private Classifier<Throwable, Boolean> skippableExceptionClassifier;

	/**
	 * Convenience constructor that assumes all exception types are fatal.
	 */
	public LimitCheckingItemSkipPolicy() {
		this(0, Collections.<Class<? extends Throwable>, Boolean>emptyMap());
	}

	/**
	 * @param skipLimit the number of skippable exceptions that are allowed to be skipped
	 * @param skippableExceptions exception classes that can be skipped (non-critical)
	 */
	public LimitCheckingItemSkipPolicy(int skipLimit, Map<Class<? extends Throwable>, Boolean> skippableExceptions) {
		this(skipLimit, new BinaryExceptionClassifier(skippableExceptions));
	}

	/**
	 * @param skipLimit the number of skippable exceptions that are allowed to be skipped
	 * @param skippableExceptionClassifier exception classifier for those that can be
	 * skipped (non-critical)
	 */
	public LimitCheckingItemSkipPolicy(int skipLimit, Classifier<Throwable, Boolean> skippableExceptionClassifier) {
		this.skipLimit = skipLimit;
		this.skippableExceptionClassifier = skippableExceptionClassifier;
	}

	/**
	 * The absolute number of skips (of skippable exceptions) that can be tolerated before
	 * a failure.
	 * @param skipLimit the skip limit to set
	 */
	public void setSkipLimit(long skipLimit) {
		this.skipLimit = skipLimit;
	}

	/**
	 * The classifier that will be used to decide on skippability. If an exception
	 * classifies as "true" then it is skippable, and otherwise not.
	 * @param skippableExceptionClassifier the skippableExceptionClassifier to set
	 */
	public void setSkippableExceptionClassifier(Classifier<Throwable, Boolean> skippableExceptionClassifier) {
		this.skippableExceptionClassifier = skippableExceptionClassifier;
	}

	/**
	 * Set up the classifier through a convenient map from throwable class to boolean
	 * (true if skippable).
	 * @param skippableExceptions the skippable exceptions to set
	 */
	public void setSkippableExceptionMap(Map<Class<? extends Throwable>, Boolean> skippableExceptions) {
		this.skippableExceptionClassifier = new BinaryExceptionClassifier(skippableExceptions);
	}

	/**
	 * Given the provided exception and skip count, determine whether or not processing
	 * should continue for the given exception. If the exception is not classified as
	 * skippable in the classifier, false will be returned. If the exception is classified
	 * as skippable and {@link StepExecution} skipCount is greater than the skipLimit,
	 * then a {@link SkipLimitExceededException} will be thrown.
	 */
	@Override
	public boolean shouldSkip(Throwable t, long skipCount) {<FILL_FUNCTION_BODY>}

}

		if (skippableExceptionClassifier.classify(t)) {
			if (skipCount < skipLimit) {
				return true;
			}
			else {
				throw new SkipLimitExceededException(skipLimit, t);
			}
		}
		else {
			return false;
		}
	
<no_super_class>