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 SummaryNested ClassesModifier and TypeClassDescriptionstatic classThis Error subclass lets us rethrow exceptions.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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- 
isWindowspublic static boolean isWindows
- 
isMacpublic static boolean isMac
 
- 
- 
Constructor Details- 
RibsUtilspublic RibsUtils()
 
- 
- 
Method Details- 
equalsReturns whether two objects are equal (either can be null).
- 
getClassNameShortReturns just the class name string (w/o package name).
- 
getClassForNameReturns a class for a given name.
- 
newInstanceReturns a new instance.
- 
prefsReturns the user Preferences object.
- 
prefsPutAdds an object to the user Preferences object.
- 
setPrefsClassSets the class that ribs preferences are associated with.
- 
getBytesReturns the bytes derived from reading source (supports File, String path, URL, InputStream, byte[] and more).
- 
getInputStreamReturns the input stream dervied from reading source (supports File, String path, InputStream and more).
- 
getFileReturns the File derived from reading source (supports File, String path).
- 
copyFileCopies a file from one location to another.
- 
writeBytesWrites the given byte array to given path. If safely is true, it moves original to backup file before save.
- 
writeBytespublic 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.
- 
getMethodReturns the method for the given object, method name and parameter type class.
- 
getMethodReturns the method for the given object, method name and paramter types class array.
- 
invokeCalls the given method name on the given object.
- 
invokeCalls the given method name on the given object with the given parameter of the given class.
- 
invokepublic 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.
- 
invokeCalls the given method on the given object with the given parameter.
- 
invokeCalls the given method name on the given object with the given arg array and class array.
 
-