指定したアノテーションのクラス情報から、アノテーションのインスタンスを組み立てる。
@param annoClass アノテーションのクラス
@param info アノテーションの情報
@return アノテーションのインスタンス。
@throws AnnotationReadException
540780
public Annotation buildAnnotation(final Class<?> annoClass, final AnnotationInfo info) throws AnnotationReadException {
        
        final Map<String, Object> defaultValues = new HashMap<>();
        for(Method method : annoClass.getMethods()) {
            final Object defaultValue = method.getDefaultValue();
            if(defaultValue != null) {
                defaultValues.put(method.getName(), defaultValue);
            }
        }
        
        final Map<String, Object> xmlValues = new HashMap<>();
        for(String key : info.getAttributeKeys()) {
            try {
                Object value = Ognl.getValue(info.getAttribute(key), ognlContext, new Object());
                xmlValues.put(key, value);
            } catch(OgnlException e) {
                throw new AnnotationReadException(String.format("fail annotation attribute %s with ognl.", key), e);
            }
        }
        
        ClassLoader loader = classLoader;
        if(loader == null){
            loader = Thread.currentThread().getContextClassLoader();
        }
        
        Object obj = Proxy.newProxyInstance(loader, new Class[]{annoClass},
                new InvocationHandler() {
                    @Override
                    public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
                        String name = method.getName();
                        if (name.equals("annotationType")) {
                            return annoClass;
                        } else if(xmlValues.containsKey(name)){
                            return xmlValues.get(name);
                        } else {
                            return defaultValues.get(name);
                        }
                    }
        });
        
        return (Annotation) obj;
    }
710955
public static <T> T readEntity(Class<T> rawType, Annotation[] annotations) {
        return getRequest().readEntity(rawType, annotations);
    }
330875
@SuppressWarnings("unchecked")
    public <A extends Annotation> A findAnnotation(Class<A> annotationType) {

        if (absentCache.contains(annotationType)) {
            return null;
        }

        A result = (A) annotationCache.computeIfAbsent(annotationType,
                key -> methodParameter.getParameterAnnotation(annotationType));

        if (result == null) {
            absentCache.add(annotationType);
        }

        return result;
    }
1289980
public final void annotation() throws RecognitionException {
		int annotation_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 65) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:613:5: ( '@' annotationName ( '(' ( elementValuePairs )? ')' )? )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:613:7: '@' annotationName ( '(' ( elementValuePairs )? ')' )?
			{
			match(input,58,FOLLOW_58_in_annotation2305); if (state.failed) return;
			pushFollow(FOLLOW_annotationName_in_annotation2307);
			annotationName();
			state._fsp--;
			if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:613:26: ( '(' ( elementValuePairs )? ')' )?
			int alt87=2;
			int LA87_0 = input.LA(1);
			if ( (LA87_0==36) ) {
				alt87=1;
			}
			switch (alt87) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:613:27: '(' ( elementValuePairs )? ')'
					{
					match(input,36,FOLLOW_36_in_annotation2310); if (state.failed) return;
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:613:31: ( elementValuePairs )?
					int alt86=2;
					int LA86_0 = input.LA(1);
					if ( ((LA86_0 >= CharacterLiteral && LA86_0 <= DecimalLiteral)||LA86_0==FloatingPointLiteral||(LA86_0 >= HexLiteral && LA86_0 <= Identifier)||(LA86_0 >= OctalLiteral && LA86_0 <= StringLiteral)||LA86_0==29||LA86_0==36||(LA86_0 >= 40 && LA86_0 <= 41)||(LA86_0 >= 44 && LA86_0 <= 45)||LA86_0==53||LA86_0==58||LA86_0==65||LA86_0==67||(LA86_0 >= 70 && LA86_0 <= 71)||LA86_0==77||(LA86_0 >= 79 && LA86_0 <= 80)||LA86_0==82||LA86_0==85||LA86_0==92||LA86_0==94||(LA86_0 >= 97 && LA86_0 <= 98)||LA86_0==105||LA86_0==108||LA86_0==111||LA86_0==115||LA86_0==118||LA86_0==121||LA86_0==126) ) {
						alt86=1;
					}
					switch (alt86) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:613:31: elementValuePairs
							{
							pushFollow(FOLLOW_elementValuePairs_in_annotation2312);
							elementValuePairs();
							state._fsp--;
							if (state.failed) return;
							}
							break;

					}

					match(input,37,FOLLOW_37_in_annotation2315); if (state.failed) return;
					}
					break;

			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 65, annotation_StartIndex); }

		}
	}
270952
public MessageBuilder varWithAnno(final String key, final Class<? extends Annotation> annoClass) {
        return var(key, "@" + annoClass.getSimpleName());
    }
