Java Doc for ReflectUtils.java in  » Web-Framework » RSF » uk » org » ponder » reflect » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » RSF » uk.org.ponder.reflect 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   uk.org.ponder.reflect.ReflectUtils

ReflectUtils
public class ReflectUtils (Code)

author:
   Antranig Basman (antranig@caret.cam.ac.uk)


Field Summary
final public static  booleanPREFIX
    
final public static  booleanSUFFIX
    
final public static  intUNKNOWN_SIZE
    


Method Summary
public static  voidaddStaticStrings(Object provider, String xfix, boolean prefix, StringList strings)
    
public static  Method[]getMatchingMethods(Class clazz, String methodname, Object[] args)
    
public static  ListgetSuperclasses(Class clazz)
     Returns a list of all superclasses and implemented interfaces by the supplied class, recursively to the base, up to but excluding Object.class.
public static  intgetTypeDifferenceWeight(Class[] argTypes, Object[] args)
     Determine a weight that represents the class hierarchy difference between types and arguments.
public static  booleanhasMethod(Object obj, String methodname)
     Determines whether an object is capable of supporting a method invocation with a given name.
public static  ObjectinstantiateContainer(Class declaredtype, int size, ReflectiveCache cache)
     Instantiates a "default" type of container conforming to a given interface and of a given size.
public static  booleanisAssignable(Class type, Object value)
     Determine if the given type is assignable from the given value, assuming setting by reflection.
public static  booleanisAssignable(Class declaredType, Class objectType)
     Determine if the given target type is assignable from the given value type, assuming setting by reflection.
public static  booleanisPublicStatic(int modifiers)
    

Field Detail
PREFIX
final public static boolean PREFIX(Code)



SUFFIX
final public static boolean SUFFIX(Code)



UNKNOWN_SIZE
final public static int UNKNOWN_SIZE(Code)





Method Detail
addStaticStrings
public static void addStaticStrings(Object provider, String xfix, boolean prefix, StringList strings)(Code)



getMatchingMethods
public static Method[] getMatchingMethods(Class clazz, String methodname, Object[] args)(Code)



getSuperclasses
public static List getSuperclasses(Class clazz)(Code)
Returns a list of all superclasses and implemented interfaces by the supplied class, recursively to the base, up to but excluding Object.class. These will be listed in order from the supplied class, all concrete superclasses in ascending order, and then finally all interfaces in recursive ascending order.



getTypeDifferenceWeight
public static int getTypeDifferenceWeight(Class[] argTypes, Object[] args)(Code)
Determine a weight that represents the class hierarchy difference between types and arguments. A direct match, i.e. type Integer -> arg of class Integer, does not increase the result - all direct matches means weight 0. A match between type Object and arg of class Integer would increase the weight by 2, due to the superclass 2 steps up in the hierarchy (i.e. Object) being the last one that still matches the required type Object. Type Number and class Integer would increase the weight by 1 accordingly, due to the superclass 1 step up the hierarchy (i.e. Number) still matching the required type Number. Therefore, with an arg of type Integer, a constructor (Integer) would be preferred to a constructor (Number) which would in turn be preferred to a constructor (Object). All argument weights get accumulated.

This method will assign a penalty of 1024 to an invocation that would require a type conversion (currently only default leaf conversions from String are considered)

This method adapted from Spring framework AutowireUtils.java release version 2.0.5
author:
   Juergen Hoeller
Parameters:
  argTypes - the argument types to match
Parameters:
  args - the arguments to match the accumulated weight for all arguments



hasMethod
public static boolean hasMethod(Object obj, String methodname)(Code)
Determines whether an object is capable of supporting a method invocation with a given name. Used primarily to resolve potential ambiguity in EL expressions that are being interpreted as method bindings.



instantiateContainer
public static Object instantiateContainer(Class declaredtype, int size, ReflectiveCache cache)(Code)
Instantiates a "default" type of container conforming to a given interface and of a given size. If asked to create an array of unknown size, will return an zero-element array instead, signalling a "placeholder".



isAssignable
public static boolean isAssignable(Class type, Object value)(Code)
Determine if the given type is assignable from the given value, assuming setting by reflection. Considers primitive wrapper classes as assignable to the corresponding primitive types.

For example used in a bean factory's constructor resolution.

Taken from Spring Framework "BeanUtils.java" release version 2.0.5
author:
   Rod Johnson
author:
   Juergen Hoeller
author:
   Rob Harrop
Parameters:
  type - the target type
Parameters:
  value - the value that should be assigned to the type if the type is assignable from the value




isAssignable
public static boolean isAssignable(Class declaredType, Class objectType)(Code)
Determine if the given target type is assignable from the given value type, assuming setting by reflection. Considers primitive wrapper classes as assignable to the corresponding primitive types.
Parameters:
  declaredType - the target type
Parameters:
  objectType - the value type that should be assigned to the target type if the target type is assignable from the value type



isPublicStatic
public static boolean isPublicStatic(int modifiers)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.