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 constructor

This class is immutable, and therefore threadsafe

Parameters:
<T> exact type
Author(s):
Pete Muir
Ales Justin
 
 
     // The list of parameter abstractions
     private final List<EnhancedAnnotatedParameter<?, T>> parameters;
 
     private final ConstructorSignature signature;
 
     private final AnnotatedConstructor<T> slim;
 
     public static <T> EnhancedAnnotatedConstructor<T> of(AnnotatedConstructor<T> annotatedConstructorEnhancedAnnotatedType<T> declaringClassClassTransformer classTransformer) {
         return new EnhancedAnnotatedConstructorImpl<T>(annotatedConstructorbuildAnnotationMap(annotatedConstructor.getAnnotations()), buildAnnotationMap(annotatedConstructor.getAnnotations()), declaringClassclassTransformer);
     }

    
Constructor

Initializes the superclass with the build annotations map

Parameters:
constructor The constructor method
declaringClass The declaring class
 
     private EnhancedAnnotatedConstructorImpl(AnnotatedConstructor<T> annotatedConstructorMap<Class<? extends Annotation>, AnnotationannotationMapMap<Class<? extends Annotation>, AnnotationdeclaredAnnotationMapEnhancedAnnotatedType<T> declaringClassClassTransformer classTransformer) {
         super(annotatedConstructorannotationMapdeclaredAnnotationMapclassTransformerdeclaringClass);
         this. = annotatedConstructor;
 
         ArrayList<EnhancedAnnotatedParameter<?, T>> parameters = new ArrayList<EnhancedAnnotatedParameter<?, T>>();
         validateParameterCount(annotatedConstructor);
         for (AnnotatedParameter<T> annotatedParameter : annotatedConstructor.getParameters()) {
             EnhancedAnnotatedParameter<?, T> parameter = EnhancedAnnotatedParameterImpl.of(annotatedParameterthisclassTransformer);
             parameters.add(parameter);
         }
         this. = immutableList(parameters);
         this. = new ConstructorSignatureImpl(this);
     }

    
Gets the constructor

Returns:
The constructor
 
     public Constructor<T> getAnnotatedConstructor() {
         return .getJavaMember();
     }

    
Gets the delegate (constructor)

Returns:
The delegate
 
     @Override
     public Constructor<T> getDelegate() {
         return .getJavaMember();
     }

    
Gets the abstracted parameters

If the parameters are null, initialize them first

Returns:
A list of annotated parameter abstractions
See also:
org.jboss.weld.annotated.enhanced.EnhancedAnnotatedCallable.getEnhancedParameters()
        return ;
    }

    
Gets parameter abstractions with a given annotation type.

If the parameters are null, they are initializes first.

The results of the method are not cached, as it is not called at runtime

Parameters:
annotationType The annotation type to match
Returns:
A list of matching parameter abstractions. An empty list is returned if there are no matches.
See also:
org.jboss.weld.annotated.enhanced.EnhancedAnnotatedCallable.getEnhancedParameters(java.lang.Class)
    public List<EnhancedAnnotatedParameter<?, T>> getEnhancedParameters(Class<? extends AnnotationannotationType) {
        List<EnhancedAnnotatedParameter<?, T>> ret = new ArrayList<EnhancedAnnotatedParameter<?, T>>();
        for (EnhancedAnnotatedParameter<?, T> parameter : ) {
            if (parameter.isAnnotationPresent(annotationType)) {
                ret.add(parameter);
            }
        }
        return ret;
    }

    
The overridden equals operation

Parameters:
other The instance to compare to
Returns:
True if equal, false otherwise
    @Override
    public boolean equals(Object other) {
        if (super.equals(other) && other instanceof EnhancedAnnotatedConstructor<?>) {
            EnhancedAnnotatedConstructor<?> that = (EnhancedAnnotatedConstructor<?>) other;
            return this.getJavaMember().equals(that.getJavaMember()) && this.getEnhancedParameters().equals(that.getEnhancedParameters());
        }
        return false;
    }
    @Override
    public int hashCode() {
        int hash = 1;
        hash = hash * 31 + getJavaMember().hashCode();
        hash = hash * 31 + getEnhancedParameters().hashCode();
        return hash;
    }

    
Gets a string representation of the constructor

Returns:
A string representation
    @Override
    public String toString() {
        return Formats.formatAnnotatedConstructor(this);
    }
        return ;
    }
    public List<AnnotatedParameter<T>> getParameters() {
        return Reflections.cast();
    }
    public boolean isGeneric() {
        return getJavaMember().getTypeParameters().length > 0;
    }
    @Override
    public AnnotatedConstructor<T> slim() {
        return ;
    }
New to GrepCode? Check out our FAQ X