jbackup/src/main/java/org/jbundle/jbackup/util/Util.java
public static Object makeObjectFromClassName(String interfaceName, String strPackage, String strClassName)
	{
		if (strClassName == null)
			return null;
		if (strClassName.indexOf('.') == -1)
			if (strPackage != null)
		{	// Use default structure
			strClassName = org.jbundle.jbackup.JBackupConstants.ROOT_PACKAGE + "jbackup." + strPackage.toLowerCase() + '.' + strClassName + strPackage.substring(0, 1).toUpperCase() + strPackage.substring(1);
		}
		Object objClass = null;
		try
		{
			if (strClassName.indexOf('.') == 0)
				strClassName = org.jbundle.jbackup.JBackupConstants.ROOT_PACKAGE + strClassName.substring(1);
			Class<?> c = Class.forName(strClassName);
			if (c != null)
			{
				objClass = c.newInstance();
			}
		}
		catch (Exception ex) {
			System.out.println("Error on attempt to make class: " + strClassName);
			ex.printStackTrace();
			System.exit(0);
		}
		return objClass;
	}
public static Object makeObjectFromClassName(String interfaceName, String strPackage, String strClassName)
	{
		if (strClassName == null)
			return null;
		if (strClassName.indexOf('.') == -1)
			if (strPackage != null)
		{	// Use default structure
			strClassName = org.jbundle.jbackup.JBackupConstants.ROOT_PACKAGE + "jbackup." + strPackage.toLowerCase() + '.' + strClassName + strPackage.substring(0, 1).toUpperCase() + strPackage.substring(1);
		}
		Object objClass = null;
		try
		{
			if (strClassName.indexOf('.') == 0)
				strClassName = org.jbundle.jbackup.JBackupConstants.ROOT_PACKAGE + strClassName.substring(1);
			Class<?> c = Class.forName(strClassName);
			if (c != null)
			{
				objClass = c.newInstance();
			}
		}
		catch (Exception ex) {
			System.out.println("Error on attempt to make class: " + strClassName);
			ex.printStackTrace();
			System.exit(0);
		}
		return objClass;
	}
public static Object makeObjectFromClassName ( String interfaceName , String strPackage , String strClassName ) { if ( strClassName == null ) return null ; if ( strClassName . indexOf ( ' ' ) == - 1 ) if ( strPackage != null ) { // Use default structure strClassName = org . jbundle . jbackup . JBackupConstants . ROOT_PACKAGE + "jbackup." + strPackage . toLowerCase ( ) + ' ' + strClassName + strPackage . substring ( 0 , 1 ) . toUpperCase ( ) + strPackage . substring ( 1 ) ; } Object objClass = null ; try { if ( strClassName . indexOf ( ' ' ) == 0 ) strClassName = org . jbundle . jbackup . JBackupConstants . ROOT_PACKAGE + strClassName . substring ( 1 ) ; Class < ? > c = Class . forName ( strClassName ) ; if ( c != null ) { objClass = c . newInstance ( ) ; } } catch ( Exception ex ) { System . out . println ( "Error on attempt to make class: " + strClassName ) ; ex . printStackTrace ( ) ; System . exit ( 0 ) ; } return objClass ; }
/*
Create a new object using this class name.
Conform to the standardized classname format: com.tourgeek.terminal.src/dest.name.namesrc/dest
/ * Create a new object using this class name . Conform to the standardized classname format : com . tourgeek . terminal . src / dest . name . namesrc / dest