All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.coode.oppl.exceptions.CollectRuntimeExceptionHandler Maven / Gradle / Ivy

package org.coode.oppl.exceptions;

import java.util.HashSet;
import java.util.Set;
import java.util.regex.PatternSyntaxException;

import org.semanticweb.owlapi.model.OWLRuntimeException;

/** This implementation collects all the run-time exception raised.
 * 
 * @author Luigi Iannone */
public class CollectRuntimeExceptionHandler implements RuntimeExceptionHandler {
    private final Set exceptions = new HashSet();

    @Override
    public void handleOWLRuntimeException(OWLRuntimeException e) {
        handleRuntimeException(e);
    }

    private void handleRuntimeException(RuntimeException e) {
        exceptions.add(e);
    }

    @Override
    public void handlePatternSyntaxExcpetion(PatternSyntaxException e) {
        handleRuntimeException(e);
    }

    @Override
    public void handleException(RuntimeException e) {
        handleRuntimeException(e);
    }

    /** @return the exceptions */
    public Set getExceptions() {
        return new HashSet(exceptions);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy