Resolves a field into a
{@link com.github.msoliter.iroh.container.resolvers.sources.base.Source}.

@param field The field to be resolved.
@return A source of instances accepted by the field.
550159
public Source resolve(Field field) {
        
        /**
         * As promised the registrar simply abstracts away the internal 
         * resolution implementations, throwing an error if all of them fail to
         * come up with a source for the field.
         */
        for (Resolver resolver : resolvers) {
            Source source = resolver.resolve(field);
            
            /**
             * Per the dependency resolver contract, a return value of null 
             * means no error occurred, but the resolver failed to resolve the
             * type anyway, so we can move on to the next resolver.
             */
            if (source != null) {
                return source;
            }
        }
        
        /**
         * If no resolver succeeded in generating an instance source, we've got
         * a problem: we need to inject a field but we have no way to get an
         * instance of it!
         */
        throw new UnexpectedImplementationCountException(
            field.getType(), 
            noImplementations);
    }
868617
public boolean declaresField(Field field) {
        try {
            type.getDeclaredField(field.getName());
            return true;
        }
        catch (NoSuchFieldException e) {
            return false;
        }
    }
448497
public static byte[] get(Object from, Field field)
    {
        PropertyAccessor<?> accessor = PropertyAccessorFactory.getPropertyAccessor(field);
        return accessor.toBytes(getObject(from, field));
    }
319554
private Object resolve(FieldData fieldData) {
        Object value;
        if (fieldData.metaData.isThisReference()) {
            // The field is a @This reference
            value = convertThisResourceToFieldType(fieldData);
        } else if (fieldData.metaData.isChildrenAnnotationPresent()) {
            // The field is a collection of @Children
            value = resolveChildren(fieldData);
        } else if (fieldData.metaData.isReference()) {
            // The field is a @Reference
            value = resolveReferenceValueOfField(fieldData);
        } else if (fieldData.metaData.isPropertyType()) {
            // The field points to a property of the resource
            value = resolvePropertyTypedValue(fieldData);
        } else {
            // The field points to another resource
            value = resolveResource(fieldData.path, fieldData.metaData.getType());
        }
        return value;
    }
279304
public Filters addField(String field, String value) {
        initialFields();
        fields.add(new FieldFilter(field, value));
        return this;
    }
767151
public AnnotatedTypeBuilder<X> addToField(Field field, Annotation annotation) {
       if (fields.get(field) == null) {
           fields.put(field, new AnnotationBuilder());
       }
       fields.get(field).add(annotation);
       return this;
   }
208740
public List<Filter> getAllFiltersForField(String field) {
		List<Filter> foundFilters = new ArrayList<>();

		for (Filter filter : this.filters) {
			if (filter.getField().equals(field)) {
				foundFilters.add(filter);
			}
		}

		return Collections.unmodifiableList(foundFilters);
	}
85979
public ConversionHandler from(MappedField sourceMappedField){
		this.sourceField = sourceMappedField.getValue();
		placeholders.put(sourceTypePattern, sourceField.getType().getName());
		placeholders.put(sourceNamePattern, sourceField.getName());
		placeholders.put(sourceGetPattern, sourceMappedField.getMethod());
		placeholders.put(sourceSetPattern, sourceMappedField.setMethod());
		return this;
	}
256798
public BaseField getSyncedListenersField(BaseField field, FieldListener listener)
    {
        if (field != null)
            if (field.getRecord() == this.getOwner().getRecord())
                field = listener.getOwner().getRecord().getField(field.getFieldName());
        return field;
    }
142790
private GenContainer findGenAnnotation(final Field field) {
        for (Annotation annotation : field.getDeclaredAnnotations()) {
            for (Annotation inline : annotation.annotationType().getDeclaredAnnotations()) {
                if (isGen.test(inline)) {
                    return GenContainer.asGen(inline, annotation);
                }
            }
        }

        return null;
    }
906765
private void inject(Object target, Field field) {
        try {
            
            /**
             * Injection is actually quite a simple process. We resolve the
             * field into a source of instances, and ask it to generate one.
             */
            field.set(target, registrar.resolve(field).getInstance());
        
        } catch (IllegalArgumentException | IllegalAccessException e) {
            throw new IrohException(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;
   }
666322
private Object resolvePropertyTypedValue(FieldData field) {
        Object value;
        if (field.metaData.isInstantiableCollectionType()) {
            value = getArrayPropertyAsCollection(field);
        } else {
            value = resolvePropertyTypedValue(field, field.metaData.getType());
        }
        return value;
    }
30076
private Object resolveReferenceValueOfField(FieldData field) {
        Object value = null;
        // Regardless of its path, the field references another resource.
        // fetch the field value (the path(s) to the referenced resource(s)) and resolve these resources.
        if (field.metaData.isCollectionType()) {
            String[] referencedResourcePaths = resolvePropertyTypedValue(field, String[].class);
            if (referencedResourcePaths != null) {
                value = createCollectionOfReferences(field, referencedResourcePaths);
            }
        } else {
            String referencedResourcePath = resolvePropertyTypedValue(field, String.class);
            if (referencedResourcePath != null) {
                if (field.metaData.isAppendPathPresentOnReference()) {
                    referencedResourcePath += field.metaData.getAppendPathOnReference();
                }
                value = resolveResource(referencedResourcePath, field.metaData.getType());
            }
        }
        return value;
    }
1198612
@Nullable
  public Object get(@Nonnull String field) {
    return get(FieldPath.fromDotSeparatedString(field));
  }
452733
public static Object getObject(Object from, Field field)
    {
        if (!field.isAccessible())
        {
            field.setAccessible(true);
        }
        try
        {
            return field.get(from);
        }
        catch (IllegalArgumentException iarg)
        {
            throw new PropertyAccessException(iarg);
        }
        catch (IllegalAccessException iacc)
        {
            throw new PropertyAccessException(iacc);
        }
    }
962386
public int fieldIndex(String field) {
    Integer ret = mIndex.get(field);
    if (ret == null) {
      throw new IllegalArgumentException(field + " does not exist");
    }
    return ret;
  }