* @param targetClass Class name to look for
* @return Class instance
*/
- @SuppressWarnings ("unchecked")
+ @SuppressWarnings("unchecked")
private Class<? extends FrameworkInterface> getClassFromTarget (final FrameworkInterface instance, final String targetClass) {
// Trace message
this.getLogger().debug(MessageFormat.format("instance={0},targetClass={1}", instance, targetClass)); //NOI18N
-
+
// Instance reflaction of this class
Class<? extends FrameworkInterface> c = instance.getClass();
-
+
// Analyze class
while (!targetClass.equals(c.getSimpleName())) {
// Debug message
this.getLogger().debug(MessageFormat.format("c={0}", c.getSimpleName())); //NOI18N
-
+
// Get super class (causes unchecked warning)
c = (Class<? extends FrameworkInterface>) c.getSuperclass();
}
// Trace message
this.getLogger().trace(MessageFormat.format("c={0} - EXIT!", c)); //NOI18N
-
+
// Return it
return c;
}
protected final void abortProgramWithException (final Throwable throwable) {
// Log exception ...
this.getLogger().catching(throwable);
-
+
// .. and exit
System.exit(1);
}
protected Object getField (final FrameworkInterface instance, final String targetClass, final String methodName) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
// Trace messahe
this.getLogger().trace(MessageFormat.format("targetClass={0},methodName={1}", targetClass, methodName)); //NOI18N
-
+
// Get method to call
Method method = this.getMethodFromName(instance, targetClass, methodName);
-
+
// Get value from field
Object object = method.invoke(instance);
protected Object convertNullToEmpty (final Object str) {
// Trace message
this.getLogger().trace(MessageFormat.format("str={0}", str)); //NOI18N
-
+
// Is it null?
if (str == null) {
// Return empty string
// Trace message
this.getLogger().trace(MessageFormat.format("str={0} - EXIT!", str)); //NOI18N
-
+
// Return it
return str;
}
/**
* Prepares all properties, the file is written if it is not found
- *
+ *
* @throws java.io.IOException If any IO problem occurs
*/
protected void initProperties () throws IOException {