Add an annotation to the specified field. If the field is not already
present, it will be added.

@param field      the field to add the annotation to
@param annotation the annotation to add
@throws IllegalArgumentException if the annotation is null
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;
   }
1113547
public void add(final Field _field)
    {
        this.fields.put(_field.getId(), _field);
        this.fieldName2Field.put(_field.getName(), _field);
        if (_field.getReference() != null && _field.getReference().length() > 0) {
            final String ref = _field.getReference();
            int index;
            int end = 0;
            while ((index = ref.indexOf("$<", end)) > 0) {
                index += 2;
                end = ref.indexOf(">", index);
                addFieldExpr(ref.substring(index, end));
            }
        }
        _field.setCollectionUUID(getUUID());
    }
3782
public <T extends Annotation> boolean isAnnotationPresentOnField( Class<T> annotation ) {
        return CreatorUtils.isAnnotationPresent( annotation, fields );
    }
763319
protected void addDeclaredAnnotation(String annotation, Map<CharSequence, Object> values) {
        if (annotation != null) {
            String repeatedName = getRepeatedName(annotation);
            if (repeatedName != null) {
                Object v = values.get(AnnotationMetadata.VALUE_MEMBER);
                if (v instanceof io.micronaut.core.annotation.AnnotationValue[]) {
                    io.micronaut.core.annotation.AnnotationValue[] avs = (io.micronaut.core.annotation.AnnotationValue[]) v;
                    for (io.micronaut.core.annotation.AnnotationValue av : avs) {
                        addDeclaredRepeatable(annotation, av);
                    }
                } else if (v instanceof Iterable) {
                    Iterable i = (Iterable) v;
                    for (Object o : i) {
                        if (o instanceof io.micronaut.core.annotation.AnnotationValue) {
                            addDeclaredRepeatable(annotation, ((io.micronaut.core.annotation.AnnotationValue) o));
                        }
                    }
                }
            } else {
                Map<String, Map<CharSequence, Object>> declaredAnnotations = getDeclaredAnnotationsInternal();
                Map<String, Map<CharSequence, Object>> allAnnotations = getAllAnnotations();
                addAnnotation(annotation, values, declaredAnnotations, allAnnotations, true);
            }
        }
    }
335401
public void addField(FormField field) {
        String fieldVariableName = field.getVariable();
        // Form field values must be unique unless they are of type 'fixed', in
        // which case their variable name may be 'null', and therefore could
        // appear multiple times within the same form.
        if (fieldVariableName != null && hasField(fieldVariableName)) {
            throw new IllegalArgumentException("This data form already contains a form field with the variable name '"
                            + fieldVariableName + "'");
        }
        synchronized (fields) {
            fields.put(fieldVariableName, field);
        }
    }
95239
void setAnnotation(String key, Object object) {
    checkArgument(object != null, "The stored annotation value cannot be null.");
    Preconditions.checkArgument(
        !annotationMap.containsKey(key), "Cannot overwrite the existing annotation '%s'.", key);
    annotationMap.put(key, object);
  }
561956
public AnnotationNode annotation(String annotation) {
        this.attr(ANNOTATION, annotation);
        String[] kc = AnnotationParser.extractKeyAndContent(annotation);
        this.attr(ANNOTATION_KEY, kc[0]);
        this.attr(ANNOTATION_CONTENT, kc[1]);
        return this;
    }
295014
private void add(int field)
   {
      if (field < m_flags.length)
      {
         if (m_flags[field] == false)
         {
            m_flags[field] = true;
            m_fields[m_count] = field;
            ++m_count;
         }
      }
   }
2442
public void putField(final JBBPNumericField field) {
    JBBPUtils.assertNotNull(field, "Field must not be null");
    final JBBPNamedFieldInfo fieldName = field.getNameInfo();
    JBBPUtils.assertNotNull(fieldName, "Field name info must not be null");
    this.fieldMap.put(fieldName, field);
  }
290741
public static void assertNotFinal(final Field field, Class<? extends Annotation> annotation) 
   {
      if (Modifier.isFinal(field.getModifiers()))
      {
         throw annotation == null ? MESSAGES.fieldCannotBeStaticOrFinal(field) : MESSAGES.fieldCannotBeStaticOrFinal2(field, annotation);
      }
   }
99887
public void register(final Field field) {
        Requires requires = field.getAnnotation(Requires.class);
        if (requires != null) {
            final String[] requirements = requires.value();
            for (String requirement: requirements) {
                this.dependantToRequirementsMap.put(field, requirement);
                this.requirementToDependantMap.put(requirement, field);
            }

        }
    }
1037699
public void addForwardedField(int sourceField, int targetField) {
		if(isTargetFieldPresent(targetField)) {
			throw new InvalidSemanticAnnotationException("Target field "+targetField+" was added twice.");
		}

		FieldSet targetFields = fieldMapping.get(sourceField);
		if (targetFields != null) {
			fieldMapping.put(sourceField, targetFields.addField(targetField));
		} else {
			fieldMapping.put(sourceField, new FieldSet(targetField));
		}
	}
629405
public Annotation putAnnotation(final Annotation ann) {
        Annotation put = foundAnnotations.put(ann.getClass(), ann);
        discoverNames();
        return put;
    }
1036490
public AnnotationDescr addAnnotation( String name,
                                          String value ) {
        if ( this.annotations == null ) {
            this.annotations = new HashMap<String, AnnotationDescr>();
        } else {
            AnnotationDescr existingAnnotation = annotations.get( name );
            if (existingAnnotation != null) {
                existingAnnotation.setDuplicated();
                return existingAnnotation;
            }
        }
        AnnotationDescr annotation = new AnnotationDescr( name,
                                                          value );
        annotation.setResource(getResource());
        return this.annotations.put( annotation.getName(),
                                     annotation );
    }
352407
public void addField(ModelFieldBean bean) {
		Assert.notNull(bean, "ModelFieldBean must not be null");

		this.fields.put(bean.getName(), bean);
	}
780102
protected void addArguments(FieldDescriptor field[])
    {
        for (int i = 0; i < field.length; i++)
        {
            ArgumentDescriptor arg = new ArgumentDescriptor(this);
            arg.setValue(field[i].getAttributeName(), false);
            this.addArgument(arg);
        }
    }
1191018
protected void addAnnotation(EObject element, XAnnotation annotation,
			IModificationContext context) throws Exception {
		final ICompositeNode node = NodeModelUtils.findActualNodeFor(annotation);
		if (node != null) {
			final IXtextDocument document = context.getXtextDocument();
			final int startOffset = node.getOffset();
			final int parameterOffset = getTools().getOffsetForPattern(document, startOffset,
					"@\\s*" + toPattern(annotation.getAnnotationType().getQualifiedName()) //$NON-NLS-1$
					+ "\\s*\\(\\s*"); //$NON-NLS-1$
			final int insertOffset;
			if (document.getChar(parameterOffset) == '{') {
				insertOffset = parameterOffset + getTools().getSpaceSize(document, parameterOffset + 1) + 1;
			} else {
				insertOffset = parameterOffset;
			}
			final ReplacingAppendable appendable = getTools().getAppendableFactory().create(document,
					(XtextResource) element.eResource(), insertOffset, 0);
			appendable.append("\""); //$NON-NLS-1$
			appendable.append(extractId(this.code));
			appendable.append("\", "); //$NON-NLS-1$
			appendable.commitChanges();
		}
	}