javax.enterprise.inject.spi.AnnotatedCallable Java Examples

The following examples show how to use javax.enterprise.inject.spi.AnnotatedCallable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Annotateds.java    From deltaspike with Apache License 2.0 6 votes vote down vote up
public int compare(AnnotatedCallable<? super T> arg0, AnnotatedCallable<? super T> arg1)
{
    // compare the names first
    int result = (arg0.getJavaMember().getName().compareTo(arg1.getJavaMember().getName()));
    if (result != 0)
    {
        return result;
    }
    result = arg0.getJavaMember().getDeclaringClass().getName().compareTo(arg1.getJavaMember()
            .getDeclaringClass().getName());
    if (result != 0)
    {
        return result;
    }
    result = arg0.getParameters().size() - arg1.getParameters().size();
    return result;
}
 
Example #2
Source File: CurrentInjectionPointProvider.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public AnnotatedCallable<X> getDeclaringCallable() {
    if (executable instanceof Method) {
        return new AnnotatedMethodImpl<>((Method) executable);
    } else {
        return new AnnotatedConstructorImpl<X>((Constructor<X>) executable);
    }
}
 
Example #3
Source File: Annotateds.java    From deltaspike with Apache License 2.0 5 votes vote down vote up
/**
 * Generates a deterministic signature for an {@link AnnotatedCallable}. Two
 * <code>AnnotatedCallable</code>s that have the same annotations and
 * underlying callable will generate the same signature.
 */
public static <X> String createCallableId(AnnotatedCallable<X> method)
{
    StringBuilder builder = new StringBuilder();
    builder.append(method.getJavaMember().getDeclaringClass().getName());
    builder.append('.');
    builder.append(method.getJavaMember().getName());
    builder.append(createAnnotationCollectionId(method.getAnnotations()));
    builder.append(createParameterListId(method.getParameters()));
    return builder.toString();
}
 
Example #4
Source File: Annotateds.java    From deltaspike with Apache License 2.0 5 votes vote down vote up
/**
 * <p>
 * Compare {@link AnnotatedCallable}s for equality.
 * </p>
 * <p/>
 * <p>
 * Two {@link AnnotatedCallable}s are considered equal if they have the same
 * underlying callable and annotations.
 * </p>
 */
public static boolean compareAnnotatedCallable(AnnotatedCallable<?> m1, AnnotatedCallable<?> m2)
{
    if (!m1.getJavaMember().equals(m2.getJavaMember()))
    {
        return false;
    }
    if (!compareAnnotated(m1, m2))
    {
        return false;
    }
    return compareAnnotatedParameters(m1.getParameters(), m2.getParameters());
}
 
Example #5
Source File: Annotateds.java    From deltaspike with Apache License 2.0 5 votes vote down vote up
private static <X> boolean hasMethodParameters(AnnotatedCallable<X> callable)
{
    for (AnnotatedParameter<X> parameter : callable.getParameters())
    {
        if (!parameter.getAnnotations().isEmpty())
        {
            return true;
        }
    }
    return false;
}
 
Example #6
Source File: AnnotatedParameterImpl.java    From deltaspike with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor
 */
AnnotatedParameterImpl(AnnotatedCallable<X> declaringCallable, Class<?> type, int position,
                              AnnotationStore annotations, Type genericType, Type typeOverride)
{
    super(type, annotations, genericType, typeOverride);
    this.declaringCallable = declaringCallable;
    this.position = position;
}
 
Example #7
Source File: MethodParameterInjectionPoint.java    From quarkus with Apache License 2.0 4 votes vote down vote up
public AnnotatedCallable<X> getDeclaringCallable() {
    return null;
}
 
Example #8
Source File: OpenEJBEnricher.java    From tomee with Apache License 2.0 4 votes vote down vote up
@Override
public AnnotatedCallable<Object> getDeclaringCallable() {
    return null;
}
 
Example #9
Source File: AnnotatedParameterImpl.java    From deltaspike with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public AnnotatedCallable<X> getDeclaringCallable()
{
    return declaringCallable;
}