964292
public void scanClass(InputStream bits) throws IOException
    {
        DataInputStream dstream = new DataInputStream(new BufferedInputStream(bits));
        ClassFile cf = null;
        try
        {
            cf = new ClassFile(dstream);

            String className = cf.getName();
            List<String> annotations = new ArrayList<String>();

            accumulateAnnotations(annotations, (AnnotationsAttribute) cf.getAttribute(AnnotationsAttribute.visibleTag));
            accumulateAnnotations(annotations,
                    (AnnotationsAttribute) cf.getAttribute(AnnotationsAttribute.invisibleTag));

            // iterate through all valid annotations
            for (String validAnn : getValidAnnotations())
            {
                // check if the current class has one?
                if (annotations.contains(validAnn))
                {
                    // fire all listeners
                    for (AnnotationDiscoveryListener listener : getAnnotationDiscoveryListeners())
                    {
                        listener.discovered(className);
                    }
                }
            }

        }
        finally
        {
            dstream.close();
            bits.close();
        }
    }
689472
@SuppressWarnings("unchecked")
    public <A extends Annotation> A getAnnotation(final Field field, final Class<A> annClass) throws AnnotationReadException {
        
        final Class<?> clazz = field.getDeclaringClass();
        
        if(xmlInfo != null && xmlInfo.containsClassInfo(clazz.getName())) {
            final ClassInfo classInfo = xmlInfo.getClassInfo(clazz.getName());
            
            if(classInfo.containsFieldInfo(field.getName())) {
                FieldInfo fieldInfo = classInfo.getFieldInfo(field.getName());
                if(fieldInfo != null && fieldInfo.containsAnnotationInfo(annClass.getName())){
                    AnnotationInfo annInfo = fieldInfo.getAnnotationInfo(annClass.getName());
                    try {
                        return (A)annotationBuilder.buildAnnotation(Class.forName(annInfo.getClassName()), annInfo);
                    } catch (ClassNotFoundException e) {
                        throw new AnnotationReadException(String.format("not found class '%s'", annInfo.getClassName()), e);
                    }
                }
            }
        }
        return field.getAnnotation(annClass);
    }
753448
Stories getStoriesAnnotation(final String[] value) {
        return new Stories() {

            @Override
            public String[] value() {
                return value;
            }

            @Override
            public Class<Stories> annotationType() {
                return Stories.class;
            }
        };
    }
1315781
public <A extends Annotation> Optional<A> getAnnotation(final Class<A> annoClass) {
        Objects.requireNonNull(annoClass, "annoClass should not be null.");
        
        return getAnnotationsByType(expandedAnnos, annoClass).stream()
                .findFirst();
        
    }
819740
@Nonnull
  public static <T> EbInterfaceReader <T> create (@Nonnull final Class <T> aClass)
  {
    return new EbInterfaceReader <> (aClass);
  }
405957
final protected function getAnnotationReader(): Reader
    {
        $driver = $this->entityManager->getConfiguration()->getMetadataDriverImpl();
        if ($driver instanceof AnnotationDriver) {
            return $driver->getReader();
        }

        if ($driver instanceof MappingDriverChain) {
            return new MappingDriverChainAdapter($driver);
        }

        throw new Exception('graphql-doctrine requires Doctrine to be configured with a `' . AnnotationDriver::class . '`.');
    }
1270490
protected function getDocumentRepository(
        ReflectionClass $reflectionClass,
        AnnotationReader $annotationReader
    ): ?string {
        $annotations = $annotationReader->getClassAnnotations($reflectionClass);

        foreach ($annotations as $annotation) {
            if ($annotation instanceof Document) {
                return $annotation->repositoryClass;
            }
        }

        return null;
    }
953888
public static boolean isAnnotationPresent(Field field, Class<? extends Annotation> annotationType) {
        final Optional<Method> readMethod = getReadMethod(field);
        return field.isAnnotationPresent(annotationType) || readMethod.isPresent() && readMethod.get().isAnnotationPresent(annotationType);
    }
983883
def readAnnotations(self):
        
        annot = self.read_annotation()
        annot = np.array(annot)
        if (annot.shape[0] == 0):
            return np.array([]), np.array([]), np.array([])
        ann_time = self._get_float(annot[:, 0])
        ann_text = annot[:, 2]
        ann_text_out = ["" for x in range(len(annot[:, 1]))]
        for i in np.arange(len(annot[:, 1])):
            ann_text_out[i] = self._convert_string(ann_text[i])
            if annot[i, 1] == '':
                annot[i, 1] = '-1'
        ann_duration = self._get_float(annot[:, 1])
        return ann_time/10000000, ann_duration, np.array(ann_text_out)
577766
public <A extends Annotation> List<A> getAnnotations(final Class<A> annoClass) {
        Objects.requireNonNull(annoClass, "annoClass should not be null.");
        
        return getAnnotationsByType(expandedAnnos, annoClass);
    }
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;
        }
    }
934578
public static boolean hasAnnotation(final ClassNode classNode, final Class<? extends Annotation> annotationClass) {
        return !classNode.getAnnotations(new ClassNode(annotationClass)).isEmpty();
    }