热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

javax.enterprise.inject.spi.AnnotatedConstructor.isAnnotationPresent()方法的使用及代码示例

本文整理了Java中javax.enterprise.inject.spi.AnnotatedConstructor.isAnnotationPresent()方法的一

本文整理了Java中javax.enterprise.inject.spi.AnnotatedConstructor.isAnnotationPresent()方法的一些代码示例,展示了AnnotatedConstructor.isAnnotationPresent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AnnotatedConstructor.isAnnotationPresent()方法的具体详情如下:
包路径:javax.enterprise.inject.spi.AnnotatedConstructor
类名称:AnnotatedConstructor
方法名:isAnnotationPresent

AnnotatedConstructor.isAnnotationPresent介绍

暂无

代码示例

代码示例来源:origin: jersey/jersey

@Override
public boolean isAnnotationPresent(final Class annotationType) {
return ctor.isAnnotationPresent(annotationType);
}
};

代码示例来源:origin: org.glassfish.jersey.ext.cdi/jersey-cdi1x

@Override
public boolean isAnnotationPresent(final Class annotationType) {
return ctor.isAnnotationPresent(annotationType);
}
};

代码示例来源:origin: org.glassfish.jersey.containers.glassfish/jersey-gf-cdi

@Override
public boolean isAnnotationPresent(Class annotationType) {
return ctor.isAnnotationPresent(annotationType);
}
};

代码示例来源:origin: com.caucho/resin

private static boolean hasQualifierAnnotation(AnnotatedConstructor ctor)
{
return ctor.isAnnotationPresent(Inject.class);
}

代码示例来源:origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Override
public boolean isAnnotationPresent(Class annotationType) {
return constructor.isAnnotationPresent(annotationType);
}

代码示例来源:origin: weld/core

public static boolean hasSimpleCdiConstructor(AnnotatedType type) {
for (AnnotatedConstructor constructor : type.getConstructors()) {
if (constructor.getParameters().isEmpty()) {
return true;
}
if (constructor.isAnnotationPresent(Inject.class)) {
return true;
}
}
return false;
}

代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded

public static boolean hasSimpleCdiConstructor(AnnotatedType type) {
for (AnnotatedConstructor constructor : type.getConstructors()) {
if (constructor.getParameters().isEmpty()) {
return true;
}
if (constructor.isAnnotationPresent(Inject.class)) {
return true;
}
}
return false;
}

代码示例来源:origin: weld/core

public static boolean hasSimpleCdiConstructor(AnnotatedType type) {
for (AnnotatedConstructor constructor : type.getConstructors()) {
if (constructor.getParameters().isEmpty()) {
return true;
}
if (constructor.isAnnotationPresent(Inject.class)) {
return true;
}
}
return false;
}

代码示例来源:origin: org.jboss.weld.se/weld-se

public static boolean hasSimpleCdiConstructor(AnnotatedType type) {
for (AnnotatedConstructor constructor : type.getConstructors()) {
if (constructor.getParameters().isEmpty()) {
return true;
}
if (constructor.isAnnotationPresent(Inject.class)) {
return true;
}
}
return false;
}

代码示例来源:origin: weld/core

public static boolean hasSimpleCdiConstructor(AnnotatedType type) {
for (AnnotatedConstructor constructor : type.getConstructors()) {
if (constructor.getParameters().isEmpty()) {
return true;
}
if (constructor.isAnnotationPresent(Inject.class)) {
return true;
}
}
return false;
}

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

public static boolean hasSimpleCdiConstructor(AnnotatedType type) {
for (AnnotatedConstructor constructor : type.getConstructors()) {
if (constructor.getParameters().isEmpty()) {
return true;
}
if (constructor.isAnnotationPresent(Inject.class)) {
return true;
}
}
return false;
}

代码示例来源:origin: org.jboss.weld.osgi/weld-osgi-core-extension

private boolean isCDIOSGiConstructor(AnnotatedConstructor constructor) {
if (constructor.isAnnotationPresent(Inject.class)) {
for (AnnotatedParameter parameter : constructor.getParameters()) {
if (parameter.isAnnotationPresent(OSGiService.class)) {
return true;
}
}
}
return false;
}

代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl

void observesCountrysidePAT(@Observes ProcessAnnotatedType event) {
AnnotatedConstructorConfigurator annotatedCOnstructorConfigurator= event.configureAnnotatedType()
.filterConstructors(constructor -> constructor.isAnnotationPresent(Inject.class)).findFirst().get();
//add qualifier to each constructor param
annotatedConstructorConfigurator.params().forEach(annotatedParam -> annotatedParam.add(Wild.WildLiteral.INSTANCE));
}

