Skip to content

Commit

Permalink
Merge pull request #43 from stepancheg/magic
Browse files Browse the repository at this point in the history
Expose MagicInstantiator internal ObjectInstantiator
  • Loading branch information
henri-tremblay committed Jan 6, 2017
2 parents 7ce8c99 + 8d3a472 commit 989f877
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ public MagicInstantiator(Class<T> type) {
instantiator = newInstantiatorOf(type);
}

/**
* Get the underlying instantiator.
*
* <code>MagicInstantiator</code> is a wrapper around another object
* which implements <code>ObjectInstantiator</code> interface.
* This method exposes that instantiator.
*/
public ObjectInstantiator<T> getInstantiator() {
return instantiator;
}

private <T> ObjectInstantiator<T> newInstantiatorOf(Class<T> type) {
String suffix = type.getSimpleName();
String className = getClass().getName() + "$$$" + suffix;
Expand Down

0 comments on commit 989f877

Please sign in to comment.