Back to project page pdsql.
The source code is released under:
Apache License
If you think the Android project pdsql listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.piscessera.pdsql; // w w w . j ava2s . co m public class GenericBase<T> { private String className; public GenericBase(String className) { this.className = className; } @SuppressWarnings("unchecked") protected T newInstance() { try { // Create class Class<? extends T> cls = (Class<? extends T>) Class .forName(this.className); // Create instance T d = cls.newInstance(); return d; } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return null; } }