info.magnolia.objectfactory
Class DefaultClassFactory
java.lang.Object
info.magnolia.objectfactory.DefaultClassFactory
- All Implemented Interfaces:
- ClassFactory
public class DefaultClassFactory
- extends java.lang.Object
- implements ClassFactory
A ClassFactory implementation which uses the default class loader and the thread context class loader.
- Version:
- $Revision: $ ($Author: $)
- Author:
- gjoseph
Method Summary |
|
forName(java.lang.String className)
|
|
newInstance(java.lang.Class<T> c,
java.lang.Class<?>[] argTypes,
java.lang.Object... params)
Instantiates the given class with the given parameters, using a constructor that matches the given
argTypes exactly. |
|
newInstance(java.lang.Class<T> c,
java.lang.Object... params)
Instantiates the given class with the given parameters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultClassFactory
public DefaultClassFactory()
forName
public <C> java.lang.Class<C> forName(java.lang.String className)
throws java.lang.ClassNotFoundException
- Specified by:
forName
in interface ClassFactory
- Throws:
java.lang.ClassNotFoundException
newInstance
public <T> T newInstance(java.lang.Class<T> c,
java.lang.Class<?>[] argTypes,
java.lang.Object... params)
- Description copied from interface:
ClassFactory
- Instantiates the given class with the given parameters, using a constructor that matches the given
argTypes
exactly.
To pass "null" to a single-arg constructor, use newInstance(c, new Object[]{null}) (otherwise the *array* itself will be considered null)
- Specified by:
newInstance
in interface ClassFactory
newInstance
public <T> T newInstance(java.lang.Class<T> c,
java.lang.Object... params)
- Description copied from interface:
ClassFactory
- Instantiates the given class with the given parameters. This attempts to find a matching constructor.
For the empty constructor, pass no parameters (or an empty array, or null).
Null arguments are not supported.
- Specified by:
newInstance
in interface ClassFactory
Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.