// Path: core/src/main/java/net/sf/beanlib/BeanlibException.java
// public class BeanlibException extends RuntimeException {
// 
//     private static final long serialVersionUID = 1;
// 
//     public BeanlibException() {}
// 
//     public BeanlibException(String message) {
//         super(message);
//     }
// 
//     public BeanlibException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public BeanlibException(Throwable cause) {
//         super(cause);
//     }
// }


import java.lang.reflect.Method;
import org.slf4j.Logger;
import net.sf.beanlib.BeanlibException;
/*
 * Copyright 2007 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License")
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.sf.beanlib.spi;




/**
 * Adapter class for {@link BeanPopulationExceptionHandler}.
 *
 * @author Joe D. Velopar
 */
public class BeanPopulationExceptionHandlerAdapter implements BeanPopulationExceptionHandler {

    protected String propertyName;

    protected Object fromBean;

    protected Method readerMethod;

    protected Object toBean;

    protected Method setterMethod;

    @Override
    public void handleException(Throwable t, Logger log) {
        log.error("\n" + "propertyName=" + propertyName + "\n" + "readerMethod=" + readerMethod + "\n" + "setterMethod=" + setterMethod + "\n"
                + "fromBean=" + fromBean + "\n" + "toBean=" + toBean + "\n", t);

        if (t instanceof RuntimeException) {
            throw (RuntimeException) t;
        }
        if (t instanceof Error) {
            throw (Error) t;
        }
// Path: core/src/main/java/net/sf/beanlib/BeanlibException.java
// public class BeanlibException extends RuntimeException {
// 
//     private static final long serialVersionUID = 1;
// 
//     public BeanlibException() {}
// 
//     public BeanlibException(String message) {
//         super(message);
//     }
// 
//     public BeanlibException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public BeanlibException(Throwable cause) {
//         super(cause);
//     }
// }


// Path: core/src/main/java/net/sf/beanlib/spi/BeanPopulationExceptionHandlerAdapter.java
import java.lang.reflect.Method;
import org.slf4j.Logger;
import net.sf.beanlib.BeanlibException;

/*
 * Copyright 2007 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License")
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.sf.beanlib.spi;




/**
 * Adapter class for {@link BeanPopulationExceptionHandler}.
 *
 * @author Joe D. Velopar
 */
public class BeanPopulationExceptionHandlerAdapter implements BeanPopulationExceptionHandler {

    protected String propertyName;

    protected Object fromBean;

    protected Method readerMethod;

    protected Object toBean;

    protected Method setterMethod;

    @Override
    public void handleException(Throwable t, Logger log) {
        log.error("\n" + "propertyName=" + propertyName + "\n" + "readerMethod=" + readerMethod + "\n" + "setterMethod=" + setterMethod + "\n"
                + "fromBean=" + fromBean + "\n" + "toBean=" + toBean + "\n", t);

        if (t instanceof RuntimeException) {
            throw (RuntimeException) t;
        }
        if (t instanceof Error) {
            throw (Error) t;
        }
        throw new BeanlibException(t);