Back to project page Jello.
The source code is released under:
Apache License
If you think the Android project Jello 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.atteo.jello; // w w w .jav a 2s.co m import android.util.Log; public class StorableFactory<T extends Storable> { static public <T extends Storable> T createStorable(final Class<T> klass) { try { return klass.newInstance(); } catch (final IllegalAccessException e) { Log.e("Jello", "Class instantiation failed", e); throw new RuntimeException( "Class '" + klass.getSimpleName() + "' couldn't be instantiated (is the default constructor public?)"); } catch (final InstantiationException e) { Log.e("Jello", "Class instantiation failed", e); throw new RuntimeException( "Class '" + klass.getSimpleName() + " couldn't be instantiated (is the default constructor public?)"); } } }