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

org.klojang.invoke.Private Maven / Gradle / Ivy

Go to download

Klojang Invoke is a Java module focused on path-based object access and dynamic invocation. Its central classes are the Path class and the PathWalker class. The Path class captures a path through an object graph. For example "employee.address.city". The PathWalker class lets you read from and write to a wide variety of types using Path objects.

The newest version!
package org.klojang.invoke;

import org.klojang.util.InvokeException;

import static org.klojang.util.ClassMethods.simpleClassName;
import static org.klojang.util.ExceptionMethods.getRootCause;

final class Private {

  static final String INCLUDE_EXCLUDE = "includeExclude";
  static final String PROPERTIES = "properties";
  static final String BEAN_CLASS = "beanClass";
  static final String TRANSFORMER = "transformer";
  static final String SOURCE_BEAN = "source bean";
  static final String TARGET_BEAN = "target bean";
  static final String SOURCE_MAP = "source map";
  static final String CONVERTER = "converter";

  static InvokeException wrap(Throwable t, Object bean, Getter getter) {
    String msg = String.format("Error while reading %s.%s: %s",
          simpleClassName(bean),
          getter.getProperty(),
          getRootCause(t));
    return new InvokeException(msg);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy