Returns the value of the field represented by the given metadata.

@param fieldMetadata
the metadata of the field
@param target
the target object to which the field belongs.
@return the value of the field.
546918
public static Object getFieldValue(FieldMetadata fieldMetadata, Object target) {
    MethodHandle readMethod = fieldMetadata.getReadMethod();
    try {
      return readMethod.invoke(target);
    } catch (Throwable t) {
      throw new EntityManagerException(t.getMessage(), t);
    }
  }
866915
public static RelationMetadataProcessor getRelationMetadataProcessor(Field relationField, KunderaMetadata kunderaMetadata)
    {
        RelationMetadataProcessor relProcessor = null;

        // OneToOne
        if (relationField.isAnnotationPresent(OneToOne.class))
        {
            relProcessor = new OneToOneRelationMetadataProcessor(kunderaMetadata);
        }

        // OneToMany
        else if (relationField.isAnnotationPresent(OneToMany.class))
        {
            relProcessor = new OneToManyRelationMetadataProcessor(kunderaMetadata);

        }

        // ManyToOne
        else if (relationField.isAnnotationPresent(ManyToOne.class))
        {
            relProcessor = new ManyToOneRelationMetadataProcessor(kunderaMetadata);

        }

        // ManyToMany
        else if (relationField.isAnnotationPresent(ManyToMany.class))
        {
            relProcessor = new ManyToManyRelationMetadataProcessor(kunderaMetadata);

        }

        return relProcessor;

    }
1028493
public Metadata getMetadata(String templateName) {
        String scope = Metadata.scopeBasedOnType(templateName);
        return this.getMetadata(templateName, scope);
    }
519566
@VisibleForTesting
  static Map<String, String> encodeMetadata(Map<String, byte[]> metadata) {
    return Maps.transformValues(metadata, ENCODE_METADATA_VALUES);
  }
1148694
public <T> T getNodeMetaData(Object key) {
        if (metaDataMap == null) {
            return (T) null;
        }
        return (T) metaDataMap.get(key);
    }
467256
static Map<View, FormValidator.FieldInfo> getFieldsForTarget(Object target) {
		Map<View, FormValidator.FieldInfo> infoMap = sCachedFieldsByTarget.get(target);

		if (infoMap != null) {
			for (View view : infoMap.keySet()) {
				// view has been removed from the window - we will need to scan fields of target again
				if (view.getWindowToken() == null) {
					infoMap = null;

					break;
				}
			}
		}

		if (infoMap == null) {
			infoMap = findFieldsToValidate(target);
			sCachedFieldsByTarget.put(target, infoMap);
		}
		return infoMap;
	}
271171
public void putPropertyMetadata(PropertyMetadata propertyMetadata) {
    String mappedName = propertyMetadata.getMappedName();
    PropertyMetadata old = propertyMetadataMap.put(mappedName, propertyMetadata);
    if (old != null) {
      String format = "Class %s has two fields, %s and %s, both mapped to the same property "
          + "name, %s";
      String message = String.format(format, clazz.getName(), old.getName(),
          propertyMetadata.getName(), mappedName);
      throw new EntityManagerException(message);
    }
  }
15563
public static Object getFieldValue(Object object, String fieldName) {
        try {
            return getDeclaredFieldInHierarchy(object.getClass(), fieldName).get(object);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
484120
private ResultSetMetaData getMetaData() {

        if (metadata == null) {
            try {
                metadata = resultSet.getMetaData();
            } catch (SQLException e) {
                throw new FacesException(e);
            }
        }
        return (metadata);

    }
1295583
public void set(Object target, Object value) throws MetadataException
    {
        // if target null, we have nothing to do
        if(target == null) return;
        Object current = target;
        if (isNestedField())
        {
            List fields = getFieldsList();
            int size = fields.size() - 1;
            Field field;
            for (int i = 0; i < size; i++)
            {
                field = (Field) fields.get(i);
                Object attribute;
                try
                {
                    attribute = getValueFrom(field, current);
                }
                catch (Exception e)
                {
                    throw new MetadataException("Can't read field '" + field.getName() + "' of type " + field.getType().getName(), e);
                }
                if (attribute != null || value != null)
                {
                    // if the intermediary nested object is null, we have to create
                    // a new instance to set the value
                    if (attribute == null)
                    {
                        try
                        {
                            attribute = ClassHelper.newInstance(field.getType());
                        }
                        catch (Exception e)
                        {
                            throw new MetadataException("Can't create nested object of type '"
                                    + field.getType() + "' for field '"
                                    + field.getName() + "'", e);
                        }
                    }
                    try
                    {
                        //field.set(current, attribute);
                        setValueFor(field, current, attribute);
                    }
                    //catch (IllegalAccessException e)
                    catch (Exception e)
                    {
                        throw new MetadataException("Can't set nested object of type '"
                                    + field.getType() + "' for field '"
                                    + field.getName() + "'", e);
                    }
                }
                else
                {
                    return;
                }
                current = attribute;
            }
        }
        setValueFor(getField(), current, value);
    }
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;
  }
213698
public static String getJPAColumnName(String field, EntityMetadata entityMetadata, MetamodelImpl metaModel)
    {
        if (field.indexOf('.') > 0)
        {
            return ((AbstractAttribute) metaModel.entity(entityMetadata.getEntityClazz()).getAttribute(
                    field.substring(field.indexOf('.') + 1,
                            field.indexOf(')') > 0 ? field.indexOf(')') : field.length()))).getJPAColumnName();
        }
        else
        {
            return ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName();
        }
    }
1329528
public static Set<Field> getFields(Class<?> target, FieldFilter filter) {
        Class<?> clazz = target;
        Set<Field> fields = getDeclaredFields(clazz, filter);
        while((clazz = clazz.getSuperclass()) != null) {    
            fields.addAll(getDeclaredFields(clazz, filter));
        }
        return fields;
    }
990564
private static function get_field( $target_id = 0, $field = '' ) {
		if ( self::is_active() ) {
			if ( $field ) {
				return self::get_single_field( $target_id, $field );
			} else {
				return self::get_all_fields( $target_id );
			}
		}
		return $field ? null : [];
	}
457536
public FieldMetadata getFieldMetadata(final String name)
    {
        return new FieldMetadata((ProxyFieldImpl)m_proxyObject.getProxyField(name),
                (PropertyMetadataImpl) m_classMetadata.getField(name));
    }
1203572
public Metadata getMetadata(String typeName) {
        String scope = Metadata.scopeBasedOnType(typeName);
        return this.getMetadata(typeName, scope);
    }
727970
protected function getOrCreateMetaDataValue($setId, $language, $fieldId, $target)
    {
        $metaDataValue = $this->getDataRepository()->findOneBy(array(
            'setId' => $setId,
            'language' => $language,
            'fieldId' => $fieldId,
            'folder' => $target,
        ));

        if (!$metaDataValue) {
            $metaDataValue = new FolderMetaDataValue(
                $setId,
                $target,
                $language,
                $fieldId
            );
        }

        return $metaDataValue;
    }