アノテーション情報を追加する。
<p>ただし、既に同じアノテーションが存在する場合は、それと入れ替えされます。</p>
@param annotationInfo アノテーション情報。
@throws IllegalArgumentException annotationInfo is null.
18467
public void addAnnotationInfo(final AnnotationInfo annotationInfo) {
        ArgUtils.notNull(annotationInfo, "annotationInfo");
        
        removeAnnotationInfo(annotationInfo.getClassName());
        this.annotationInfos.add(annotationInfo);
    }
1304545
protected void init(EnhancedAnnotation<T> annotatedAnnotation) {
        initType(annotatedAnnotation);
        initValid(annotatedAnnotation);
        check(annotatedAnnotation);
    }
243957
void addFieldInfo(final FieldInfoList fieldInfoList, final Map<String, ClassInfo> classNameToClassInfo) {
        for (final FieldInfo fi : fieldInfoList) {
            // Index field annotations
            addFieldOrMethodAnnotationInfo(fi.annotationInfo, /* isField = */ true, classNameToClassInfo);
        }
        if (this.fieldInfo == null) {
            this.fieldInfo = fieldInfoList;
        } else {
            this.fieldInfo.addAll(fieldInfoList);
        }
    }
1107734
public <A extends Annotation> boolean hasAnnotation(final Field field, final Class<A> annClass) {
        return getAnnotation(field, annClass) != null;
    }
694153
public void addAnnotationInfo(Element element, Content htmltree) {
        addAnnotationInfo(element, element.getAnnotationMirrors(), htmltree);
    }
157526
private void addAnnotationInfo(Doc doc, AnnotationDesc[] descList,
            Content htmltree) {
        addAnnotationInfo(0, doc, descList, true, htmltree);
    }
433124
public static final void convertAnnotations(Tree config, Annotation[] annotations)
			throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
		for (Annotation annotation : annotations) {

			// Create entry for annotation
			String annotationName = annotation.toString();
			int i = annotationName.lastIndexOf('.');
			if (i > -1) {
				annotationName = annotationName.substring(i + 1);
			}
			i = annotationName.indexOf('(');
			if (i > -1) {
				annotationName = annotationName.substring(0, i);
			}
			if (annotationName.length() > 1) {
				annotationName = Character.toLowerCase(annotationName.charAt(0)) + annotationName.substring(1);
			} else {
				annotationName = annotationName.toLowerCase();
			}
			if ("name".equals(annotationName) || "override".equals(annotationName)) {
				continue;
			}
			Tree annotationMap = config.putMap(annotationName);

			// Add annotation values
			Class<? extends Annotation> type = annotation.annotationType();
			Method[] members = type.getDeclaredMethods();
			for (Method member : members) {
				member.setAccessible(true);
				String propName = member.getName();
				Object propValue = member.invoke(annotation);
				annotationMap.putObject(propName, propValue);
				Tree newChild = annotationMap.get(propName);
				if (newChild.size() < 1) {
					newChild.remove();
				}
			}
			int size = annotationMap.size();
			if (size == 0) {
				annotationMap.remove();
			} else if (size == 1) {
				Tree value = annotationMap.getFirstChild();
				if (value != null && "value".equals(value.getName())) {
					annotationMap.setObject(value.asObject());
				}
			}
		}
	}
770058
public void buildAnnotationTypeSignature(XMLNode node, Content annotationInfoTree) {
        StringBuilder modifiers = new StringBuilder(
                annotationTypeDoc.modifiers() + " ");
        writer.addAnnotationTypeSignature(Util.replaceText(
                modifiers.toString(), "interface", "@interface"), annotationInfoTree);
    }
1269132
@ArgumentsChecked
	@Throws(IllegalNullArgumentException.class)
	private static String format(@Nonnull final Class<? extends Annotation> annotation) {
		if (annotation == null) {
			throw new IllegalNullArgumentException("annotation");
		}
		return String.format(MESSAGE_WITH_ANNOTATION, annotation.getName());
	}
421197
protected void writeClassInfo(ClassInfo info) {
        Node currentNode = this.currentNode;
        Element tmp = doc.createElementNS(XML_URI, "class");
        currentNode.appendChild(tmp);
        this.currentNode = tmp;
        addAccessFlags(info);
        if (info.getName() != null)
            tmp.setAttribute( "name",
                    info.getName());
        if (info.getSignature() != null)
            tmp.setAttribute( "signature",
                    info.getSignature());
        if (info.getSupername() != null)
            tmp.setAttribute( "superclass",
                              info.getSupername());
        String[] interfaces = info.getInterfaces();
        for (int i = 0; i < interfaces.length; i++) {
            Element iface = doc.createElementNS(XML_URI, "implements");
            tmp.appendChild(iface);
            iface.setAttribute( "name", 
                    interfaces[i]);
        }
        this.currentNode = currentNode;
    }
1074888
public static Class<? extends Annotation> checkIsBindingAnnotation(
      Class<? extends Annotation> annotation) {
    if (!isBindingAnnotation(annotation)) {
      throw new IllegalArgumentException(
          "Must be a binding annotation (BindingAnnotation or Qualifier)");
    }
    return annotation;
  }
865067
@Override
    public void addParameterAnnotation(int param, AnnotationValue annotationValue) {
        HashMap<Integer, Map<ClassDescriptor, AnnotationValue>> updatedAnnotations = new HashMap<>(
                methodParameterAnnotations);
        Map<ClassDescriptor, AnnotationValue> paramMap = updatedAnnotations.get(param);
        if (paramMap == null) {
            paramMap = new HashMap<>();
            updatedAnnotations.put(param, paramMap);
        }
        paramMap.put(annotationValue.getAnnotationClass(), annotationValue);

        methodParameterAnnotations = updatedAnnotations;
        TypeQualifierApplications.updateAnnotations(this);
    }
916014
public void addAnnotationInfo(PackageElement packageElement, Content htmltree) {
        addAnnotationInfo(packageElement, packageElement.getAnnotationMirrors(), htmltree);
    }
470309
public void addAnnotation(final Class<? extends Annotation> clazz) {
        if (field.isAnnotationPresent(clazz)) {
            addAnnotation(clazz, field.getAnnotation(clazz));
        }
    }
1122353
public void addStartSagaAnnotation(final Class<? extends Annotation> annotationClass) {
        Objects.requireNonNull(annotationClass, "The type of annotation is not allowed to be null");
        startSagaAnnotations.add(annotationClass);
    }
203328
public static <T> T getAnnotation(final Class c, final Class<T> annotation) {
        final List<T> found = getAnnotations(c, annotation);
        if (found != null && !found.isEmpty()) {
            return found.get(0);
        } else {
            return null;
        }
    }
542966
public static void save(final AnnotationMappingInfo xmlInfo, final OutputStream out) throws XmlOperateException {
        ArgUtils.notNull(xmlInfo, "xmlInfo");
        ArgUtils.notNull(out, "out");
        
        try {
            JAXB.marshal(xmlInfo, out);
            
        } catch (DataBindingException e) {
            throw new XmlOperateException("fail save xml with JAXB.", e);
        }
        
    }