Example usage for org.apache.solr.client.solrj.beans BindingException BindingException

List of usage examples for org.apache.solr.client.solrj.beans BindingException BindingException

Introduction

In this page you can find the example usage for org.apache.solr.client.solrj.beans BindingException BindingException.

Prototype

public BindingException(String message, Throwable cause) 

Source Link

Usage

From source file:edu.vt.vbi.patric.common.DocumentMapBinder.java

License:Apache License

private <T> T getBean(Class<T> clazz, List<DocField> fields, Map solrDoc) {
    if (fields == null) {
        fields = getDocFields(clazz);//w w w  .  j  a va 2s . c  om
    }

    try {
        T obj = clazz.newInstance();
        for (DocField docField : fields) {
            docField.inject(obj, solrDoc);
        }
        return obj;
    } catch (Exception e) {
        throw new BindingException("Could not instantiate object of " + clazz, e);
    }
}