org.makumba.providers.datadefinition.makumba
Class MakumbaDataDefinitionFactory

java.lang.Object
  extended by org.makumba.providers.DataDefinitionProvider
      extended by org.makumba.providers.datadefinition.makumba.MakumbaDataDefinitionFactory
All Implemented Interfaces:
SingletonHolder

public class MakumbaDataDefinitionFactory
extends DataDefinitionProvider

This class is the Makumba implementation of a data definition provider, based on MDD files.
TODO refactor together with RecordInfo to build objects (and not use static methods)

Version:
$Id: MakumbaDataDefinitionFactory.java 5149 2010-05-18 19:00:47Z rosso_nero $
Author:
Manuel Gay

Method Summary
 DataDefinition getDataDefinition(String typeName)
          Gets the data definition defined by the given type.
static DataDefinitionProvider getInstance()
           
 DataDefinition getVirtualDataDefinition(String name)
           
 FieldDefinition makeFieldDefinition(String name, String definition)
          makes a field definition from the indicated string
 FieldDefinition makeFieldOfType(String name, String type)
          makes a field definition with the elementary type
 FieldDefinition makeFieldOfType(String name, String type, String description)
          makes a field definition identical with the given one, except for the name
 FieldDefinition makeFieldWithName(String name, FieldDefinition type)
          makes a field definition with the elementary type
 FieldDefinition makeFieldWithName(String name, FieldDefinition type, String description)
          makes a field definition identical with the given one, except for the name and the description
 
Methods inherited from class org.makumba.providers.DataDefinitionProvider
getDataDefinitionsInDefaultLocations, getDataDefinitionsInDefaultLocations, getDataDefinitionsInLocation, getFieldDefinition, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDataDefinition

public DataDefinition getDataDefinition(String typeName)
Description copied from class: DataDefinitionProvider
Gets the data definition defined by the given type.

Specified by:
getDataDefinition in class DataDefinitionProvider

getVirtualDataDefinition

public DataDefinition getVirtualDataDefinition(String name)
Specified by:
getVirtualDataDefinition in class DataDefinitionProvider

makeFieldDefinition

public FieldDefinition makeFieldDefinition(String name,
                                           String definition)
Description copied from class: DataDefinitionProvider
makes a field definition from the indicated string

Specified by:
makeFieldDefinition in class DataDefinitionProvider
Parameters:
name - the name of the field
definition - the definition string, e.g. "ptr general.Person ;pointer to a person"
Returns:
a field definition built on a definition string

makeFieldOfType

public FieldDefinition makeFieldOfType(String name,
                                       String type)
Description copied from class: DataDefinitionProvider
makes a field definition with the elementary type

Specified by:
makeFieldOfType in class DataDefinitionProvider
Parameters:
name - the name of the field
type - the type of the field
Returns:
a field definition generated by the name and the type of the field

makeFieldOfType

public FieldDefinition makeFieldOfType(String name,
                                       String type,
                                       String description)
Description copied from class: DataDefinitionProvider
makes a field definition identical with the given one, except for the name

Specified by:
makeFieldOfType in class DataDefinitionProvider
Parameters:
name - the name of the field
type - the FieldDefinition used as model
Returns:
a copy of the initial field definition with a different name

makeFieldWithName

public FieldDefinition makeFieldWithName(String name,
                                         FieldDefinition type)
Description copied from class: DataDefinitionProvider
makes a field definition with the elementary type

Specified by:
makeFieldWithName in class DataDefinitionProvider
Parameters:
name - the name of the field
type - the elementary type of the field
Returns:
a field definition generated by the name, type and description of the field

makeFieldWithName

public FieldDefinition makeFieldWithName(String name,
                                         FieldDefinition type,
                                         String description)
Description copied from class: DataDefinitionProvider
makes a field definition identical with the given one, except for the name and the description

Specified by:
makeFieldWithName in class DataDefinitionProvider
Parameters:
name - the name of the field
type - the FieldDefinition used as model
description - the description of the field
Returns:
a copy of the initial field definition with a different name and description

getInstance

public static DataDefinitionProvider getInstance()