| java.lang.Object org.xins.common.Utils
Utils | final public class Utils (Code) | | General utility functions.
version: $Revision: 1.48 $ $Date: 2007/05/22 09:35:33 $ author: Ernst de Haan since: XINS 1.1.0 |
Method Summary | |
public static String | getCallingClass(int level) Retrieves the name of the calling class at the specified level. | public static String | getCallingClass() Retrieves the name of the calling class. | public static String | getCallingMethod(int level) Retrieves the name of the calling method at the specified level. | public static String | getCallingMethod() Retrieves the name of the calling method. | public static String | getClassName(Object object) Determines the name of the class of the specified object. | public static double | getJavaVersion() Retrieves the actual (major) Java version. | public static String | getNameOfClass(Class c) Determines the name of the specified class. | public static void | logIgnoredException(Throwable exception) Logs an exception that will be ignored. | public static void | logIgnoredException(String detectingClass, String detectingMethod, String subjectClass, String subjectMethod, Throwable exception) Logs an exception that will be ignored. | public static ProgrammingException | logProgrammingError(String detail) Logs a programming error with an optional cause exception, and returns a
ProgrammingException object for it. | public static ProgrammingException | logProgrammingError(Throwable cause) Logs a programming error with an optional cause exception, and returns a
ProgrammingException object for it. | public static ProgrammingException | logProgrammingError(String detail, Throwable cause) Logs a programming error with an optional cause exception and an optional
message, and returns a ProgrammingException object for it. | public static ProgrammingException | logProgrammingError(String detectingClass, String detectingMethod, String subjectClass, String subjectMethod, String detail, Throwable cause) }
Logs a programming error with an optional cause exception, and returns a
ProgrammingException object for it. | public static ProgrammingException | logProgrammingError(String detectingClass, String detectingMethod, String subjectClass, String subjectMethod, String detail) Logs a programming error with no cause exception, and returns a
ProgrammingException object for it. |
getCallingClass | public static String getCallingClass(int level) throws IllegalArgumentException(Code) | | Retrieves the name of the calling class at the specified level. The level
0 indicates the direct caller, while 1
indicates the caller of the caller.
If it cannot be determined, then "<unknown>" is
returned.
Parameters: level - the level of the caller, must be >= 0.the class name of the caller of the caller of this method, at thespecified level, never an empty string and never null . throws: IllegalArgumentException - if level < 0 . since: XINS 1.3.0 |
getCallingClass | public static String getCallingClass()(Code) | | Retrieves the name of the calling class. If it cannot be determined,
then a special string (e.g. "<unknown>" ) is returned.
the class name of the caller of the caller of this method, never anempty string and never null . |
getCallingMethod | public static String getCallingMethod(int level) throws IllegalArgumentException(Code) | | Retrieves the name of the calling method at the specified level. The
level 0 indicates the direct caller, while 1
indicates the caller of the caller.
If it cannot be determined, then "<unknown>" is
returned.
Parameters: level - the level of the caller, must be >= 0.the method name of the caller of the caller of this method, at thespecified level, never an empty string and never null . throws: IllegalArgumentException - if level < 0 . since: XINS 1.3.0 |
getCallingMethod | public static String getCallingMethod()(Code) | | Retrieves the name of the calling method. If it cannot be determined,
then a special string (e.g. "<unknown>" ) is returned.
the method name of the caller of the caller of this method, never anempty string and never null . |
getClassName | public static String getClassName(Object object) throws IllegalArgumentException(Code) | | Determines the name of the class of the specified object.
Parameters: object - the object to determine the name of the class for, notnull .the name of the class, never null . throws: IllegalArgumentException - if object == null . since: XINS 1.2.0 |
getJavaVersion | public static double getJavaVersion()(Code) | | Retrieves the actual (major) Java version.
the actual Java version. since: XINS 1.2.0 |
logIgnoredException | public static void logIgnoredException(String detectingClass, String detectingMethod, String subjectClass, String subjectMethod, Throwable exception) throws IllegalArgumentException(Code) | | Logs an exception that will be ignored.
Parameters: detectingClass - the name of the class that caught the exception, cannot benull . Parameters: detectingMethod - the name of the method within the detectingClass thatcaught the exception, cannot be null . Parameters: subjectClass - the name of the class which threw the exception, cannot benull . Parameters: subjectMethod - the name of the method (within the subjectClass ) whichthrew the exception, cannot be null . Parameters: exception - the exception to log, cannot be null . throws: IllegalArgumentException - if detectingClass == null || detectingMethod == null|| subjectClass == null || subjectMethod == null|| exception == null . since: XINS 1.3.0Utils.logProgrammingError(Throwable exception) |
logProgrammingError | public static ProgrammingException logProgrammingError(String detail)(Code) | | Logs a programming error with an optional cause exception, and returns a
ProgrammingException object for it.
The calling class/method are considered the detecting class and the
caller of those (one level up) is considered the subject class/method
for the programming error.
Parameters: detail - the detail message, can be null .an appropriate ProgrammingException that can be thrown by thecalling method, never null . |
logProgrammingError | public static ProgrammingException logProgrammingError(Throwable cause)(Code) | | Logs a programming error with an optional cause exception, and returns a
ProgrammingException object for it.
Parameters: cause - the cause exception, cannot be null .an appropriate ProgrammingException that can be thrown by thecalling method, never null . |
logProgrammingError | public static ProgrammingException logProgrammingError(String detail, Throwable cause)(Code) | | Logs a programming error with an optional cause exception and an optional
message, and returns a ProgrammingException object for it.
Parameters: detail - the detail message, can be null . Parameters: cause - the cause exception, cannot be null .an appropriate ProgrammingException that can be thrown by thecalling method, never null . since: XINS 2.0. |
logProgrammingError | public static ProgrammingException logProgrammingError(String detectingClass, String detectingMethod, String subjectClass, String subjectMethod, String detail, Throwable cause)(Code) | | }
Logs a programming error with an optional cause exception, and returns a
ProgrammingException object for it.
Parameters: detectingClass - the name of the class that detected the problem, ornull if unknown. Parameters: detectingMethod - the name of the method within the detectingClass thatdetected the problem, or null if unknown. Parameters: subjectClass - the name of the class which exposes the programming error, ornull if unknown. Parameters: subjectMethod - the name of the method (within the subjectClass ) whichexposes the programming error, or null if unknown. Parameters: detail - the detail message, can be null . Parameters: cause - the cause exception, can be null .an appropriate ProgrammingException that can be thrown by thecalling method, never null .Utils.logProgrammingError(String detail,Throwable cause) |
logProgrammingError | public static ProgrammingException logProgrammingError(String detectingClass, String detectingMethod, String subjectClass, String subjectMethod, String detail)(Code) | | Logs a programming error with no cause exception, and returns a
ProgrammingException object for it.
Parameters: detectingClass - the name of the class that detected the problem, ornull if unknown. Parameters: detectingMethod - the name of the method within the detectingClass thatdetected the problem, or null if unknown. Parameters: subjectClass - the name of the class which exposes the programming error, ornull if unknown. Parameters: subjectMethod - the name of the method (within the subjectClass ) whichexposes the programming error, or null if unknown. Parameters: detail - the detail message, can be null .an appropriate ProgrammingException that can be thrown by thecalling method, never null .Utils.logProgrammingError(String detail) |
|
|