代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl

@Test
@SpecAssertion(section = PROCESS_ANNOTATED_TYPE, id = "bba")
public void configuratorInitializedWithOriginalAT() {
AnnotatedType catAT = getCurrentManager().getExtension(ProcessAnnotatedTypeObserver.class).getOriginalCatAT();
assertTrue(catAT.isAnnotationPresent(RequestScoped.class));
AnnotatedConstructor annotatedCOnstructor= catAT.getConstructors().stream()
.filter(ac -> ac.getParameters().size() == 1 && ac.getParameters().get(0).getBaseType().equals(Feed.class)).findFirst().get();
assertTrue(annotatedConstructor.getParameters().iterator().next().isAnnotationPresent(Cats.class));
assertTrue(annotatedConstructor.isAnnotationPresent(Inject.class));
}

代码示例来源:origin: org.apache.openwebbeans/openwebbeans-impl

/**
* @param classLoader to use for creating the class in
* @param annotatedType the annotatedType for which a subclass will get generated
* @param
* @return the proxy class
*/
public synchronized Class createSubClass(ClassLoader classLoader, AnnotatedType annotatedType)
throws ProxyGenerationException
{
Class classToProxy = annotatedType.getJavaClass();
Class clazz = tryToLoadClass(classLoader, classToProxy);
if (clazz != null)
{
return clazz;
}
String proxyClassName = getSubClassName(classToProxy);
List methods = ClassUtil.getNonPrivateMethods(classToProxy, true);
Method[] businessMethods = methods.toArray(new Method[methods.size()]);
Constructor cOns= null;
for (AnnotatedConstructor c : annotatedType.getConstructors())
{
if (c.isAnnotationPresent(Inject.class))
{
cOns= c.getJavaMember();
break;
}
}
clazz = createProxyClass(classLoader, proxyClassName, classToProxy, businessMethods, new Method[0], cons);
return clazz;
}

代码示例来源:origin: com.sun.jersey/jersey-servlet

boolean methodHasEncodedAnnotation = constructor.isAnnotationPresent(Encoded.class);
for (AnnotatedParameter parameter : constructor.getParameters()) {
for (Annotation annotation : parameter.getAnnotations()) {

代码示例来源:origin: jersey/jersey-1.x

boolean methodHasEncodedAnnotation = constructor.isAnnotationPresent(Encoded.class);
for (AnnotatedParameter parameter : constructor.getParameters()) {
for (Annotation annotation : parameter.getAnnotations()) {

代码示例来源:origin: com.sun.jersey/jersey-bundle

boolean methodHasEncodedAnnotation = constructor.isAnnotationPresent(Encoded.class);
for (AnnotatedParameter parameter : constructor.getParameters()) {
for (Annotation annotation : parameter.getAnnotations()) {

代码示例来源:origin: org.jboss.weld.se/weld-se

private void initClassDeclaredEjbInterceptors() {
Class[] classDeclaredInterceptors = interceptorsApi.extractInterceptorClasses(annotatedType);
boolean excludeClassLevelAroundCOnstructInterceptors= constructor.isAnnotationPresent(ExcludeClassInterceptors.class);
if (classDeclaredInterceptors != null) {
for (Class clazz : classDeclaredInterceptors) {
InterceptorClassMetadata interceptor = reader.getPlainInterceptorMetadata(clazz);
for (InterceptionType interceptionType : InterceptionType.values()) {
if (excludeClassLevelAroundConstructInterceptors && interceptionType.equals(InterceptionType.AROUND_CONSTRUCT)) {
/*
* @ExcludeClassInterceptors suppresses @AroundConstruct interceptors defined on class level
*/
continue;
}
if (interceptor.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.valueOf(interceptionType))) {
builder.interceptGlobal(interceptionType, null, Collections.>singleton(interceptor), null);
}
}
}
}
}

代码示例来源:origin: org.apache.camel/camel-cdi

static boolean hasAnnotation(AnnotatedType type, Class annotation) {
if (type.isAnnotationPresent(annotation)) {
return true;
}
for (AnnotatedMethod method : type.getMethods()) {
if (method.isAnnotationPresent(annotation)) {
return true;
}
}
for (AnnotatedConstructor constructor : type.getConstructors()) {
if (constructor.isAnnotationPresent(annotation)) {
return true;
}
}
for (AnnotatedField field : type.getFields()) {
if (field.isAnnotationPresent(annotation)) {
return true;
}
}
return false;
}

推荐阅读
author-avatar
李波2602884584
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有