com.partnersoft.data
Class Namer

java.lang.Object
  extended by com.partnersoft.data.Namer
All Implemented Interfaces:
Coggable, ObjectNamer, ObjectTransform

public class Namer
extends java.lang.Object
implements ObjectNamer

An ObjectTransform that generates a String name from a source object, using a string template.

Author:
Paul Reavis Copyright 2001 Partner Software, Inc. All rights reserved.

Constructor Summary
Namer()
          Create a new Namer.
Namer(Cog newState)
           
Namer(java.lang.String template)
           
 
Method Summary
 java.util.Set getRequiredPaths()
           
 java.lang.String getTemplate()
          Gets the value of template
 void setTemplate(java.lang.String argTemplate)
          Sets the value of template
 Cog toCog()
          Returns the complete internal state of this object in the form of a Cog.
 java.lang.Object transform(java.lang.Object source)
          Our one method; this transforms one object into another.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Namer

public Namer(Cog newState)

Namer

public Namer()
Create a new Namer.


Namer

public Namer(java.lang.String template)
Method Detail

toCog

public Cog toCog()
Description copied from interface: Coggable
Returns the complete internal state of this object in the form of a Cog.

Specified by:
toCog in interface Coggable
Returns:
Cog representing the internal state of this object

transform

public java.lang.Object transform(java.lang.Object source)
Description copied from interface: ObjectTransform
Our one method; this transforms one object into another. Transformation must be nondestructive, but may produce a derived product that is still affected by changes to the original, so beware.

Specified by:
transform in interface ObjectTransform

getRequiredPaths

public java.util.Set getRequiredPaths()
Specified by:
getRequiredPaths in interface ObjectNamer

getTemplate

public java.lang.String getTemplate()
Gets the value of template

Returns:
the value of template

setTemplate

public void setTemplate(java.lang.String argTemplate)
Sets the value of template

Parameters:
argTemplate - Value to assign to this.template