From 31d794be59cb2d1bf264df79f471b0c8d5f5a457 Mon Sep 17 00:00:00 2001 From: lresende Date: Sat, 21 Nov 2009 07:40:26 +0000 Subject: Moving to site trunk git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@882841 13f79535-47bb-0310-9956-ffa450edef68 --- .../introspect/impl/JavaIntrospectionHelper.html | 757 +++++++++++++++++++++ 1 file changed, 757 insertions(+) create mode 100644 site/trunk/site-publish/doc/javadoc/java-sca-1.4/org/apache/tuscany/sca/implementation/java/introspect/impl/JavaIntrospectionHelper.html (limited to 'site/trunk/site-publish/doc/javadoc/java-sca-1.4/org/apache/tuscany/sca/implementation/java/introspect/impl/JavaIntrospectionHelper.html') diff --git a/site/trunk/site-publish/doc/javadoc/java-sca-1.4/org/apache/tuscany/sca/implementation/java/introspect/impl/JavaIntrospectionHelper.html b/site/trunk/site-publish/doc/javadoc/java-sca-1.4/org/apache/tuscany/sca/implementation/java/introspect/impl/JavaIntrospectionHelper.html new file mode 100644 index 0000000000..cd2bcf9fb9 --- /dev/null +++ b/site/trunk/site-publish/doc/javadoc/java-sca-1.4/org/apache/tuscany/sca/implementation/java/introspect/impl/JavaIntrospectionHelper.html @@ -0,0 +1,757 @@ + + + + + + +JavaIntrospectionHelper + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.apache.tuscany.sca.implementation.java.introspect.impl +
+Class JavaIntrospectionHelper

+
+java.lang.Object
+  extended by org.apache.tuscany.sca.implementation.java.introspect.impl.JavaIntrospectionHelper
+
+
+
+
public final class JavaIntrospectionHelper
extends java.lang.Object
+ + +

+Implements various reflection-related operations +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+static booleanexactMethodMatch(java.lang.reflect.Method method1, + java.lang.reflect.Method method2) + +
+          Determines if two methods "match" - that is, they have the same method + names and exact parameter types (one is not a supertype of the other)
+static java.lang.reflect.FieldfindClosestMatchingField(java.lang.String name, + java.lang.Class type, + java.util.Set<java.lang.reflect.Field> fields) + +
+          Finds the closest matching field with the given name, that is, a field of + the exact specified type or, alternately, of a supertype.
+static java.lang.reflect.MethodfindClosestMatchingMethod(java.lang.String name, + java.lang.Class[] types, + java.util.Set<java.lang.reflect.Method> methods) + +
+          Finds the closest matching method with the given name, that is, a method + taking the exact parameter types or, alternately, parameter supertypes.
+static java.util.Set<java.lang.Class>getAllInterfaces(java.lang.Class clazz) + +
+          Returns the set of interfaces implemented by the given class and its + ancestors or a blank set if none
+static java.util.Set<java.lang.reflect.Field>getAllPublicAndProtectedFields(java.lang.Class clazz, + boolean validating) + +
+          Returns a collection of public, and protected fields declared by a class + or one of its supertypes
+static java.util.Set<java.lang.reflect.Method>getAllUniquePublicProtectedMethods(java.lang.Class clazz, + boolean validating) + +
+          Returns a collection of public and protected methods declared by a class + or one of its supertypes.
+static java.lang.Class<?>getArrayType(java.lang.Class<?> componentType, + int dims) + +
+           
+static java.lang.StringgetBaseName(java.lang.Class<?> implClass) + +
+          Returns the simple name of a class - i.e.
+static java.lang.Class<?>getBaseType(java.lang.Class<?> cls, + java.lang.reflect.Type genericType) + +
+           
+static java.lang.Class<?>getBusinessInterface(java.lang.Class<?> cls, + java.lang.reflect.Type callableReferenceType) + +
+           
+static + + + + +
+<T> java.lang.reflect.Constructor<T>
+
getDefaultConstructor(java.lang.Class<T> clazz) + +
+           
+static java.lang.Class<?>getErasure(java.lang.reflect.Type type) + +
+           
+static java.util.List<? extends java.lang.reflect.Type>getGenerics(java.lang.reflect.Type genericType) + +
+          Returns the generic types represented in the given type.
+static java.lang.reflect.TypegetParameterType(java.lang.reflect.Type type) + +
+           
+static java.util.Set<java.lang.reflect.Field>getPrivateFields(java.lang.Class clazz) + +
+           
+static java.util.Set<java.lang.reflect.Method>getPrivateMethods(java.lang.Class clazz) + +
+           
+static java.lang.StringgetSignature(java.lang.Class<?> cls) + +
+           
+static java.lang.ClassintrospectGeneric(java.lang.Class<?> clazz, + int pos) + +
+          Returns the generic type specified by the class at the given position as + in:

