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


Java AnnotatedMethod.getParameters方法代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:24,代码来源:HandlerMethodImpl.java

示例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;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:21,代码来源:HandlerMethodImpl.java

示例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;
}
 
开发者ID:weld,项目名称:weld-vertx,代码行数:9,代码来源:RouteExtension.java

示例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;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:13,代码来源:MetricCdiInjectionExtension.java

示例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;
}
 
开发者ID:astefanutti,项目名称:metrics-cdi,代码行数:11,代码来源:MetricsExtension.java

示例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;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:24,代码来源:BeanUtils.java


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