当前位置: 首页>>代码示例>>Java>>正文


Java Stereotype类代码示例

本文整理汇总了Java中javax.enterprise.inject.Stereotype的典型用法代码示例。如果您正苦于以下问题:Java Stereotype类的具体用法?Java Stereotype怎么用?Java Stereotype使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Stereotype类属于javax.enterprise.inject包,在下文中一共展示了Stereotype类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addViewMetaData

import javax.enterprise.inject.Stereotype; //导入依赖的package包/类
protected void addViewMetaData(Annotation currentAnnotation, List<Annotation> metaDataList)
{
    Class<? extends Annotation> annotationClass = currentAnnotation.annotationType();

    if (annotationClass.isAnnotationPresent(ViewMetaData.class))
    {
        metaDataList.add(currentAnnotation);
    }

    if (annotationClass.isAnnotationPresent(Stereotype.class))
    {
        for (Annotation inheritedViaStereotype : annotationClass.getAnnotations())
        {
            if (inheritedViaStereotype.annotationType().isAnnotationPresent(ViewMetaData.class))
            {
                metaDataList.add(inheritedViaStereotype);
            }
        }
    }
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:21,代码来源:DefaultViewConfigInheritanceStrategy.java

示例2: findQualifiers

import javax.enterprise.inject.Stereotype; //导入依赖的package包/类
static Set<Annotation> findQualifiers(Set<Annotation> annotations) {
    Set<Annotation> results = new LinkedHashSet<>();
    for(Annotation annotation : annotations) {
        Class<? extends Annotation> annotationClass = annotation.getClass();
        if(annotation instanceof Default) {
            continue;
        } else if(annotationClass.getAnnotation(Qualifier.class) != null) {
            results.add(annotation);
        } else if(annotationClass.getAnnotation(Stereotype.class) != null) {
            Set<Annotation> parentAnnotations = new LinkedHashSet<>(asList(annotationClass.getAnnotations()));
            results.addAll(findQualifiers(parentAnnotations));
        }
    }
    return results;
}
 
开发者ID:johnament,项目名称:reactive-cdi-events,代码行数:16,代码来源:ReactorObserverRegistry.java

示例3: getStereotypes

import javax.enterprise.inject.Stereotype; //导入依赖的package包/类
@Override
public Set<Class<? extends Annotation>> getStereotypes() {
	Set<Class<? extends Annotation>> stereotypes = new HashSet<>();

	Arrays.stream(javaType.getAnnotations())
		.map(a -> a.getClass())
			.filter(a -> a.getAnnotation(Stereotype.class) != null)
				.forEach(stereotypes::add);

	return stereotypes;
}
 
开发者ID:ljtfreitas,项目名称:java-restify,代码行数:12,代码来源:RestifyProxyCdiBean.java

示例4: isStereotype

import javax.enterprise.inject.Stereotype; //导入依赖的package包/类
public static boolean isStereotype(Class<? extends Annotation> candidate) {
    for (Annotation annotation : candidate.getAnnotations()) {
        if (annotation.annotationType().equals(Stereotype.class)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:thma,项目名称:fmek,代码行数:9,代码来源:InterceptorInfoVisitor.java

示例5: hasAnnotationInStereotypes

import javax.enterprise.inject.Stereotype; //导入依赖的package包/类
private static <T extends Annotation> T hasAnnotationInStereotypes(Annotation[] declaredAnnotations,
                                                                   Class<T> expectedAnnotationType) {
    for (Annotation declaredAnnotation : declaredAnnotations) {
        Class<? extends Annotation> declaredAnnotationType = declaredAnnotation.annotationType();
        if (declaredAnnotationType == expectedAnnotationType) {
            return expectedAnnotationType.cast(declaredAnnotation);
        } else if (declaredAnnotationType.isAnnotationPresent(Stereotype.class)) {
            T ann = hasAnnotationInStereotypes(declaredAnnotationType.getAnnotations(), expectedAnnotationType);
            if (ann != null) {
                return expectedAnnotationType.cast(ann);
            }
        }
    }
    return null;
}
 
开发者ID:Tibor17,项目名称:javaee-samples,代码行数:16,代码来源:BeanUtils.java

示例6: getStereotypes

import javax.enterprise.inject.Stereotype; //导入依赖的package包/类
@Override
public Set<Class<? extends Annotation>> getStereotypes() {
    Set<Class<? extends Annotation>> stereotypes = new HashSet<>();

    for (Annotation annotation : getQualifiers()) {
        Class<? extends Annotation> annotationType = annotation.annotationType();
        if (annotationType.isAnnotationPresent(Stereotype.class)) {
            stereotypes.add(annotationType);
        }
    }

    return stereotypes;
}
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:14,代码来源:AbstractCdiBean.java

示例7: resolveSecurityBindingType

import javax.enterprise.inject.Stereotype; //导入依赖的package包/类
public static Annotation resolveSecurityBindingType(Annotation annotation)
{
    List<Annotation> result = getAllAnnotations(annotation.annotationType().getAnnotations(),
        new HashSet<Integer>());

    for (Annotation foundAnnotation : result)
    {
        if (foundAnnotation.annotationType().isAnnotationPresent(SecurityBindingType.class))
        {
            return foundAnnotation;
        }
    }
    throw new IllegalStateException(annotation.annotationType().getName() + " is a " + Stereotype.class.getName() +
            " but it isn't annotated with " + SecurityBindingType.class.getName());
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:16,代码来源:SecurityUtils.java

示例8: mergeMetaData

import javax.enterprise.inject.Stereotype; //导入依赖的package包/类
private List<Annotation> mergeMetaData(Set<Annotation> metaData, List<Annotation> inheritedMetaData)
{
    //TODO add qualifier support
    List<Annotation> nodeViewMetaData = new ArrayList<Annotation>();
    List<Annotation> viewMetaDataFromStereotype = new ArrayList<Annotation>();

    for (Annotation annotation : metaData)
    {
        if (annotation.annotationType().isAnnotationPresent(ViewMetaData.class))
        {
            nodeViewMetaData.add(annotation);
        }

        //TODO move to stereotype-util, improve it and merge it with DefaultViewConfigInheritanceStrategy
        if (annotation.annotationType().isAnnotationPresent(Stereotype.class))
        {
            for (Annotation metaAnnotation : annotation.annotationType().getAnnotations())
            {
                if (metaAnnotation.annotationType().isAnnotationPresent(ViewMetaData.class))
                {
                    viewMetaDataFromStereotype.add(metaAnnotation);
                }
            }
        }
    }

    //merge meta-data of same level
    List<Annotation> result = mergeAnnotationInstances(viewMetaDataFromStereotype, nodeViewMetaData);

    if (inheritedMetaData != null && !inheritedMetaData.isEmpty())
    {
        //merge meta-data with levels above
        result = mergeAnnotationInstances(inheritedMetaData, result);
    }

    return result;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:38,代码来源:DefaultConfigNodeConverter.java

示例9: getStereotypes

import javax.enterprise.inject.Stereotype; //导入依赖的package包/类
public Set<Class<? extends Annotation>> getStereotypes() {
	return Stream.of(repositoryType.getAnnotations())
			.map(a -> a.annotationType())
			.filter(a -> a.isAnnotationPresent(Stereotype.class))
			.collect(Collectors.toSet());
}
 
开发者ID:yanaga,项目名称:winter-data-jpa,代码行数:7,代码来源:SimpleRepositoryBean.java


注:本文中的javax.enterprise.inject.Stereotype类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。