public class Foo{ //..

+static booleanisGetter(java.lang.reflect.Method method) + +
+           
+static booleanisImmutable(java.lang.Class clazz) + +
+           
+static booleanisSetter(java.lang.reflect.Method method) + +
+           
+static java.lang.StringtoGetter(java.lang.String name) + +
+          Takes a property name and converts it to a getter method name according + to JavaBean conventions.
+static java.lang.StringtoPropertyName(java.lang.String name) + +
+          Takes a setter or getter method name and converts it to a property name + according to JavaBean conventions.
+static java.lang.StringtoSetter(java.lang.String name) + +
+          Takes a property name and converts it to a setter method name according + to JavaBean conventions.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Method Detail
+ +

+getAllPublicAndProtectedFields

+
+public static java.util.Set<java.lang.reflect.Field> getAllPublicAndProtectedFields(java.lang.Class clazz,
+                                                                                    boolean validating)
+
+
Returns a collection of public, and protected fields declared by a class + or one of its supertypes +

+

+
+
+
+
+ +

+getAllUniquePublicProtectedMethods

+
+public static java.util.Set<java.lang.reflect.Method> getAllUniquePublicProtectedMethods(java.lang.Class clazz,
+                                                                                         boolean validating)
+
+
Returns a collection of public and protected methods declared by a class + or one of its supertypes. Note that overridden methods will not be + returned in the collection (i.e. only the method override will be).

+ This method can potentially be expensive as reflection information is not + cached. It is assumed that this method will be used during a + configuration phase. +

+

+
+
+
+
+ +

+findClosestMatchingField

+
+public static java.lang.reflect.Field findClosestMatchingField(java.lang.String name,
+                                                               java.lang.Class type,
+                                                               java.util.Set<java.lang.reflect.Field> fields)
+
+
Finds the closest matching field with the given name, that is, a field of + the exact specified type or, alternately, of a supertype. +

+

+
Parameters:
name - the name of the field
type - the field type
fields - the collection of fields to search +
Returns:
the matching field or null if not found
+
+
+
+ +

+findClosestMatchingMethod

+
+public static java.lang.reflect.Method findClosestMatchingMethod(java.lang.String name,
+                                                                 java.lang.Class[] types,
+                                                                 java.util.Set<java.lang.reflect.Method> methods)
+
+
Finds the closest matching method with the given name, that is, a method + taking the exact parameter types or, alternately, parameter supertypes. +

+

+
Parameters:
name - the name of the method
types - the method parameter types
methods - the collection of methods to search +
Returns:
the matching method or null if not found
+
+
+
+ +

+exactMethodMatch

+
+public static boolean exactMethodMatch(java.lang.reflect.Method method1,
+                                       java.lang.reflect.Method method2)
+
+
Determines if two methods "match" - that is, they have the same method + names and exact parameter types (one is not a supertype of the other) +

+

+
+
+
+
+ +

+getDefaultConstructor

+
+public static <T> java.lang.reflect.Constructor<T> getDefaultConstructor(java.lang.Class<T> clazz)
+                                                              throws java.lang.NoSuchMethodException
+
+
+ +
Throws: +
java.lang.NoSuchMethodException
+
+
+
+ +

+getBaseName

+
+public static java.lang.String getBaseName(java.lang.Class<?> implClass)
+
+
Returns the simple name of a class - i.e. the class name devoid of its + package qualifier +

+

+
Parameters:
implClass - the implementation class
+
+
+
+ +

+isImmutable

+
+public static boolean isImmutable(java.lang.Class clazz)
+
+
+
+
+
+
+ +

+toGetter

+
+public static java.lang.String toGetter(java.lang.String name)
+
+
Takes a property name and converts it to a getter method name according + to JavaBean conventions. For example, property + foo is returned as getFoo +

+

+
+
+
+
+ +

+toPropertyName

+
+public static java.lang.String toPropertyName(java.lang.String name)
+
+
Takes a setter or getter method name and converts it to a property name + according to JavaBean conventions. For example, setFoo(var) + is returned as property foo +

+

+
+
+
+
+ +

+getErasure

+
+public static java.lang.Class<?> getErasure(java.lang.reflect.Type type)
+
+
+
+
+
+
+ +

+getBaseType

+
+public static java.lang.Class<?> getBaseType(java.lang.Class<?> cls,
+                                             java.lang.reflect.Type genericType)
+
+
+
+
+
+
+ +

+getParameterType

+
+public static java.lang.reflect.Type getParameterType(java.lang.reflect.Type type)
+
+
+
+
+
+
+ +

+getBusinessInterface

+
+public static java.lang.Class<?> getBusinessInterface(java.lang.Class<?> cls,
+                                                      java.lang.reflect.Type callableReferenceType)
+
+
+
+
+
+
+ +

+toSetter

+
+public static java.lang.String toSetter(java.lang.String name)
+
+
Takes a property name and converts it to a setter method name according + to JavaBean conventions. For example, the property + foo is returned as setFoo(var) +

+

+
+
+
+
+ +

+getGenerics

+
+public static java.util.List<? extends java.lang.reflect.Type> getGenerics(java.lang.reflect.Type genericType)
+
+
Returns the generic types represented in the given type. Usage as + follows: + JavaIntrospectionHelper.getGenerics(field.getGenericType()); +

+ JavaIntrospectionHelper.getGenerics(m.getGenericParameterTypes()[0];); +

+

+ +
Returns:
the generic types in order of declaration or an empty array if + the type is not genericized
+
+
+
+ +

+introspectGeneric

+
+public static java.lang.Class introspectGeneric(java.lang.Class<?> clazz,
+                                                int pos)
+
+
Returns the generic type specified by the class at the given position as + in:

public class Foo{ //.. } +

+ JavaIntrospectionHelper.introspectGeneric(Foo.class,1); +

+ will return Baz. +

+

+
+
+
+
+ +

+getAllInterfaces

+
+public static java.util.Set<java.lang.Class> getAllInterfaces(java.lang.Class clazz)
+
+
Returns the set of interfaces implemented by the given class and its + ancestors or a blank set if none +

+

+
+
+
+
+ +

+isSetter

+
+public static boolean isSetter(java.lang.reflect.Method method)
+
+
+
+
+
+
+ +

+isGetter

+
+public static boolean isGetter(java.lang.reflect.Method method)
+
+
+
+
+
+
+ +

+getSignature

+
+public static java.lang.String getSignature(java.lang.Class<?> cls)
+
+
+
+
+
+
+ +

+getArrayType

+
+public static java.lang.Class<?> getArrayType(java.lang.Class<?> componentType,
+                                              int dims)
+                                       throws java.lang.ClassNotFoundException
+
+
+ +
Throws: +
java.lang.ClassNotFoundException
+
+
+
+ +

+getPrivateMethods

+
+public static java.util.Set<java.lang.reflect.Method> getPrivateMethods(java.lang.Class clazz)
+
+
+
+
+
+
+ +

+getPrivateFields

+
+public static java.util.Set<java.lang.reflect.Field> getPrivateFields(java.lang.Class clazz)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + -- cgit v1.2.3