org.figure8.join.businessobjects.artifact
Class ComponentType

java.lang.Object
  extended by org.figure8.join.core.EntityObject
      extended by org.figure8.join.businessobjects.artifact.ComponentType
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ComponentType
extends EntityObject

Entity representing a component type. Such a type helps categorizing software components into your project.
A component type will help by knowing how to generate unique keys for component artifacts. (see the generateComponentKey() method)

Version:
$Revision: 1.3 $
Author:
Laurent Broudoux
See Also:
Serialized Form

Constructor Summary
ComponentType()
          Creates a new instance of ComponentType
ComponentType(java.lang.String key, java.lang.String label, java.lang.String keyTemplate, java.lang.String description)
          Creates a new instance of ComponentType with mandatory attributes
 
Method Summary
 java.lang.String generateComponentKey(Component component)
          Generate a unique key for a compoent.
 java.lang.String getDescription()
           
 java.lang.String getKey()
           
 java.lang.String getKeyTemplate()
           
 java.lang.String getLabel()
           
 void setDescription(java.lang.String description)
           
 void setKey(java.lang.String key)
           
 void setKeyTemplate(java.lang.String keyTemplate)
          The template used for component key generation.
 void setLabel(java.lang.String label)
           
 
Methods inherited from class org.figure8.join.core.EntityObject
clone, equals, getId, hashCode, isTransient
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentType

public ComponentType()
Creates a new instance of ComponentType


ComponentType

public ComponentType(java.lang.String key,
                     java.lang.String label,
                     java.lang.String keyTemplate,
                     java.lang.String description)
Creates a new instance of ComponentType with mandatory attributes

Parameters:
key - This component type key
label - This component type label for display
keyTemplate - This type template fopr generating component keys
description - The description of this component type
Method Detail

getKey

public java.lang.String getKey()
Returns:
This deliverable type key

setKey

public void setKey(java.lang.String key)
Parameters:
key - This component type key

getLabel

public java.lang.String getLabel()
Returns:
This type label for display

setLabel

public void setLabel(java.lang.String label)
Parameters:
label - This type label for display

getKeyTemplate

public java.lang.String getKeyTemplate()
Returns:
The template used for generating component keys

setKeyTemplate

public void setKeyTemplate(java.lang.String keyTemplate)
The template used for component key generation. This template should be a string representing a MessageFormat with 2 arguments. (ex: myComponent_r{0}_v{0})

Parameters:
keyTemplate - MessageFormat template
See Also:
MessageFormat

getDescription

public java.lang.String getDescription()
Returns:
This component type description

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - The description of this component type

generateComponentKey

public java.lang.String generateComponentKey(Component component)
Generate a unique key for a compoent. Such a key has to be unique as specified by the Artifact. So this implementation is using the given keyTemplate as a java.text.MessageFormat using 2 arguments that are the component release name (unique for a relase) and the component version infos (unique for a component within a release).

Parameters:
component - Component for whom a key should be generated
Returns:
A unique key corresponding to this component. The key is not assigned to component.
See Also:
MessageFormat, Artifact


Copyright © 2005-2008 Join. All Rights Reserved.