typemismatchexception.java

来自「数据仓库展示程序」· Java 代码 · 共 43 行

JAVA
43
字号
package javax.jmi.reflect;

/** Thrown to indicate that provided parameter or element of collection is
 * is of wrong type.
 */
public class TypeMismatchException extends JmiException {

    private final Class expectedType;

    /**
     * Constructs an <code>TypeMismatchException</code> without detail message.
     * @param expectedType class of expected type.
     * @param objectInError value that caused this exception.
     * @param elementInError Attribute, Reference, Parameter or AssociationEnd for the value that is in error.
     */
    public TypeMismatchException(Class expectedType, Object objectInError, RefObject elementInError) {
        super(objectInError, elementInError);
        this.expectedType = expectedType;
    }

    /**
     * Constructs an <code>TypeMismatchException</code> with the specified detail message.
     * @param expectedType class of expected type.
     * @param objectInError value that caused this exception.
     * @param elementInError Attribute, Reference, Parameter or AssociationEnd for the value that is in error.
     * @param msg the detail message.
     */
    public TypeMismatchException(Class expectedType, Object objectInError, RefObject elementInError, String msg) {
        super(objectInError, elementInError, msg);
        this.expectedType = expectedType;
    }

    /**
     * Returns class of expected type.
     * @return expected type.
     */
    public Class getExpectedType() {
        return expectedType;
    }
}


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?