org.apache.torque.engine.database.model
Class NameFactory

java.lang.Object
  extended by org.apache.torque.engine.database.model.NameFactory

public class NameFactory
extends java.lang.Object

A name generation factory.

Version:
$Id: NameFactory.java 473814 2006-11-11 22:30:30Z tv $
Author:
Field Summary
static java.lang.String CONSTRAINT_GENERATOR
          The fully qualified class name of the constraint name generator.
static java.lang.String JAVA_GENERATOR
          The fully qualified class name of the Java name generator.
 
Constructor Summary
protected NameFactory()
          Creates a new instance with storage for algorithm implementations.
 
Method Summary
static java.lang.String generateName(java.lang.String algorithmName, java.util.List inputs)
          Given a list of String objects, implements an algorithm which produces a name.
protected  NameGenerator getAlgorithm(java.lang.String name)
          Factory method which retrieves an instance of the named generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVA_GENERATOR

public static final java.lang.String JAVA_GENERATOR
The fully qualified class name of the Java name generator.


CONSTRAINT_GENERATOR

public static final java.lang.String CONSTRAINT_GENERATOR
The fully qualified class name of the constraint name generator.

Constructor Detail

NameFactory

protected NameFactory()
Creates a new instance with storage for algorithm implementations.

Method Detail

getAlgorithm

protected NameGenerator getAlgorithm(java.lang.String name)
                              throws EngineException
Factory method which retrieves an instance of the named generator.

Parameters:
name - The fully qualified class name of the name generation algorithm to retrieve.
Returns:
A name generator
Throws:
EngineException

generateName

public static java.lang.String generateName(java.lang.String algorithmName,
                                            java.util.List inputs)
                                     throws EngineException
Given a list of String objects, implements an algorithm which produces a name.

Parameters:
algorithmName - The fully qualified class name of the NameGenerator implementation to use to generate names.
inputs - Inputs used to generate a name.
Returns:
The generated name.
Throws:
EngineException - an exception


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.