Java Doc for ClassUtils.java in  » Search-Engine » compass-2.0 » org » compass » core » util » 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 » Search Engine » compass 2.0 » org.compass.core.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.compass.core.util.ClassUtils

ClassUtils
abstract public class ClassUtils (Code)
Miscellaneous class utility methods. Mainly for internal use within the framework; consider Jakarta's Commons Lang for a more comprehensive suite of utilities.
author:
   kimchy


Field Summary
final public static  StringARRAY_SUFFIX
    


Method Summary
public static  StringaddResourcePathToPackagePath(Class clazz, String resourceName)
     Return a path suitable for use with ClassLoader.getResource (also suitable for use with Class.getResource by prepending a slash ('/') to the return value.
public static  StringclassPackageAsResourcePath(Class clazz)
     Given an input class object, return a string which consists of the class's package name as a pathname, i.e., all dots ('.') are replaced by slashes ('/').
public static  ClassforName(String name, ClassLoader classLoader)
     Replacement for Class.forName() that also returns Class instances for primitives (like "int") and array class names (like "String[]").
public static  Class[]getAllInterfaces(Object object)
     Return all interfaces that the given object implements as array, including ones implemented by superclasses.
public static  SetgetAllInterfacesAsSet(Object object)
     Return all interfaces that the given object implements as List, including ones implemented by superclasses.
public static  Class[]getAllInterfacesForClass(Class clazz)
     Return all interfaces that the given class implements as array, including ones implemented by superclasses.
public static  SetgetAllInterfacesForClassAsSet(Class clazz)
     Return all interfaces that the given class implements as Set, including ones implemented by superclasses.
public static  ConstructorgetDefaultConstructor(Class clazz)
     Returns the default constructor for the class.
public static  intgetMethodCountForName(Class clazz, String methodName)
     Return the number of methods with a given name (with any argument types), for the given class and/or its superclasses.
public static  StringgetQualifiedMethodName(Method method)
     Return the qualified name of the given method, consisting of fully qualified interface/class name + "." + method name.
public static  StringgetShortName(Class clazz)
     Get the class name without the qualified package name.
public static  StringgetShortName(String className)
     Get the class name without the qualified package name.
public static  StringgetShortNameAsProperty(Class clazz)
     Return the short string name of a Java class in decapitalized JavaBeans property format.
public static  StringgetShortNameForField(Field field)
    
public static  StringgetShortNameForMethod(Method method)
    
public static  MethodgetStaticMethod(Class clazz, String methodName, Class[] args)
     Return a static method of a class.
public static  booleanhasAtLeastOneMethodWithName(Class clazz, String methodName)
     Does the given class and/or its superclasses at least have one or more methods (with any argument types)? Includes non-public methods.
public static  booleanhasMethod(Class clazz, String methodName, Class[] paramTypes)
     Determine whether the given class has a method with the given signature.
public static  booleanisAbstractClass(Class clazz)
     Returns true of the class is an abstract class.
public static  booleanisPublic(Class clazz, Member member)
     Returns true if the member is public and the class is public.
public static  ClassresolvePrimitiveClassName(String name)
     Resolve the given class name as primitive class, if appropriate.

Field Detail
ARRAY_SUFFIX
final public static String ARRAY_SUFFIX(Code)
Suffix for array class names





Method Detail
addResourcePathToPackagePath
public static String addResourcePathToPackagePath(Class clazz, String resourceName)(Code)
Return a path suitable for use with ClassLoader.getResource (also suitable for use with Class.getResource by prepending a slash ('/') to the return value. Built by taking the package of the specified class file, converting all dots ('.') to slashes ('/'), adding a trailing slash if necesssary, and concatenating the specified resource name to this.
As such, this function may be used to build a path suitable for loading a resource file that is in the same package as a class file, although {link org.springframework.core.io.ClassPathResource} is usually even more convenient.
Parameters:
  clazz - the Class whose package will be used as the base
Parameters:
  resourceName - the resource name to append. A leading slash is optional. the built-up resource path
See Also:   java.lang.ClassLoader.getResource
See Also:   java.lang.Class.getResource



classPackageAsResourcePath
public static String classPackageAsResourcePath(Class clazz)(Code)
Given an input class object, return a string which consists of the class's package name as a pathname, i.e., all dots ('.') are replaced by slashes ('/'). Neither a leading nor trailing slash is added. The result could be concatenated with a slash and the name of a resource, and fed directly to ClassLoader.getResource(). For it to be fed to Class.getResource, a leading slash would also have to be prepended to the return value.
Parameters:
  clazz - the input class. A null value or the default (empty) packagewill result in an empty string ("") being returned. a path which represents the package name
See Also:   java.lang.ClassLoader.getResource
See Also:   java.lang.Class.getResource



forName
public static Class forName(String name, ClassLoader classLoader) throws ClassNotFoundException(Code)
Replacement for Class.forName() that also returns Class instances for primitives (like "int") and array class names (like "String[]").
Parameters:
  name - the name of the Class
Parameters:
  classLoader - the class loader to use Class instance for the supplied name
See Also:   java.lang.Class.forName
See Also:   java.lang.Thread.getContextClassLoader



getAllInterfaces
public static Class[] getAllInterfaces(Object object)(Code)
Return all interfaces that the given object implements as array, including ones implemented by superclasses.
Parameters:
  object - the object to analyse for interfaces all interfaces that the given object implements as array



getAllInterfacesAsSet
public static Set getAllInterfacesAsSet(Object object)(Code)
Return all interfaces that the given object implements as List, including ones implemented by superclasses.
Parameters:
  object - the object to analyse for interfaces all interfaces that the given object implements as List



getAllInterfacesForClass
public static Class[] getAllInterfacesForClass(Class clazz)(Code)
Return all interfaces that the given class implements as array, including ones implemented by superclasses.
Parameters:
  clazz - the class to analyse for interfaces all interfaces that the given object implements as array



getAllInterfacesForClassAsSet
public static Set getAllInterfacesForClassAsSet(Class clazz)(Code)
Return all interfaces that the given class implements as Set, including ones implemented by superclasses.
Parameters:
  clazz - the class to analyse for interfaces all interfaces that the given object implements as Set



getDefaultConstructor
public static Constructor getDefaultConstructor(Class clazz)(Code)
Returns the default constructor for the class. If it is not visible, will set it to be accessible.
Parameters:
  clazz - the class to get the default constructor the default constructor



getMethodCountForName
public static int getMethodCountForName(Class clazz, String methodName)(Code)
Return the number of methods with a given name (with any argument types), for the given class and/or its superclasses. Includes non-public methods.
Parameters:
  clazz - the clazz to check
Parameters:
  methodName - the name of the method the number of methods with the given name



getQualifiedMethodName
public static String getQualifiedMethodName(Method method)(Code)
Return the qualified name of the given method, consisting of fully qualified interface/class name + "." + method name.
Parameters:
  method - the method the qualified name of the method



getShortName
public static String getShortName(Class clazz)(Code)
Get the class name without the qualified package name.
Parameters:
  clazz - the class to get the short name for the class name of the class without the package name
throws:
  IllegalArgumentException - if the class is null



getShortName
public static String getShortName(String className)(Code)
Get the class name without the qualified package name.
Parameters:
  className - the className to get the short name for the class name of the class without the package name
throws:
  IllegalArgumentException - if the className is empty



getShortNameAsProperty
public static String getShortNameAsProperty(Class clazz)(Code)
Return the short string name of a Java class in decapitalized JavaBeans property format.
Parameters:
  clazz - the class the short name rendered in a standard JavaBeans property format
See Also:   java.beans.Introspector.decapitalize(String)



getShortNameForField
public static String getShortNameForField(Field field)(Code)



getShortNameForMethod
public static String getShortNameForMethod(Method method)(Code)



getStaticMethod
public static Method getStaticMethod(Class clazz, String methodName, Class[] args)(Code)
Return a static method of a class.
Parameters:
  methodName - the static method name
Parameters:
  clazz - the class which defines the method
Parameters:
  args - the parameter types to the method the static method, or null if no static method was found
throws:
  IllegalArgumentException - if the method name is blank or the clazz is null



hasAtLeastOneMethodWithName
public static boolean hasAtLeastOneMethodWithName(Class clazz, String methodName)(Code)
Does the given class and/or its superclasses at least have one or more methods (with any argument types)? Includes non-public methods.
Parameters:
  clazz - the clazz to check
Parameters:
  methodName - the name of the method whether there is at least one method with the given name



hasMethod
public static boolean hasMethod(Class clazz, String methodName, Class[] paramTypes)(Code)
Determine whether the given class has a method with the given signature. Essentially translates NoSuchMethodException to "false".
Parameters:
  clazz - the clazz to analyze
Parameters:
  methodName - the name of the method
Parameters:
  paramTypes - the parameter types of the method



isAbstractClass
public static boolean isAbstractClass(Class clazz)(Code)
Returns true of the class is an abstract class. An abstract class is a either an abstract class or an interface.
Parameters:
  clazz - the class to check for abstact true if the class is an abstract class



isPublic
public static boolean isPublic(Class clazz, Member member)(Code)
Returns true if the member is public and the class is public.
Parameters:
  clazz - the class to check for public
Parameters:
  member - the member to check for public true if the member is public and the class is public



resolvePrimitiveClassName
public static Class resolvePrimitiveClassName(String name)(Code)
Resolve the given class name as primitive class, if appropriate.
Parameters:
  name - the name of the potentially primitive class the primitive class, or null if the name does not denotea primitive class



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.