On id.

@param key
the key
@param attribute
the attribute
@param fieldValue
the field value
@return the object
961731
private Object onId(Object key, Attribute attribute, Object fieldValue)
    {
        if (SingularAttribute.class.isAssignableFrom(attribute.getClass()) && ((SingularAttribute) attribute).isId())
        {
            key = fieldValue;
        }
        return key;
    }
1052319
public <H,R> Map<String,AttributeValue> convertKey(final T key) {
        final DynamoDBMapperFieldModel<T,H> hk = this.<H>hashKey();
        final DynamoDBMapperFieldModel<T,R> rk = this.<R>rangeKeyIfExists();
        return this.<H,R>convertKey(hk.get(key), (rk == null ? (R)null : rk.get(key)));
    }
40992
public static <T> T getPropertyValue(final Object instance, final String fieldName) {
		try {
			return (T) PropertyUtils.getProperty(instance, fieldName);
		} catch (final Exception e) {
			throw new RuntimeException(e);
		}
	}
1064982
protected final String getValue(final String key, final FieldCase ca) throws IdNotFoundException {
		ConstraintFactory f = generator.getConstraintFactory();
		String value = f.getModel(key).initValues(ca);
		if (value == null) {
			return "";
		}
		return value;
	}
964524
protected AttributeConfig parseAttributeValue(String fieldType, String name, Object value) {
		value = parseValue(fieldType, value);
		if (value != null) {
			AttributeConfig attributeConfig = new AttributeConfig();
			attributeConfig.setName(name);
			attributeConfig.setValue(value.toString());
			return attributeConfig;
		}
		return null;
	}
146855
public CMAEntry setField(String key, String locale, Object value) {
    if (fields == null) {
      fields = new LinkedHashMap<String, LinkedHashMap<String, Object>>();
    }

    LinkedHashMap<String, Object> field = fields.get(key);
    if (field == null) {
      field = new LinkedHashMap<String, Object>();
    }

    field.put(locale, value);
    fields.put(key, field);
    return this;
  }
91723
@SuppressWarnings("nullness")
  private static String attributeValueToString(AttributeValue attributeValue) {
    return attributeValue.match(
        returnToString,
        returnToString,
        returnToString,
        returnToString,
        Functions.<String>returnConstant(""));
  }
55457
public Object getAttribute(String key, Object defaultValue)
    {
        Object attributeValue = getUserAttribute(key, null);
        if (attributeValue != null)
            return attributeValue;
        attributeValue = getSessionAttribute(key, null);
        if (attributeValue != null)
            return attributeValue;
        return defaultValue;
    }
357190
public static Object getFieldValue(Field field, Object obj) {
    try {
      return field.get(obj);
    } catch (IllegalAccessException e) {
      throw new IllegalArgumentException(e);
    }
  }
1178141
public static Object getValue(Object obj, String field) {
        Method getter = getGetterMethod(obj.getClass(), field);

        try {
            return getter.invoke(obj);
        } catch (IllegalAccessException | InvocationTargetException e) {
            return null;
        }
    }
544578
public void setField(Object o, String fieldName, Object newValue) {
        if (o == null) {
            throw new IllegalArgumentException("No object to set on provided");
        }
        Field field = findField(o, fieldName);
        if (field == null) {
            throw new IllegalArgumentException(o.getClass() + " does not have a field " + fieldName);
        } else {
            if (!field.isAccessible()) {
                field.setAccessible(true);
            }
            try {
                field.set(o, newValue);
            } catch (IllegalAccessException e) {
                throw new IllegalArgumentException("Unable to set " + newValue + " for " + fieldName, e);
            }
        }
    }
1299276
private Object getObjectValue(XmlNode node, String fieldName) {
        // we have to take into account the fact that fieldName will be in the lower case
        if (node != null) {
            String name = node.getName();
            switch (node.getType()) {
                case XmlNode.ATTRIBUTE_NODE:
                    return name.equalsIgnoreCase(fieldName) ? node : null;
                case XmlNode.ELEMENT_NODE: {
                    if (name.equalsIgnoreCase(fieldName)) {
                        return new XmlNodeArray(node.getChildren());
                    } else {
                        Map<String, XmlNode> attributes = node.getAttributes();
                        for (Map.Entry<String, XmlNode> entry : attributes.entrySet()) {
                            String attributeName = entry.getKey();
                            if (attributeName.equalsIgnoreCase(fieldName)) {
                                return entry.getValue();
                            }
                        }
                        return null;
                    }
                }
                default:
                    return null;
            }
        }
        return null;
    }
981799
public Object getFieldValueByType(Object fieldValue) throws Exception {
        return ClassUtils.getValeByType(field.getType(), fieldValue);
    }
801787
private String getValue(String attribute)
    {
        Check.notNull(attribute);

        if (root.hasAttribute(attribute))
        {
            return root.getAttribute(attribute);
        }
        throw new LionEngineException(ERROR_ATTRIBUTE + attribute);
    }
131505
public void putAttribute(String key, AttributeValue value) {
    // Not final because for performance reasons we want to override this in the implementation.
    // Also a default implementation is needed to not break the compatibility (users may extend this
    // for testing).
    Utils.checkNotNull(key, "key");
    Utils.checkNotNull(value, "value");
    putAttributes(Collections.singletonMap(key, value));
  }
307063
@Override
    public void setAttribute(String key, Object value) {
        if (value == null) {
            setAttribute(key, null);
        } else {
            setAttribute(key, Collections.singletonList(value));
        }
    }
32535
public static <T extends Object> T getFieldValue(Object obj, String fieldName) {
        Assert.notNull(obj, "obj不能为空");
        Assert.notNull(fieldName, "fieldName不能为空");

        Field field;
        if (obj instanceof Class) {
            field = getField((Class) obj, fieldName);
        } else {
            field = getField(obj.getClass(), fieldName);
        }

        return getFieldValue(obj, field);
    }