IT. Expert System.

Android Reference

Method


java.lang.reflect

Class Method

    • Field Detail

      • ORDER_BY_SIGNATURE

        public static final Comparator<Method> ORDER_BY_SIGNATURE
        Orders methods by their name, parameters and return type.
    • Method Detail

      • getTypeParameters

        public TypeVariable<Method>[] 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 method's declaration, including the type parameters.
        Returns:
        the string representation of this method
      • getGenericParameterTypes

        public Type[] getGenericParameterTypes()
        Returns the parameter types as an array of Type instances, in declaration order. If this method has no parameters, an empty array is returned.
        Returns:
        the parameter types
        Throws:
        GenericSignatureFormatError - if the generic method 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 method has no declared exceptions, an empty array will be returned.
        Returns:
        an array of generic exception types
        Throws:
        GenericSignatureFormatError - if the generic method 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 method. If there are no parameters on this method, then an empty array is returned. If there are no annotations set, then and array of empty arrays is returned.
        Returns:
        an array of arrays of Annotation instances
      • isVarArgs

        public boolean isVarArgs()
        Indicates whether or not this method takes a variable number argument.
        Returns:
        true if a vararg is declared, false otherwise
      • isBridge

        public boolean isBridge()
        Indicates whether or not this method is a bridge.
        Returns:
        true if this method is a bridge, false otherwise
      • isSynthetic

        public boolean isSynthetic()
        Indicates whether or not this method is synthetic.
        Specified by:
        isSynthetic in interface Member
        Returns:
        true if this method is synthetic, false otherwise
      • getDefaultValue

        public Object getDefaultValue()
        Returns the default value for the annotation member represented by this method.
        Returns:
        the default value, or null if none
        Throws:
        TypeNotPresentException - if this annotation member is of type Class and no definition can be found
      • equals

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

        public Class<?> getDeclaringClass()
        Returns the class that declares this method.
        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 method has no declared exceptions, an empty array is returned.
        Returns:
        the declared exception classes
      • getModifiers

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

        public String getName()
        Returns the name of the method represented by this Method instance.
        Specified by:
        getName in interface Member
        Returns:
        the name of this method
      • getParameterTypes

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

        public Class<?> getReturnType()
        Returns the Class associated with the return type of this method.
        Returns:
        the return type
      • hashCode

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

        public Object invoke(Object receiver,
                    Object... args)
                      throws IllegalAccessException,
                             IllegalArgumentException,
                             InvocationTargetException
        Returns the result of dynamically invoking this method. Equivalent to receiver.methodName(arg1, arg2, ... , argN).

        If the method is static, the receiver argument is ignored (and may be null).

        If the method takes no arguments, you can pass (Object[]) null instead of allocating an empty array.

        If you're calling a varargs method, you need to pass an Object[] for the varargs parameter: that conversion is usually done in javac, not the VM, and the reflection machinery does not do this for you. (It couldn't, because it would be ambiguous.)

        Reflective method invocation follows the usual process for method lookup.

        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 return value itself is returned. If the method is declared to return a primitive type, the return value is boxed. If the return type is void, null is returned.

        Parameters:
        receiver - the object on which to call this method (or null for static methods)
        args - the arguments to the method
        Returns:
        the result
        Throws:
        NullPointerException - if receiver == null for a non-static method
        IllegalAccessException - if this method is not accessible (see AccessibleObject)
        IllegalArgumentException - if the number of arguments doesn't match the number of parameters, the receiver is incompatible with the declaring class, or an argument could not be unboxed or converted by a widening conversion to the corresponding parameter type
        InvocationTargetException - if an exception was thrown by the invoked method
      • toString

        public String toString()
        Returns a string containing a concise, human-readable description of this method. The format of the string is:
        1. modifiers (if any)
        2. return type or 'void'
        3. declaring class name
        4. '('
        5. parameter types, separated by ',' (if any)
        6. ')'
        7. 'throws' plus exception types, separated by ',' (if any)
        For example: public native Object java.lang.Method.invoke(Object,Object) throws IllegalAccessException,IllegalArgumentException ,InvocationTargetException
        Overrides:
        toString in class Object
        Returns:
        a printable representation for this method


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: 932 / . Delta: 0.04094 с