Gets getter method.

@param c     the c
@param field the field
@return the getter method
488104
public static Method getGetterMethod(Class<?> c, String field) {

        try {
            return c.getMethod(getMethodName(field, GET_METHOD_PREFIX), EMPTY_CLASS);
        } catch (NoSuchMethodException e) {
            try {
                return c.getMethod(getMethodName(field, IS_METHOD_PREFIX), EMPTY_CLASS);
            } catch (NoSuchMethodException e1) {
                //log.info("getter method not found : " + field);
                return null;
            }
        }
    }
26882
public static String javaRepeatedEnumValueGetterByIndexName(Field field) {
        if (field.isRepeated()) {
            return GETTER_PREFIX + Formatter.toPascalCase(field.getName()) + VALUE;
        }
        throw new IllegalArgumentException(field.toString());
    }
107377
@SuppressWarnings("unchecked")
  public static <T, O> O getFieldValue(Class<T> clz, T t, String fieldName) throws NoSuchFieldException {
    Field field = clz.getDeclaredField(fieldName);
    field.setAccessible(true);
    try {
      return (O) field.get(t);
    } catch (IllegalAccessException e) {
      throw new IllegalStateException(e);
    }
  }
20004
public CustomField getCustomField(FieldType field)
   {
      CustomField result = m_configMap.get(field);
      if (result == null)
      {
         result = new CustomField(field, this);
         m_configMap.put(field, result);
      }
      return result;
   }
776813
public static <C> PortableFieldAccess<C> get(Field f) {
		
		Class<?> type = (Class<?>) f.getType();
		
		if (type.isPrimitive()) {
			if (java.lang.Boolean.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableBooleanFieldAccess<C>(f);
			} else if (java.lang.Byte.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableByteFieldAccess<C>(f);
			} else if (java.lang.Character.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableCharFieldAccess<C>(f);
			} else if (java.lang.Short.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableShortFieldAccess<C>(f);
			} else if (java.lang.Integer.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableIntFieldAccess<C>(f);
			} else if (java.lang.Long.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableLongFieldAccess<C>(f);
			} else if (java.lang.Float.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableFloatFieldAccess<C>(f);
			} else if (java.lang.Double.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableDoubleFieldAccess<C>(f);
			}
		}
		return new PortableFieldAccess<C>(f);
	}
1247742
public AccrueType getAccrueType(int field)
   {
      AccrueType result;

      if ((field < m_fields.length) && (m_fields[field].length() != 0))
      {
         result = AccrueTypeUtility.getInstance(m_fields[field], m_locale);
      }
      else
      {
         result = null;
      }

      return (result);
   }
1263726
public static final String getter(Field field, String fieldName)
    {
        Class<?> type = field.getType();
        if (type.isPrimitive() && "boolean".equals(type.getName()))
        {
            return isser(fieldName);
        }
        else
        {
            return getter(fieldName);
        }
    }
1282050
private Class<?> getUnderlyingType(final Field field) {
        if (isCollectionField(field)) {
            final ParameterizedType clazz = (ParameterizedType) (field.getGenericType());
            final Type[] genericTypes = clazz.getActualTypeArguments();
            if (genericTypes.length != 1) {
                throw new CommandLineException.CommandLineParserInternalException("Strange collection type for field " +
                        field.getName());
            }
            return (Class) genericTypes[0];

        } else {
            final Class<?> type = field.getType();
            if (type == Byte.TYPE) return Byte.class;
            if (type == Short.TYPE) return Short.class;
            if (type == Integer.TYPE) return Integer.class;
            if (type == Long.TYPE) return Long.class;
            if (type == Float.TYPE) return Float.class;
            if (type == Double.TYPE) return Double.class;
            if (type == Boolean.TYPE) return Boolean.class;

            return type;
        }
    }
