本文整理了Java中javax.enterprise.inject.spi.Annotated.getBaseType()
方法的一些代码示例,展示了Annotated.getBaseType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotated.getBaseType()
方法的具体详情如下:
包路径:javax.enterprise.inject.spi.Annotated
类名称:Annotated
方法名:getBaseType
[英]Get the type of the annotated program element.
[中]获取带注释的程序元素的类型。
代码示例来源:origin: com.caucho/resin
/**
* Returns the declared type of the injection point, e.g. an
* injected field's type.
*/
@Override
public Type getType()
{
if (_type != null)
return _type;
else
return _annotated.getBaseType();
}
代码示例来源:origin: org.jboss.kernel/jboss-weld-int
/**
* Gets the base type from the delegate
*
* @return the base type
*/
public Type getBaseType()
{
return delegate.getBaseType();
}
代码示例来源:origin: org.omnifaces/omnifaces
private void addAnnotatedTypeIfNecessary(Annotated annotated) {
if (annotated.isAnnotationPresent(Param.class)) {
Type type = annotated.getBaseType();
// Skip ParamValue as it is already handled by RequestParameterProducer.
if (type instanceof ParameterizedType && ParamValue.class.isAssignableFrom((Class<?>) ((ParameterizedType) type).getRawType())) {
return;
}
types.add(type);
}
}
代码示例来源:origin: omnifaces/omnifaces
private void addAnnotatedTypeIfNecessary(Annotated annotated) {
if (annotated.isAnnotationPresent(Param.class)) {
Type type = annotated.getBaseType();
// Skip ParamValue as it is already handled by RequestParameterProducer.
if (type instanceof ParameterizedType && ParamValue.class.isAssignableFrom((Class<?>) ((ParameterizedType) type).getRawType())) {
return;
}
types.add(type);
}
}
代码示例来源:origin: org.apache.geronimo/geronimo-openapi-impl
<T> void findEndpointsAndApplication(@Observes final ProcessBean<T> event) {
final String typeName = event.getAnnotated().getBaseType().getTypeName();
if (classes == null && !skipScan && event.getAnnotated().isAnnotationPresent(Path.class) &&
!typeName.startsWith("org.apache.geronimo.microprofile.openapi.") &&
(packages == null || packages.stream().anyMatch(typeName::startsWith))) {
endpoints.add(event.getBean());
}
}
代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl
private void validateStatefulSessionBean(Annotated type)
{
assert type.getBaseType().equals(Cow.class);
assert rawTypeSetMatches(type.getTypeClosure(), Cow.class, CowLocal.class, Object.class);
assert type.getAnnotations().size() == 0;
}
代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl
private void validateStatefulSessionBean(Annotated type) {
assert type.getBaseType().equals(Cow.class);
assert typeSetMatches(type.getTypeClosure(), Cow.class, CowLocal.class, Object.class);
assert type.getAnnotations().size() == 0;
}
代码示例来源:origin: com.caucho/resin
protected static BaseType createBaseType(Annotated ann)
{
if (ann instanceof BaseTypeAnnotated)
return ((BaseTypeAnnotated) ann).getBaseTypeImpl();
else
return createBaseType(ann.getBaseType());
}
代码示例来源:origin: io.smallrye/smallrye-config
public static <T> Optional<T> optionalConfigValue(InjectionPoint injectionPoint, Config config) {
Type type = injectionPoint.getAnnotated().getBaseType();
final Class<T> valueType;
valueType = resolveValueType(type);
return Optional.ofNullable(getValue(injectionPoint, valueType, config));
}
代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl
private void validateStatelessSessionBean(Annotated type)
{
assert type.getBaseType().equals(Sheep.class);
assert rawTypeSetMatches(type.getTypeClosure(), Sheep.class, SheepLocal.class, Object.class);
assert type.getAnnotations().size() == 2;
assert annotationSetMatches(type.getAnnotations(), Tame.class, Stateless.class); // TODO
// Check
}
代码示例来源:origin: com.caucho/resin
public static BaseType getBaseType(Annotated annotated)
{
if (annotated instanceof BaseTypeAnnotated)
return ((BaseTypeAnnotated) annotated).getBaseTypeImpl();
else
return InjectManager.create().createTargetBaseType(annotated.getBaseType());
}
代码示例来源:origin: org.apache.myfaces.core/myfaces-impl
private void addAnnotatedTypeIfNecessary(Annotated annotated)
{
if (annotated.isAnnotationPresent(ManagedProperty.class))
{
Type type = annotated.getBaseType();
types.add(new ManagedPropertyInfo(type, annotated.getAnnotation(ManagedProperty.class).value()));
}
}
代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl
private void validateStatelessSessionBean(Annotated type) {
assert type.getBaseType().equals(Sheep.class);
assert typeSetMatches(type.getTypeClosure(), Sheep.class, SheepLocal.class, Object.class);
assert type.getAnnotations().size() == 2;
assert annotationSetMatches(type.getAnnotations(), Tame.class, Stateless.class);
}
代码示例来源:origin: io.smallrye/smallrye-config
public static <C extends Collection<T>, T> C collectionConfigProperty(InjectionPoint injectionPoint, Config config, C collection) {
Type type = injectionPoint.getAnnotated().getBaseType();
final Class<T> valueType = resolveValueType(type);
String stringValue = getValue(injectionPoint, String.class, config);
String[] split = StringUtil.split(stringValue);
for (String aSplit : split) {
T item = ((SmallRyeConfig) config).convert(aSplit, valueType);
collection.add(item);
}
return collection;
}
代码示例来源:origin: org.jboss.weld.se/weld-se
public static void validateAnnotated(Annotated annotated) {
checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated);
checkNotNull(annotated.getBaseType(), "getBaseType()", annotated);
checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated);
}
代码示例来源:origin: weld/core
public static void validateAnnotated(Annotated annotated) {
checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated);
checkNotNull(annotated.getBaseType(), "getBaseType()", annotated);
checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated);
}
代码示例来源:origin: weld/core
public static void validateAnnotated(Annotated annotated) {
checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated);
checkNotNull(annotated.getBaseType(), "getBaseType()", annotated);
checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated);
}
代码示例来源:origin: weld/core
public static void validateAnnotated(Annotated annotated) {
checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated);
checkNotNull(annotated.getBaseType(), "getBaseType()", annotated);
checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated);
}
代码示例来源:origin: org.jboss.weld.se/weld-se-shaded
public static void validateAnnotated(Annotated annotated) {
checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated);
checkNotNull(annotated.getBaseType(), "getBaseType()", annotated);
checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated);
}
代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded
public static void validateAnnotated(Annotated annotated) {
checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated);
checkNotNull(annotated.getBaseType(), "getBaseType()", annotated);
checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated);
}
内容来源于网络,如有侵权,请联系作者删除!