Example usage for java.lang IllegalAccessException getMessage

List of usage examples for java.lang IllegalAccessException getMessage

Introduction

In this page you can find the example usage for java.lang IllegalAccessException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:$.Reflections.java

/**
     * , private/protected, ??setter.//from  w  ww  .j av  a 2s . com
     */
    public static void setFieldValue(final Object obj, final String fieldName, final Object value) {
        Field field = getAccessibleField(obj, fieldName);

        if (field == null) {
            throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + obj + "]");
        }

        try {
            field.set(obj, value);
        } catch (IllegalAccessException e) {
            logger.error("??:{}", e.getMessage());
        }
    }

From source file:org.apdplat.platform.util.ReflectionUtils.java

/**
 * ?,private/protected,??getter./*  ww w  .  j  a v  a 2s .  c o m*/
 */
public static Object getFieldValue(final Object object, final Field field) {
    makeAccessible(field);

    Object result = null;
    try {
        result = field.get(object);
    } catch (IllegalAccessException e) {
        LOG.error("??{}", e.getMessage());
    }
    return result;
}

From source file:$.Reflections.java

/**
     * ?, private/protected, ??getter.//ww w .  j  a v  a2  s.c o  m
     */
    public static Object getFieldValue(final Object obj, final String fieldName) {
        Field field = getAccessibleField(obj, fieldName);

        if (field == null) {
            throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + obj + "]");
        }

        Object result = null;
        try {
            result = field.get(obj);
        } catch (IllegalAccessException e) {
            logger.error("??{}", e.getMessage());
        }
        return result;
    }

From source file:com.wsun.seap.common.utils.ReflectionsUtil.java

/**
 * ?, private/protected, ??getter.// ww w . j  a v  a  2 s  . co  m
 */
public static Object getFieldValue(final Object obj, final String fieldName) {
    Field field = getAccessibleField(obj, fieldName);
    if (field == null) {
        throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + obj + "]");
    }
    Object result = null;
    try {
        result = field.get(obj);
    } catch (IllegalAccessException e) {
        logger.error("??{}", e.getMessage());
    }
    return result;
}

From source file:com.vanstone.common.util.ReflectionUtils.java

/**
 * , private/protected, ??setter.//w w  w .  j av  a  2  s  .  com
 */
public static void setFieldValue(final Object object, final String fieldName, final Object value) {
    Field field = getDeclaredField(object, fieldName);

    if (field == null) {
        throw new IllegalArgumentException(
                "Could not find field [" + fieldName + "] on target [" + object + "]");
    }

    makeAccessible(field);

    try {
        field.set(object, value);
    } catch (IllegalAccessException e) {
        LOG.error("??:{}" + e.getMessage());
    }
}

From source file:com.simple.core.util.Reflections.java

/**
 * ???, ??private/protected, ?etter?./*from w ww .  j  a  v  a2  s.c o  m*/
 */
public static void setFieldValue(final Object obj, final String fieldName, final Object value) {
    Field field = getAccessibleField(obj, fieldName);

    if (field == null) {
        throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + obj + "]");
    }

    try {
        field.set(obj, value);
    } catch (IllegalAccessException e) {
        logger.error("??:{}", e.getMessage());
    }
}

From source file:com.vanstone.common.util.ReflectionUtils.java

/**
 * ?, private/protected, ??getter./*from ww w .  j  ava2s  .  c  om*/
 */
public static Object getFieldValue(final Object object, final String fieldName) {
    Field field = getDeclaredField(object, fieldName);

    if (field == null) {
        throw new IllegalArgumentException(
                "Could not find field [" + fieldName + "] on target [" + object + "]");
    }

    makeAccessible(field);

    Object result = null;
    try {
        result = field.get(object);
    } catch (IllegalAccessException e) {
        LOG.error("??{}" + e.getMessage());
    }
    return result;
}

From source file:com.simple.core.util.Reflections.java

/**
 * ??, ??private/protected, ?etter?.//  w w  w .j  a  va  2 s. com
 */
public static Object getFieldValue(final Object obj, final String fieldName) {
    Field field = getAccessibleField(obj, fieldName);

    if (field == null) {
        throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + obj + "]");
    }

    Object result = null;
    try {
        result = field.get(obj);
    } catch (IllegalAccessException e) {
        logger.error("??{}", e.getMessage());
    }
    return result;
}

From source file:com.cnksi.core.tools.utils.Reflections.java

/**
 * , private/protected, ??setter.//w w w . j a  v  a 2  s  .  c  o  m
 */
public static void setFieldValue(final Object obj, final String fieldName, final Object value) {

    Field field = getAccessibleField(obj, fieldName);

    if (field == null) {
        throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + obj + "]");
    }

    try {
        field.set(obj, value);
    } catch (IllegalAccessException e) {
        logger.error("??:{}", e.getMessage());
    }
}

From source file:com.cnksi.core.tools.utils.Reflections.java

/**
 * ?, private/protected, ??getter.//w  ww .ja v a 2 s .  c o  m
 */
public static Object getFieldValue(final Object obj, final String fieldName) {

    Field field = getAccessibleField(obj, fieldName);

    if (field == null) {
        throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + obj + "]");
    }

    Object result = null;
    try {
        result = field.get(obj);
    } catch (IllegalAccessException e) {
        logger.error("??{}", e.getMessage());
    }
    return result;
}