Package com.ribs
Class RibsUtils
java.lang.Object
com.ribs.RibsUtils
This class offers a number of useful general purpose utilities used by ribs classes.
Copyright (c) 2004 ReportMill Software, Inc. All Rights Reserved. Contact ReportMill <info@reportmill.com>.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This Error subclass lets us rethrow exceptions. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Copies a file from one location to another.static boolean
Returns whether two objects are equal (either can be null).static byte[]
Returns the bytes derived from reading source (supports File, String path, URL, InputStream, byte[] and more).static Class
getClassForName
(String aName) Returns a class for a given name.static String
getClassNameShort
(Object anObj) Returns just the class name string (w/o package name).static File
Returns the File derived from reading source (supports File, String path).static InputStream
getInputStream
(Object aSource) Returns the input stream dervied from reading source (supports File, String path, InputStream and more).static Method
Returns the method for the given object, method name and parameter type class.static Method
Returns the method for the given object, method name and paramter types class array.static Object
Calls the given method on the given object with the given parameter.static Object
Calls the given method name on the given object with the given arg array and class array.static Object
Calls the given method name on the given object.static Object
Calls the given method name on the given object with the given arg array and class array.static Object
Calls the given method name on the given object with the given parameter of the given class.static Object
newInstance
(Class aClass, boolean complain) Returns a new instance.static Preferences
prefs()
Returns the user Preferences object.static void
Adds an object to the user Preferences object.static void
setPrefsClass
(Class aClass) Sets the class that ribs preferences are associated with.static String
writeBytes
(byte[] bytes, int anOffset, int aLength, String aPath, boolean safely) Writes the given byte array to given path.static String
writeBytes
(byte[] bytes, String aPath, boolean safely) Writes the given byte array to given path.
-
Field Details
-
isWindows
public static boolean isWindows -
isMac
public static boolean isMac
-
-
Constructor Details
-
RibsUtils
public RibsUtils()
-
-
Method Details
-
equals
Returns whether two objects are equal (either can be null). -
getClassNameShort
Returns just the class name string (w/o package name). -
getClassForName
Returns a class for a given name. -
newInstance
Returns a new instance. -
prefs
Returns the user Preferences object. -
prefsPut
Adds an object to the user Preferences object. -
setPrefsClass
Sets the class that ribs preferences are associated with. -
getBytes
Returns the bytes derived from reading source (supports File, String path, URL, InputStream, byte[] and more). -
getInputStream
Returns the input stream dervied from reading source (supports File, String path, InputStream and more). -
getFile
Returns the File derived from reading source (supports File, String path). -
copyFile
Copies a file from one location to another. -
writeBytes
Writes the given byte array to given path. If safely is true, it moves original to backup file before save. -
writeBytes
public static String writeBytes(byte[] bytes, int anOffset, int aLength, String aPath, boolean safely) Writes the given byte array to given path. If safely is true, it moves original to backup file before save. -
getMethod
Returns the method for the given object, method name and parameter type class. -
getMethod
Returns the method for the given object, method name and paramter types class array. -
invoke
Calls the given method name on the given object. -
invoke
Calls the given method name on the given object with the given parameter of the given class. -
invoke
public static Object invoke(Object anObj, String aMethod, Object[] parameters, Class[] parameterTypes) Calls the given method name on the given object with the given arg array and class array. -
invoke
Calls the given method on the given object with the given parameter. -
invoke
Calls the given method name on the given object with the given arg array and class array.
-