Example usage for org.apache.commons.lang3.reflect ExtendedFieldUtils readTypedField

List of usage examples for org.apache.commons.lang3.reflect ExtendedFieldUtils readTypedField

Introduction

In this page you can find the example usage for org.apache.commons.lang3.reflect ExtendedFieldUtils readTypedField.

Prototype

public static final <T> T readTypedField(Field field, Object target, Class<T> valType)
            throws IllegalAccessException 

Source Link

Usage

From source file:org.apache.sshd.common.file.nativefs.ExtendedNativeFileSystemView.java

public final String getUsername() {
    try {//from w  w w. ja v  a2  s . c om
        return ExtendedFieldUtils.readTypedField(userNameField, this, String.class);
    } catch (IllegalAccessException e) {
        throw new IllegalStateException(
                "Failed (" + e.getClass().getSimpleName() + ") to read userName: " + e.getMessage(), e);
    }
}

From source file:org.apache.sshd.common.file.nativefs.ExtendedNativeFileSystemView.java

public final String getCurrDir() {
    try {/*from www  .j av a  2  s  .  c  om*/
        return ExtendedFieldUtils.readTypedField(currDirField, this, String.class);
    } catch (IllegalAccessException e) {
        throw new IllegalStateException(
                "Failed (" + e.getClass().getSimpleName() + ") to read currDir: " + e.getMessage(), e);
    }
}

From source file:org.apache.sshd.common.file.nativefs.ExtendedNativeFileSystemView.java

public final boolean isCaseSensitive() {
    try {//from  w  w  w.ja  va 2  s .  co  m
        return ExtendedFieldUtils.readTypedField(caseInsensitiveField, this, Boolean.class).booleanValue();
    } catch (IllegalAccessException e) {
        throw new IllegalStateException(
                "Failed (" + e.getClass().getSimpleName() + ") to read currDir: " + e.getMessage(), e);
    }
}