## org.hibernate.impl
Class TypeLocatorImpl

    java.lang.Object
      org.hibernate.impl.TypeLocatorImpl

All Implemented Interfaces:
  Serializable, TypeHelper

    public class TypeLocatorImpl

extends Object
implements TypeHelper, Serializable

Implementation of `TypeHelper`

Author:
  Steve Ebersole
See Also:
  Serialized Form
To do:
  Do we want to cache the results of `entity(java.lang.Class)`, `custom(java.lang.Class)` and `any(org.hibernate.type.Type, org.hibernate.type.Type)` ?

Constructor Summary
`TypeLocatorImpl(TypeResolver typeResolver)`

Method Summary
`Type` `any(Type metaType, Type identifierType)`
`BasicType` `basic(Class javaType)` Convenience form of `TypeHelper.basic(String)`.
`BasicType` `basic(String name)` Retrieve the basic type registered against the given name.
`Type` `custom(Class userTypeClass)` Retrieve the type for the given user-type class (`UserType` or `CompositeUserType`).
`Type` `custom(Class userTypeClass, Properties parameters)` Retrieve the type for the given user-type class (`UserType` or `CompositeUserType`).
`Type` `entity(Class entityClass)` Retrieve a type representing the given entity.
`Type` `entity(String entityName)` Retrieve a type representing the given entity.
`Type` `heuristicType(String name)` Uses heuristics to deduce the proper `Type` given a string naming the type or Java class.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TypeLocatorImpl

    public TypeLocatorImpl(TypeResolver typeResolver)

Method Detail

### basic

    public BasicType basic(String name)

  Retrieve the basic type registered against the given name.

  Specified by:
    `basic` in interface `TypeHelper`
  Parameters:
    `name` - The name of the basic type to retrieve
  Returns:
    The basic type, or null.

### basic

    public BasicType basic(Class javaType)

  Convenience form of `TypeHelper.basic(String)`. The intended use of this is something like `basic(Integer.class)` or `basic(int.class)`

  Specified by:
    `basic` in interface `TypeHelper`
  Parameters:
    `javaType` - The java type for which to retrieve the type instance.
  Returns:
    The basic type, or null.

### heuristicType

    public Type heuristicType(String name)

  Uses heuristics to deduce the proper `Type` given a string naming the type or Java class.

  See `TypeResolver.heuristicType(java.lang.String)` for a discussion of the heuristic algorithm.

  Specified by:
    `heuristicType` in interface `TypeHelper`
  Parameters:
    `name` - The name of the type or Java class
  Returns:
    The deduced type, or null.
  See Also:
    `TypeResolver.heuristicType(java.lang.String)`

### entity

    public Type entity(Class entityClass)

  Retrieve a type representing the given entity.

  Specified by:
    `entity` in interface `TypeHelper`
  Parameters:
    `entityClass` - The entity Java type.
  Returns:
    The type, or null

### entity

    public Type entity(String entityName)

  Retrieve a type representing the given entity.

  Specified by:
    `entity` in interface `TypeHelper`
  Parameters:
    `entityName` - The entity name.
  Returns:
    The type, or null

### custom

    public Type custom(Class userTypeClass)

  Retrieve the type for the given user-type class (`UserType` or `CompositeUserType`).

  Specified by:
    `custom` in interface `TypeHelper`
  Parameters:
    `userTypeClass` - The user type class
  Returns:
    The type, or null

### custom

    public Type custom(Class userTypeClass,
                       Properties parameters)

  Retrieve the type for the given user-type class (`UserType` or `CompositeUserType`).

  Specified by:
    `custom` in interface `TypeHelper`
  Parameters:
    `userTypeClass` - The user type class
    `parameters` - Configuration properties.
  Returns:
    The type, or null

### any

    public Type any(Type metaType,
                    Type identifierType)

  Specified by:
    `any` in interface `TypeHelper`

Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.