src/share/classes/java/lang/reflect/Constructor.java

Print this page




 149                                                 exceptionTypes, modifiers, slot,
 150                                                 signature,
 151                                                 annotations,
 152                                                 parameterAnnotations);
 153         res.root = this;
 154         // Might as well eagerly propagate this if already present
 155         res.constructorAccessor = constructorAccessor;
 156         return res;
 157     }
 158 
 159     /**
 160      * Returns the {@code Class} object representing the class that declares
 161      * the constructor represented by this {@code Constructor} object.
 162      */
 163     public Class<T> getDeclaringClass() {
 164         return clazz;
 165     }
 166 
 167     /**
 168      * Returns the name of this constructor, as a string.  This is
 169      * always the same as the simple name of the constructor's declaring
 170      * class.
 171      */
 172     public String getName() {
 173         return getDeclaringClass().getName();
 174     }
 175 
 176     /**
 177      * Returns the Java language modifiers for the constructor
 178      * represented by this {@code Constructor} object, as an integer. The
 179      * {@code Modifier} class should be used to decode the modifiers.
 180      *
 181      * @see Modifier
 182      */
 183     public int getModifiers() {
 184         return modifiers;
 185     }
 186 
 187     /**
 188      * Returns an array of {@code TypeVariable} objects that represent the
 189      * type variables declared by the generic declaration represented by this
 190      * {@code GenericDeclaration} object, in declaration order.  Returns an




 149                                                 exceptionTypes, modifiers, slot,
 150                                                 signature,
 151                                                 annotations,
 152                                                 parameterAnnotations);
 153         res.root = this;
 154         // Might as well eagerly propagate this if already present
 155         res.constructorAccessor = constructorAccessor;
 156         return res;
 157     }
 158 
 159     /**
 160      * Returns the {@code Class} object representing the class that declares
 161      * the constructor represented by this {@code Constructor} object.
 162      */
 163     public Class<T> getDeclaringClass() {
 164         return clazz;
 165     }
 166 
 167     /**
 168      * Returns the name of this constructor, as a string.  This is
 169      * the binary name of the constructor's declaring class.

 170      */
 171     public String getName() {
 172         return getDeclaringClass().getName();
 173     }
 174 
 175     /**
 176      * Returns the Java language modifiers for the constructor
 177      * represented by this {@code Constructor} object, as an integer. The
 178      * {@code Modifier} class should be used to decode the modifiers.
 179      *
 180      * @see Modifier
 181      */
 182     public int getModifiers() {
 183         return modifiers;
 184     }
 185 
 186     /**
 187      * Returns an array of {@code TypeVariable} objects that represent the
 188      * type variables declared by the generic declaration represented by this
 189      * {@code GenericDeclaration} object, in declaration order.  Returns an