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 classThis Error subclass lets us rethrow exceptions. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCopies a file from one location to another.static booleanReturns 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 ClassgetClassForName(String aName) Returns a class for a given name.static StringgetClassNameShort(Object anObj) Returns just the class name string (w/o package name).static FileReturns the File derived from reading source (supports File, String path).static InputStreamgetInputStream(Object aSource) Returns the input stream dervied from reading source (supports File, String path, InputStream and more).static MethodReturns the method for the given object, method name and parameter type class.static MethodReturns the method for the given object, method name and paramter types class array.static ObjectCalls the given method on the given object with the given parameter.static ObjectCalls the given method name on the given object with the given arg array and class array.static ObjectCalls the given method name on the given object.static ObjectCalls the given method name on the given object with the given arg array and class array.static ObjectCalls the given method name on the given object with the given parameter of the given class.static ObjectnewInstance(Class aClass, boolean complain) Returns a new instance.static Preferencesprefs()Returns the user Preferences object.static voidAdds an object to the user Preferences object.static voidsetPrefsClass(Class aClass) Sets the class that ribs preferences are associated with.static StringwriteBytes(byte[] bytes, int anOffset, int aLength, String aPath, boolean safely) Writes the given byte array to given path.static StringwriteBytes(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.
-