1336617
private Field getFieldRecursive(Class c, String name) throws NoSuchFieldException
    {
        try
        {
            return c.getDeclaredField(name);
        }
        catch (NoSuchFieldException e)
        {
            // if field  could not be found in the inheritance hierarchy, signal error
            if ((c == Object.class) || (c.getSuperclass() == null) || c.isInterface())
            {
                throw e;
            }
            // if field could not be found in class c try in superclass
            else
            {
                return getFieldRecursive(c.getSuperclass(), name);
            }
        }
    }
877797
public static <S extends Serializable> S invokeGetter(Object object, String fieldName)
	{
		Field field = ReflectionUtils.findField(object.getClass(), fieldName);
		return invokeGetter(object, field);
	}
502366
static public int getStart(int field) {

        Integer iObject = (Integer) starts.get(new Integer(field));

        if (iObject == null) {
            throw new IllegalArgumentException(
                RB.singleton.getString(RB.UNEXPECTED_HEADER_KEY, field));
        }

        return iObject.intValue();
    }
199330
public static String mapGetByKeyMethodName(Field field) {
        if (field.isMap()) {
            return GETTER_PREFIX + Formatter.toPascalCase(field.getName());
        }
        throw new IllegalArgumentException(field.toString());
    }
338268
private static MethodRef getGetterMethod(FieldDescriptor descriptor) {
    Preconditions.checkArgument(
        !descriptor.isExtension(), "extensions do not have getter methods. %s", descriptor);
    TypeInfo message = messageRuntimeType(descriptor.getContainingType());
    boolean isProto3Enum = isProto3EnumField(descriptor);
    return MethodRef.createInstanceMethod(
            message,
            new Method(
                "get"
                    + getFieldName(descriptor, true)
                    // For proto3 enums we access the Value field
                    + (isProto3Enum ? "Value" : ""),
                isProto3Enum ? Type.INT_TYPE : getRuntimeType(descriptor),
                NO_METHOD_ARGS))
        // All protos are guaranteed to never return null
        .asNonNullable()
        .asCheap();
  }
115446
@SuppressWarnings("unchecked")
    public static <T> T getValue(Field field, Object self) {
        try {
            return (T) field.get(self);
        } catch (IllegalAccessException e) {
            throw ShedException.wrap(e, ShedErrorCode.UNABLE_TO_GET_FIELD)
                    .put("field", field.toGenericString());
        }
    }
1047668
public String getField(String field) {
        HashMap map = fields;
        StringTokenizer tk = new StringTokenizer(field, ".");
        if (!tk.hasMoreTokens())
            return null;
        while (true) {
            String s = tk.nextToken();
            Object obj = map.get(s);
            if (obj == null)
                return null;
            if (tk.hasMoreTokens()) {
                if (obj instanceof HashMap)
                    map = (HashMap)obj;
                else
                    return null;
            }
            else {
                if (obj instanceof HashMap)
                    return null;
                else {
                    if (((PdfObject)obj).isString())
                        return ((PdfString)obj).toUnicodeString();
                    else
                        return PdfName.decodeName(obj.toString());
                }
            }
        }
    }
329472
public static Type getType(Field field) {
		if (null == field) {
			return null;
		}
		Type type = field.getGenericType();
		if (null == type) {
			type = field.getType();
		}
		return type;
	}
1178177
private Object getFieldValue(final Field field) {
        Object field_value = AccessController.doPrivileged(new PrivilegedAction<Object>() {
            @Override
            public Object run() {
                try {
                    Object value = field.get(_member);

                    // Don't dump sensitive data
                    boolean sensitive = _member.getClass().isAnnotationPresent(Sensitive.class) || field.isAnnotationPresent(Sensitive.class);
                    if (value != null && sensitive) {
                        value = DataFormatHelper.sensitiveToString(value);
                    }

                    return value;
                } catch (IllegalAccessException e) {
                    // No FFDC code needed - we're in the middle of FFDC'ing!
                    // Should not happen - if it does return a string :-)
                    return "/* Could not access " + field.getName() + " */";
                }
            }
        });
        return field_value;
    }