フィールドの親のキーの候補を生成する。
@param objectName オブジェクト名
@param field フィールド
@return
164688
public String[] generateParentNameCodes(final String objectName, final String field) {
        
        if(Utils.isEmpty(field) || !field.contains(".")) {
            return generateObjectNameCodes(objectName);
        }
        
        // フィールド名の前の値を取得する
        final int dotIndex = field.lastIndexOf('.');
        final String subName = field.substring(0, dotIndex);
        return generateFieldNameCodes(objectName, subName);
        
    }
925117
@SuppressWarnings("Unchecked")
    public static Object checkImmutable(String className, String fieldName, Object field) {
        if (field == null || field instanceof Enum || inImmutableList(field.getClass().getName())) return field;
        if (field instanceof Collection) return DefaultGroovyMethods.asImmutable((Collection) field);
        if (field.getClass().getAnnotation(MY_CLASS) != null) return field;
        final String typeName = field.getClass().getName();
        throw new RuntimeException(createErrorMessage(className, fieldName, typeName, "constructing"));
    }
1190510
public static Field getAccessibleField(final Object obj, final String fieldName) {
		if(obj == null)
			throw new IllegalArgumentException("object cannot be null.");
		if(fieldName == null || fieldName.trim().length() == 0)
			throw new IllegalArgumentException("fieldName cannot be null.");
		for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) {
			try {
				Field field = superClass.getDeclaredField(fieldName);
				field.setAccessible(true);
				return field;
			} catch (NoSuchFieldException e) {//NOSONAR
				// Field不在当前类定义,继续向上转型
			}
		}
		return null;
	}
234801
protected String getMappedFieldName(Field field, @Nullable Class<?> domainType) {
		return getMappedFieldName(field.getName(), domainType);
	}
1135897
public static String javaOneofConstantName(Field field) {
        String name = field.getName();
        String underscored = Formatter.toUnderscoreCase(name);
        return Formatter.toUpperCase(underscored);
    }
478646
private Object getEntityFieldValue(EntityMetadata entityMetadata, Object entity, String field)
    {
        Class clazz = entityMetadata.getEntityClazz();
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                entityMetadata.getPersistenceUnit());
        EntityType entityType = metaModel.entity(clazz);

        if (field.indexOf(".") > 0 && entityMetadata.getEntityClazz().equals(entity.getClass()))
        {
            String fieldName = field.substring(field.indexOf(".") + 1, field.length());
            Attribute attribute = entityType.getAttribute(fieldName);
            return PropertyAccessorHelper.getObject(entity, (Field) attribute.getJavaMember());
        }
        else
        {
            // for hbase v2 client (sends arraylist for specific fields)
            if (entity instanceof ArrayList)
            {
                Object element = ((ArrayList) entity).get(0);
                ((ArrayList) entity).remove(0);
                return element;
            }
            else
            {
                return entity;
            }
        }
    }
107658
public static JsonArray getArray(JsonObject object, String field) {
        final JsonValue value = object.get(field);
        throwExceptionIfNull(value, field);
        return value.asArray();
    }
368255
private void writeObjectToField(String fieldname, Object value, Object object, Object alternative)
        throws Exception {
        Object target = object != null ? object : alternative;
        try {
            FieldUtils.writeField(target, fieldname, value, true);
        } catch (Exception e) {
            throw new IllegalArgumentException(String.format("Unable to write value '%s' to field '%s' of object %s",
                value.toString(), fieldname, target.getClass().getName()));
        }
    }
591119
String getterNameFor(Element field) {
        String methodNamePrefix = "get";
        if (field.asType().getKind() == TypeKind.BOOLEAN) {
            methodNamePrefix = "is";
        }
        return methodNamePrefix + NameUtils.capitalize(field.getSimpleName().toString());
    }
597760
public Collection<Object> getObjectReferenceList(String field, String schemaName) {
        List<String> instanceIds = references.get(field);
        if(instanceIds == null || instanceIds.size() == 0) {
            return null;
        }
        List<Object> objects = new ArrayList<>();
        for (String instanceId : instanceIds) {
            BeanId id = BeanId.create(instanceId, schemaName);
            Object instance = instances.get(id);
            if(instance != null) {
                objects.add(instance);
            } else {
                instance = cache.get(id);
                instances.put(id, instance);
                objects.add(instance);
            }
        }
        return objects;
    }
796864
@SuppressWarnings("unchecked")
	public static <S extends Serializable> S invokeGetter(Object object, Field field)
	{
		Method m = ReflectionUtils.findMethod(object.getClass(), ReflectUtils.toGetter(field.getName()));
		if (null == m) {
			for (String prefix : PREFIXES) {
				 m = ReflectionUtils.findMethod(object.getClass(), ReflectUtils.toGetter(field.getName(), prefix));
				 if (null != m) {
					 break;
				 }
			}
		}
		return (S) ReflectionUtils.invokeMethod(m, object);
	}
609393
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());
		}
	}
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());
                }
            }
        }
    }
416937
public static PropertyMetadata getPropertyMetadata(Field field) {
    Property property = field.getAnnotation(Property.class);
    // For fields that have @Property annotation, we expect both setter and
    // getter methods. For all other fields, we only treat them as
    // persistable if we find valid getter and setter methods.
    try {
      PropertyMetadata propertyMetadata = new PropertyMetadata(field);
      return propertyMetadata;
    } catch (NoAccessorMethodException | NoMutatorMethodException exp) {
      if (property != null) {
        throw exp;
      }
    }
    return null;
  }
686402
public static boolean setField(Object object, String fieldName, Object value) {
		char c = fieldName.charAt(0);

		if (c >= 'a' && c <= 'z') {
			c -= 'a' - 'A';
			fieldName = c + fieldName.substring(1);
		}

		String methodName = "set" + fieldName;
		Class<?>[] returnType = new Class<?>[1];
		Class<?> objectClass = object.getClass();

		Method getMethod = getMethod(objectClass, "get" + fieldName);

		if (getMethod == null) {
			getMethod = getMethod(objectClass, "is" + fieldName);
		}

		if (getMethod == null) {
			return false;
		}

		returnType[0] = getMethod.getReturnType();

		return silentInvoke(object, methodName, returnType, value);
	}
602170
public String[] generateCodes(final String code, final String objectName, final String field, final Class<?> fieldType) {
        
        final String baseCode = getPrefix().isEmpty() ? code : getPrefix() + code;
        final List<String> codeList = new ArrayList<>();
        final List<String> fieldList = new ArrayList<>();
        buildFieldList(field, fieldList);
        
        addCodes(codeList, baseCode, objectName, fieldList);
        
        if(Utils.isNotEmpty(field)) {
            int dotIndex = field.lastIndexOf('.');
            if(dotIndex > 0) {
                buildFieldList(field.substring(dotIndex + 1), fieldList);
            }
        }
        
        addCodes(codeList, code, null, fieldList);
        
        if(fieldType != null) {
            addCode(codeList, code, null, fieldType.getName());
            
            // 列挙型の場合は、java.lang.Enumとしてクラスタイプを追加する。
            if(Enum.class.isAssignableFrom(fieldType)) {
                addCode(codeList, code, null, Enum.class.getName());
            }
            
            // 数値型の場合は、java.lang.Numberとしてクラスタイプを追加する。
            if(Number.class.isAssignableFrom(fieldType)) {
                addCode(codeList, code, null, Number.class.getName());
            }
        }
        
        addCode(codeList, code, null, null);
        
        return codeList.toArray(new String[codeList.size()]);
    }
1081322
private Object getField(Object object, Field f) {
        f.setAccessible(true);
        try {
            return f.get(object);
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }