com.ashridgetech.jamda.uml
Class PropertyTransformer

java.lang.Object
  |
  +--com.ashridgetech.jamda.uml.PropertyTransformer
All Implemented Interfaces:
org.apache.commons.collections.Transformer

public abstract class PropertyTransformer
extends java.lang.Object
implements org.apache.commons.collections.Transformer

A Transformer object for transforming Property objects. The client subclasses PropertyTransformer, and provides a setupProperty() method that calls the various setXXX methods to set the characteristics of the new Property. The base class sets the transformed Property as the base property, calls setupProperty() then finally calls PropertyBuilder.getProperty() to create the new Property. The transformer may be reused for multiple transformations, but only one at a time. Note: this class is not thread-safe.

Version:
1.0
Author:
paulb

Constructor Summary
protected PropertyTransformer()
          Construct a PropertyTransformer.
 
Method Summary
 Property getBaseProperty()
          Get the base Property on which the new one is based.
 void setAggregation(StructuredType.Aggregation aggregation)
          Set the aggregation level of this property.
 void setComment(java.lang.String comment)
          Set the Type of this Property
 void setMultiple(boolean multiple)
          Set whether this Property can have multiple values.
 void setName(java.lang.String name)
          Set the name of the new Property.
 void setOid(boolean oid)
          Set whether this property is an object identifier (OID)
 void setReadable(boolean readable)
          Set whether this Property is readable.
 void setReaders(java.util.Set readers)
          Set the Actors who can read this Property
 void setType(Type type)
          Set the Type of the new Property.
 void setUnderlying(Association.End associationEnd)
          Set the underlying element of the new property to be an Association.End.
 void setUnderlying(Attribute attribute)
          Set the underlying element of the new property to be an Attribute.
 void setUnderlying(Operation getter, Operation setter, Attribute attribute)
          Set the underlying element of the new property to be some combination of getter, setter and attribute.
 void setUnderlying(Parameter parameter)
          Set the underlying element of the new property to be an Parameter.
abstract  void setupProperty()
          Setup the characteristics of the new Property resulting from the transformation.
 void setWritable(boolean writable)
          Set whether this Property is writable.
 void setWriters(java.util.Set writers)
          Set the Actors who can write this Property
 java.lang.Object transform(java.lang.Object input)
          Implements the Transformer interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyTransformer

protected PropertyTransformer()
Construct a PropertyTransformer.

Method Detail

transform

public java.lang.Object transform(java.lang.Object input)
Implements the Transformer interface. Calls the subclass's setupProperty() method.

Specified by:
transform in interface org.apache.commons.collections.Transformer
Parameters:
input - - must be a Property
Returns:
- a new Property object

setupProperty

public abstract void setupProperty()
Setup the characteristics of the new Property resulting from the transformation.


getBaseProperty

public Property getBaseProperty()
Get the base Property on which the new one is based.

Returns:
the Property

setName

public void setName(java.lang.String name)
Set the name of the new Property.

Parameters:
name - the new name

setType

public void setType(Type type)
Set the Type of the new Property.

Parameters:
type - the new Type

setComment

public void setComment(java.lang.String comment)
Set the Type of this Property


setMultiple

public void setMultiple(boolean multiple)
Set whether this Property can have multiple values.

Parameters:
multiple - true if the Property has multiple values

setReadable

public void setReadable(boolean readable)
Set whether this Property is readable.

Parameters:
readable - true if the Property is readable

setReaders

public void setReaders(java.util.Set readers)
Set the Actors who can read this Property

Parameters:
readers - the set of Actors. See Property.getReaders() for the values allowed.

setWritable

public void setWritable(boolean writable)
Set whether this Property is writable.

Parameters:
writable - true if the Property is writable

setWriters

public void setWriters(java.util.Set writers)
Set the Actors who can write this Property

Parameters:
writers - the set of Actors. See Property.getWriters() for the values allowed.

setAggregation

public void setAggregation(StructuredType.Aggregation aggregation)
Set the aggregation level of this property.

Parameters:
aggregation - the new Aggregation instance

setOid

public void setOid(boolean oid)
Set whether this property is an object identifier (OID)

Parameters:
oid - true if this Property is an oid

setUnderlying

public void setUnderlying(Attribute attribute)
Set the underlying element of the new property to be an Attribute. The getter, setter and association end are all set to null.

Parameters:
attribute - the new underlying element - may not be null

setUnderlying

public void setUnderlying(Association.End associationEnd)
Set the underlying element of the new property to be an Association.End. The getter, setter and attribute are all set to null.

Parameters:
associationEnd - the new underlying element - may not be null

setUnderlying

public void setUnderlying(Operation getter,
                          Operation setter,
                          Attribute attribute)
Set the underlying element of the new property to be some combination of getter, setter and attribute. The association end is set to null.

Parameters:
getter - the getter Operation associated with this Property - may be null if setter is not null
setter - the setter Operation associated with this Property - may be null if getter is not null

setUnderlying

public void setUnderlying(Parameter parameter)
Set the underlying element of the new property to be an Parameter. The getter, setter, attribute and association end are all set to null.

Parameters:
parameter - the new underlying element - may not be null


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.