Retrieves the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage.

@param object The object to get the attribute from
@param attribute The name of the attribute
@return The attribute value
186417
public Object getAttribute(Object object, String attribute) {
        return getAttribute(theClass, object, attribute, false, false);
    }
241657
public static Object getFieldValue(Object object, String fieldName) throws NoSuchFieldException {
        Field field = getDeclaredField(object, fieldName);
        if (!field.isAccessible()) {
            field.setAccessible(true);
        }

        Object result = null;
        try {
            result = field.get(object);
        } catch (IllegalAccessException e) {
            logger.error("不可能抛出的异常{}", e.getMessage());
        }
        return result;
    }
60724
@Override
    public synchronized Object getAttribute(Object name) {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
            String s = name + appNameAndIdString;
            LoggingUtil.SESSION_LOGGER_CORE.entering(methodClassName, methodNames[GET_ATTRIBUTE], s);
        }
        Object o = _attributes.get(name);
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            if (!SessionManagerConfig.isHideSessionValues()) {
                LoggingUtil.SESSION_LOGGER_CORE.exiting(methodClassName, methodNames[GET_ATTRIBUTE], o);
            } else {
                LoggingUtil.SESSION_LOGGER_CORE.exiting(methodClassName, methodNames[GET_ATTRIBUTE]);
            }
        }
        return o;
    }
814230
public static Object getFieldValue(Object instance, String fieldName) {
		try {
			return PropertyUtils.getProperty(instance, fieldName);
		} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
			JK.throww(e);
			return null;
		}
	}
232969
public Object getAttribute(File file, String view, String attribute) {
    Object value = getAttributeInternal(file, view, attribute);
    if (value == null) {
      throw new IllegalArgumentException("invalid attribute for view '" + view + "': " + attribute);
    }
    return value;
  }
277068
public Object getAttribute(String attributeName) {

        if (m_attributeMap == null) {
            return null;
        }
        return m_attributeMap.get(attributeName);
    }
1046673
public T findOneByAttribute(String attribute, Object value) {
        CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
        CriteriaQuery<T> query = cb.createQuery(getEntityClass());
        Root<T> from = query.from(getEntityClass());

        query.where(cb.equal(from.get(attribute), value));

        try {
            return getEntityManager().createQuery(query).getSingleResult();
        } catch (NoResultException e) {
            return null;
        }
    }
1054013
private static Object getFieldValue(FieldClassValue fieldClassValue, Object obj) {
        try {
            return fieldClassValue.get(obj.getClass()).get(obj);
        } catch (IllegalAccessException e) {
            // FieldClassValueFactory returns ClassValue that make the Field
            // accessible, so this should not happen.
            throw new IllegalStateException(e);
        }
    }
1200157
@Override
	public String getAttributeValue(String namespace, String name) {
		for (int i = (attributeCount * 4) - 4; i >= 0; i -= 4) {
			if (attributes[i + 2].equals(name) && (namespace == null || attributes[i].equals(namespace))) {
				return attributes[i + 3];
			}
		}

		return null;
	}
987879
public static Field getField(String fieldName, Object object) {
    return getField(fieldName, object.getClass());
  }
331333
public static Object getDeclaredFieldValue(Object object, String declaredFieldName)
			throws Exception
	{
		Field field = object.getClass().getDeclaredField(declaredFieldName);

		field.setAccessible(true);

		return field.get(object);
	}
1119193
@Override
    public Object getAttributeValue(String name) {
        final List<Object> values = this.getAttributeValues(name);
        if (values != null && values.size() > 0) {
            return values.get(0);
        }

        return null;
    }
125644
Object getValue(int fieldNum)
    {
        String attributeName = getAttributeName(fieldNum);
        ClassDescriptor cld = broker.getClassDescriptor(pc.getClass());
        
        // field could be a primitive typed attribute...
        AttributeDescriptorBase fld = cld.getFieldDescriptorByName(attributeName);
        // field could be a reference attribute...
        if (fld == null) 
        {
			fld = cld.getObjectReferenceDescriptorByName(attributeName);
		}
		// or it could be a collection attribute:
        if (fld == null) 
        {
			fld = cld.getCollectionDescriptorByName(attributeName);
		}        
        Object value = fld.getPersistentField().get(pc);
        return value;
    }
747873
public Object getValue(String attributeName) {
        if (attributeName != null) {
            return values.get(attributeName);
        }
        return null;
    }
399320
public static final Object getValue(Object obj, String fieldName) {
        try {
            return getField(obj.getClass(), fieldName).get(obj);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
392400
private static final BagAttribute getAttributeFromEvaluationResult(EvaluationResult attribute) {
        if (attribute.indeterminate()) {
            return null;
        }

        if (attribute.getStatus() != null
                && !Status.STATUS_OK.equals(attribute.getStatus())) {
            return null;
        }

        AttributeValue attributeValue = attribute.getAttributeValue();
        if (!(attributeValue instanceof BagAttribute)) {
            return null;
        }

        return (BagAttribute) attributeValue;
    }
424357
@Override
    public double value(Attribute attribute) {
        int index = this.instanceHeader.indexOf(attribute);
        return value(index);
    }