本文整理汇总了Java中javax.enterprise.inject.spi.AnnotatedMethod.getParameters方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotatedMethod.getParameters方法的具体用法?Java AnnotatedMethod.getParameters怎么用?Java AnnotatedMethod.getParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.enterprise.inject.spi.AnnotatedMethod
的用法示例。
在下文中一共展示了AnnotatedMethod.getParameters方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isHandler
import javax.enterprise.inject.spi.AnnotatedMethod; //导入方法依赖的package包/类
/**
* Determines if the given method is a handler by looking for the {@link Handles} annotation on a parameter.
*
* @param method method to search
* @return true if {@link Handles} is found, false otherwise
*/
public static boolean isHandler(final AnnotatedMethod<?> method)
{
if (method == null)
{
throw new IllegalArgumentException("Method must not be null");
}
for (AnnotatedParameter<?> param : method.getParameters())
{
if (param.isAnnotationPresent(Handles.class) || param.isAnnotationPresent(BeforeHandles.class))
{
return true;
}
}
return false;
}
示例2: findHandlerParameter
import javax.enterprise.inject.spi.AnnotatedMethod; //导入方法依赖的package包/类
public static AnnotatedParameter<?> findHandlerParameter(final AnnotatedMethod<?> method)
{
if (!isHandler(method))
{
throw new IllegalArgumentException("Method is not a valid handler");
}
AnnotatedParameter<?> returnParam = null;
for (AnnotatedParameter<?> param : method.getParameters())
{
if (param.isAnnotationPresent(Handles.class) || param.isAnnotationPresent(BeforeHandles.class))
{
returnParam = param;
break;
}
}
return returnParam;
}
示例3: hasEventParameter
import javax.enterprise.inject.spi.AnnotatedMethod; //导入方法依赖的package包/类
private boolean hasEventParameter(AnnotatedMethod<?> annotatedMethod) {
for (AnnotatedParameter<?> param : annotatedMethod.getParameters()) {
if (param.isAnnotationPresent(Observes.class)) {
return true;
}
}
return false;
}
示例4: hasInjectionPointMetadata
import javax.enterprise.inject.spi.AnnotatedMethod; //导入方法依赖的package包/类
private static boolean hasInjectionPointMetadata(AnnotatedMember<?> member) {
if (!(member instanceof AnnotatedMethod)) {
return false;
}
AnnotatedMethod<?> method = (AnnotatedMethod<?>) member;
for (AnnotatedParameter<?> parameter : method.getParameters()) {
if (parameter.getBaseType().equals(InjectionPoint.class)) {
return true;
}
}
return false;
}
示例5: hasInjectionPoints
import javax.enterprise.inject.spi.AnnotatedMethod; //导入方法依赖的package包/类
private static boolean hasInjectionPoints(AnnotatedMember<?> member) {
if (!(member instanceof AnnotatedMethod))
return false;
AnnotatedMethod<?> method = (AnnotatedMethod<?>) member;
for (AnnotatedParameter<?> parameter : method.getParameters()) {
if (parameter.getBaseType().equals(InjectionPoint.class))
return true;
}
return false;
}
示例6: createInjectionPoints
import javax.enterprise.inject.spi.AnnotatedMethod; //导入方法依赖的package包/类
/**
* Given a method, and the bean on which the method is declared, create a
* collection of injection points representing the parameters of the method.
*
* @param <X> the type declaring the method
* @param method the method
* @param declaringBean the bean on which the method is declared
* @param beanManager the bean manager to use to create the injection points
* @return the injection points
*/
public static <X> List<InjectionPoint> createInjectionPoints(AnnotatedMethod<X> method, Bean<?> declaringBean,
BeanManager beanManager)
{
List<InjectionPoint> injectionPoints = new ArrayList<InjectionPoint>();
for (AnnotatedParameter<X> parameter : method.getParameters())
{
InjectionPoint injectionPoint =
new ImmutableInjectionPoint(parameter, beanManager, declaringBean, false, false);
injectionPoints.add(injectionPoint);
}
return injectionPoints;
}