Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2008, Red Hat, Inc., and individual contributors
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package org.jboss.weld.annotated.enhanced.jlr;
 
 import static org.jboss.weld.util.collections.WeldCollections.immutableList;
 
 import java.util.List;
 import java.util.Map;
 
 
Represents an annotated method

This class is immutable and therefore threadsafe

Parameters:
<T>
Author(s):
Pete Muir
 
 public class EnhancedAnnotatedMethodImpl<T, X> extends AbstractEnhancedAnnotatedCallable<T, X, Methodimplements EnhancedAnnotatedMethod<T, X> {
 
     // The abstracted parameters
     private final List<EnhancedAnnotatedParameter<?, X>> parameters;
 
     // The property name
     private final String propertyName;
 
     private final MethodSignature signature;
 
     private final AnnotatedMethod<X> slim;
 
     public static <T, X, Y extends X> EnhancedAnnotatedMethodImpl<T, X> of(AnnotatedMethod<X> annotatedMethodEnhancedAnnotatedType<Y> declaringClassClassTransformer classTransformer) {
         EnhancedAnnotatedType<X> downcastDeclaringType = Reflections.cast(declaringClass);
         return new EnhancedAnnotatedMethodImpl<T, X>(annotatedMethodbuildAnnotationMap(annotatedMethod.getAnnotations()), buildAnnotationMap(annotatedMethod.getAnnotations()), downcastDeclaringTypeclassTransformer);
     }

    
Constructor

Initializes the superclass with the built annotation map, sets the method and declaring class abstraction and detects the actual type arguments

Parameters:
method The underlying method
declaringClass The declaring class abstraction
 
     private EnhancedAnnotatedMethodImpl(AnnotatedMethod<X> annotatedMethodMap<Class<? extends Annotation>, AnnotationannotationMapMap<Class<? extends Annotation>, AnnotationdeclaredAnnotationMapEnhancedAnnotatedType<X> declaringClassClassTransformer classTransformer) {
         super(annotatedMethodannotationMapdeclaredAnnotationMapclassTransformerdeclaringClass);
         this. = annotatedMethod;
 
         ArrayList<EnhancedAnnotatedParameter<?, X>> parameters = new ArrayList<EnhancedAnnotatedParameter<?, X>>(annotatedMethod.getParameters().size());
         validateParameterCount(annotatedMethod);
         for (AnnotatedParameter<X> annotatedParameter : annotatedMethod.getParameters()) {
             EnhancedAnnotatedParameter<?, X> parameter = EnhancedAnnotatedParameterImpl.of(annotatedParameterthisclassTransformer);
             parameters.add(parameter);
         }
         this. = immutableList(parameters);
 
         String propertyName = Reflections.getPropertyName(getDelegate());
         if (propertyName == null) {
             this. = getName();
         } else {
             this. = propertyName;
         }
         this. = new MethodSignatureImpl(this);
 
     }
 
     @Override
     public Method getDelegate() {
         return .getJavaMember();
     }
        return Collections.unmodifiableList();
    }
    public Class<?>[] getParameterTypesAsArray() {
        return .getJavaMember().getParameterTypes();
    }
    public List<EnhancedAnnotatedParameter<?, X>> getEnhancedParameters(Class<? extends AnnotationannotationType) {
        List<EnhancedAnnotatedParameter<?, X>> ret = new ArrayList<EnhancedAnnotatedParameter<?, X>>();
        for (EnhancedAnnotatedParameter<?, X> parameter : ) {
            if (parameter.isAnnotationPresent(annotationType)) {
                ret.add(parameter);
            }
        }
        return ret;
    }
    public boolean isEquivalent(Method method) {
        return this.getDeclaringType().isEquivalent(method.getDeclaringClass()) && this.getName().equals(method.getName()) && Arrays.equals(this.getParameterTypesAsArray(), method.getParameterTypes());
    }
    public String getPropertyName() {
        return ;
    }
    @Override
    public String toString() {
        return Formats.formatAnnotatedMethod(this);
    }
    public MethodSignature getSignature() {
        return ;
    }
    public List<AnnotatedParameter<X>> getParameters() {
        return Collections.unmodifiableList(Reflections.<List<AnnotatedParameter<X>>>cast());
    }
    public boolean isGeneric() {
        return getJavaMember().getTypeParameters().length > 0;
    }
    @Override
    public AnnotatedMethod<X> slim() {
        return ;
    }
New to GrepCode? Check out our FAQ X