IT. Expert System.

Android Reference

Constructor


java.lang.reflect

Class Constructor<T>

    • Method Detail

      • getTypeParameters

        public TypeVariable<Constructor<T>>[] getTypeParameters()
        Description copied from interface: GenericDeclaration
        Returns the declared type parameters in declaration order. If there are no type parameters, this method returns a zero length array.
        Specified by:
        getTypeParameters in interface GenericDeclaration
        Returns:
        the declared type parameters in declaration order
      • toGenericString

        public String toGenericString()
        Returns the string representation of the constructor's declaration, including the type parameters.
        Returns:
        the string representation of the constructor's declaration
      • getGenericParameterTypes

        public Type[] getGenericParameterTypes()
        Returns the generic parameter types as an array of Type instances, in declaration order. If this constructor has no generic parameters, an empty array is returned.
        Returns:
        the parameter types
        Throws:
        GenericSignatureFormatError - if the generic constructor signature is invalid
        TypeNotPresentException - if any parameter type points to a missing type
        MalformedParameterizedTypeException - if any parameter type points to a type that cannot be instantiated for some reason
      • getGenericExceptionTypes

        public Type[] getGenericExceptionTypes()
        Returns the exception types as an array of Type instances. If this constructor has no declared exceptions, an empty array will be returned.
        Returns:
        an array of generic exception types
        Throws:
        GenericSignatureFormatError - if the generic constructor signature is invalid
        TypeNotPresentException - if any exception type points to a missing type
        MalformedParameterizedTypeException - if any exception type points to a type that cannot be instantiated for some reason
      • getAnnotation

        public <A extends Annotation> A getAnnotation(Class<A> annotationType)
        Description copied from interface: AnnotatedElement
        Returns, for this element, the annotation with the specified type, or null if no annotation with the specified type is present (including inherited annotations).
        Specified by:
        getAnnotation in interface AnnotatedElement
        Overrides:
        getAnnotation in class AccessibleObject
        Parameters:
        annotationType - the type of the annotation to search for
        Returns:
        the annotation with the specified type or null
      • isAnnotationPresent

        public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
        Description copied from interface: AnnotatedElement
        Indicates whether or not this element has an annotation with the specified annotation type (including inherited annotations).
        Specified by:
        isAnnotationPresent in interface AnnotatedElement
        Overrides:
        isAnnotationPresent in class AccessibleObject
        Parameters:
        annotationType - the type of the annotation to search for
        Returns:
        true if the annotation exists, false otherwise
      • getParameterAnnotations

        public Annotation[][] getParameterAnnotations()
        Returns an array of arrays that represent the annotations of the formal parameters of this constructor. If there are no parameters on this constructor, then an empty array is returned. If there are no annotations set, then an array of empty arrays is returned.
        Returns:
        an array of arrays of Annotation instances
      • isVarArgs

        public boolean isVarArgs()
        Indicates whether or not this constructor takes a variable number of arguments.
        Returns:
        true if a vararg is declare, otherwise false
      • isSynthetic

        public boolean isSynthetic()
        Indicates whether or not this constructor is synthetic (artificially introduced by the compiler).
        Specified by:
        isSynthetic in interface Member
        Returns:
        true if this constructor is synthetic, false otherwise
      • equals

        public boolean equals(Object object)
        Indicates whether or not the specified object is equal to this constructor. To be equal, the specified object must be an instance of Constructor with the same declaring class and parameter types as this constructor.
        Overrides:
        equals in class Object
        Parameters:
        object - the object to compare
        Returns:
        true if the specified object is equal to this constructor, false otherwise
        See Also:
        hashCode()
      • getDeclaringClass

        public Class<T> getDeclaringClass()
        Returns the class that declares this constructor.
        Specified by:
        getDeclaringClass in interface Member
        Returns:
        the declaring class
      • getExceptionTypes

        public Class<?>[] getExceptionTypes()
        Returns the exception types as an array of Class instances. If this constructor has no declared exceptions, an empty array will be returned.
        Returns:
        the declared exception classes
      • getModifiers

        public int getModifiers()
        Returns the modifiers for this constructor. The Modifier class should be used to decode the result.
        Specified by:
        getModifiers in interface Member
        Returns:
        the modifiers for this constructor
        See Also:
        Modifier
      • getName

        public String getName()
        Returns the name of this constructor.
        Specified by:
        getName in interface Member
        Returns:
        the name of this constructor
      • getParameterTypes

        public Class<?>[] getParameterTypes()
        Returns an array of the Class objects associated with the parameter types of this constructor. If the constructor was declared with no parameters, an empty array will be returned.
        Returns:
        the parameter types
      • hashCode

        public int hashCode()
        Returns an integer hash code for this constructor. Constructors which are equal return the same value for this method. The hash code for a Constructor is the hash code of the name of the declaring class.
        Overrides:
        hashCode in class Object
        Returns:
        the hash code
        See Also:
        equals(java.lang.Object)
      • newInstance

        public T newInstance(Object... args)
                      throws InstantiationException,
                             IllegalAccessException,
                             IllegalArgumentException,
                             InvocationTargetException
        Returns a new instance of the declaring class, initialized by dynamically invoking the constructor represented by this Constructor object. This reproduces the effect of new declaringClass(arg1, arg2, ... , argN) This method performs the following:
        • A new instance of the declaring class is created. If the declaring class cannot be instantiated (i.e. abstract class, an interface, an array type, or a primitive type) then an InstantiationException is thrown.
        • If this Constructor object is enforcing access control (see AccessibleObject) and this constructor is not accessible from the current context, an IllegalAccessException is thrown.
        • If the number of arguments passed and the number of parameters do not match, an IllegalArgumentException is thrown.
        • For each argument passed:
          • If the corresponding parameter type is a primitive type, the argument is unboxed. If the unboxing fails, an IllegalArgumentException is thrown.
          • If the resulting argument cannot be converted to the parameter type via a widening conversion, an IllegalArgumentException is thrown.
        • The constructor represented by this Constructor object is then invoked. If an exception is thrown during the invocation, it is caught and wrapped in an InvocationTargetException. This exception is then thrown. If the invocation completes normally, the newly initialized object is returned.
        Parameters:
        args - the arguments to the constructor
        Returns:
        the new, initialized, object
        Throws:
        InstantiationException - if the class cannot be instantiated
        IllegalAccessException - if this constructor is not accessible
        IllegalArgumentException - if an incorrect number of arguments are passed, or an argument could not be converted by a widening conversion
        InvocationTargetException - if an exception was thrown by the invoked constructor
        See Also:
        AccessibleObject
      • toString

        public String toString()
        Returns a string containing a concise, human-readable description of this constructor. The format of the string is:
        1. modifiers (if any)
        2. declaring class name
        3. '('
        4. parameter types, separated by ',' (if any)
        5. ')'
        6. 'throws' plus exception types, separated by ',' (if any)
        For example: public String(byte[],String) throws UnsupportedEncodingException
        Overrides:
        toString in class Object
        Returns:
        a printable representation for this constructor


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 2557 / . Delta: 0.04027 с