org.mybatis.generator.internal
Class ObjectFactory

java.lang.Object
  extended by org.mybatis.generator.internal.ObjectFactory

public class ObjectFactory
extends Object

This class creates the different objects needed by the generator

Author:
Jeff Butler

Method Summary
static void addExternalClassLoader(ClassLoader classLoader)
          Adds a custom classloader to the collection of classloaders searched for "external" classes.
static void addResourceClassLoader(ClassLoader classLoader)
          Adds a custom classloader to the collection of classloaders searched for resources.
static CommentGenerator createCommentGenerator(Context context)
           
static Object createExternalObject(String type)
           
static Object createInternalObject(String type)
           
static IntrospectedColumn createIntrospectedColumn(Context context)
           
static IntrospectedTable createIntrospectedTable(TableConfiguration tableConfiguration, FullyQualifiedTable table, Context context)
           
static IntrospectedTable createIntrospectedTableForValidation(Context context)
          This method creates an introspected table implementation that is only usable for validation (i.e.
static JavaFormatter createJavaFormatter(Context context)
           
static JavaTypeResolver createJavaTypeResolver(Context context, List<String> warnings)
           
static Plugin createPlugin(Context context, PluginConfiguration pluginConfiguration)
           
static XmlFormatter createXmlFormatter(Context context)
           
static Class<?> externalClassForName(String type)
          This method returns a class loaded from the context classloader, or the classloader supplied by a client.
static URL getResource(String resource)
           
static Class<?> internalClassForName(String type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addResourceClassLoader

public static void addResourceClassLoader(ClassLoader classLoader)
Adds a custom classloader to the collection of classloaders searched for resources. Currently, this is only used when searching for properties files that may be referenced in the configuration file.

Parameters:
classLoader -

addExternalClassLoader

public static void addExternalClassLoader(ClassLoader classLoader)
Adds a custom classloader to the collection of classloaders searched for "external" classes. These are classes that do not depend on any of the generator's classes or interfaces. Examples are JDBC drivers, root classes, root interfaces, etc.

Parameters:
classLoader -

externalClassForName

public static Class<?> externalClassForName(String type)
                                     throws ClassNotFoundException
This method returns a class loaded from the context classloader, or the classloader supplied by a client. This is appropriate for JDBC drivers, model root classes, etc. It is not appropriate for any class that extends one of the supplied classes or interfaces.

Parameters:
type -
Returns:
the Class loaded from the external classloader
Throws:
ClassNotFoundException

createExternalObject

public static Object createExternalObject(String type)

internalClassForName

public static Class<?> internalClassForName(String type)
                                     throws ClassNotFoundException
Throws:
ClassNotFoundException

getResource

public static URL getResource(String resource)

createInternalObject

public static Object createInternalObject(String type)

createJavaTypeResolver

public static JavaTypeResolver createJavaTypeResolver(Context context,
                                                      List<String> warnings)

createPlugin

public static Plugin createPlugin(Context context,
                                  PluginConfiguration pluginConfiguration)

createCommentGenerator

public static CommentGenerator createCommentGenerator(Context context)

createJavaFormatter

public static JavaFormatter createJavaFormatter(Context context)

createXmlFormatter

public static XmlFormatter createXmlFormatter(Context context)

createIntrospectedTable

public static IntrospectedTable createIntrospectedTable(TableConfiguration tableConfiguration,
                                                        FullyQualifiedTable table,
                                                        Context context)

createIntrospectedTableForValidation

public static IntrospectedTable createIntrospectedTableForValidation(Context context)
This method creates an introspected table implementation that is only usable for validation (i.e. for a context to determine if the target is ibatis2 or mybatis3).

Parameters:
context -
Returns:

createIntrospectedColumn

public static IntrospectedColumn createIntrospectedColumn(Context context)


Copyright © 2010-2012 MyBatis.org. All Rights Reserved.