public class MiscUtil extends Object
Modifier and Type | Field and Description |
---|---|
static Class[] |
EMPTY_CLASS_ARRAY |
static Object[] |
EMPTY_OBJECT_ARRAY |
static String[] |
EMPTY_STRING_ARRAY |
Constructor and Description |
---|
MiscUtil() |
Modifier and Type | Method and Description |
---|---|
static String[] |
add(String[] a1,
String[] a2)
Concatenates two arrays.
|
static String |
causeMessages(Throwable e)
This is the same as
causeTrace(java.lang.Throwable) , but it doesn't print the
exception class name if the class is inside an fmpp package. |
static String |
causeTrace(Throwable e)
Returns the cause trace of an exception.
|
static void |
checkXmlSupportAvailability(String requiredForThis)
Checks if XML API-s (JAXP, SAX2, DOM) are present.
|
static Class |
classForName(String className)
Tries to load the class with the current context class loader,
and only then with the current defining class loader.
|
static Map |
dictionaryToMap(Dictionary dict) |
static int |
findObject(List list,
Object o)
Returns the first index of the given object (exactly the same instance)
in the list.
|
static Throwable |
getCauseException(Throwable e) |
static boolean |
listContainsObject(List list,
Object o)
Checks if the list contains the given object (exactly the same instance).
|
static boolean |
mapContainsObject(Map map,
Object o)
Checks if the map contains the given object (exactly the same instance)
as value.
|
static int |
numberToInt(Number value)
Loseless convertion to
int . |
public static final Class[] EMPTY_CLASS_ARRAY
public static final Object[] EMPTY_OBJECT_ARRAY
public static final String[] EMPTY_STRING_ARRAY
public static String causeMessages(Throwable e)
causeTrace(java.lang.Throwable)
, but it doesn't print the
exception class name if the class is inside an fmpp
package.public static String causeTrace(Throwable e)
public static Class classForName(String className) throws ClassNotFoundException
ClassNotFoundException
public static Map dictionaryToMap(Dictionary dict)
public static boolean listContainsObject(List list, Object o)
public static boolean mapContainsObject(Map map, Object o)
public static int findObject(List list, Object o)
public static void checkXmlSupportAvailability(String requiredForThis) throws InstallationException
requiredForThis
- a short sentence that describes for human reader
if for what do we need the XML support (e.g.
"Usage of xml data loader."
or
"Set XML entity resolver."
). This sentence is used
in error message of the InstallationException
.
Can be null
.InstallationException
public static int numberToInt(Number value)
int
.IllegalArgumentException
- if the loseless conversion is not
possible. The error message contains the details.