Example usage for org.apache.commons.jcs.access.exception InvalidArgumentException InvalidArgumentException

List of usage examples for org.apache.commons.jcs.access.exception InvalidArgumentException InvalidArgumentException

Introduction

In this page you can find the example usage for org.apache.commons.jcs.access.exception InvalidArgumentException InvalidArgumentException.

Prototype

public InvalidArgumentException(String message) 

Source Link

Document

Constructor for the InvalidArgumentException object.

Usage

From source file:org.openstreetmap.josm.plugins.conflation.config.parser.InstanceConstructor.java

/**
 * Create an InstarnceConstructor description.
 * @param type The type being constructed
 * @param description Description/*from w ww.j  a v  a  2 s  . co  m*/
 * @param paramsDescriptipon Constructor parameters descriptions.
 * @param varArgsTypes Types of the variable arguments (last Object[] parameter) if they must be forced.
 * @param varArgsDescriptions Descriptions of the variable arguments (last Object[] parameter) if they must be forced.
 */
public InstanceConstructor(Class<?> type, String name, String description, String[] paramsDescriptipon,
        Class<?>[] varArgsTypes, String[] varArgsDescriptions) {
    this.type = type;
    this.name = (name != null) ? name : type.getSimpleName();
    this.constructor = getLargestPublicConstructor(type);
    this.description = description;
    this.paramsDescriptipon = paramsDescriptipon;
    this.varrgsTypes = varArgsTypes;
    this.varArgsDescriptions = varArgsDescriptions;
    if (constructor == null)
        throw new InvalidArgumentException("No Public constructor found");
    if (constructor.getParameterCount() != paramsDescriptipon.length)
        throw new InvalidArgumentException(
                type.getSimpleName() + " paramDescription.length is != " + constructor.getParameterCount());
    if (varArgsTypes != null) {
        Class<?>[] paramTypes = constructor.getParameterTypes();
        assert (paramTypes[paramTypes.length - 1].isArray());
    }

}