|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ashridgetech.jamda.uml.PropertyBuilder
A builder object for creating Property
objects, either based on an existing
Property
, or completely new. The client creates an instance of PropertyBuilder
,
sets the base property
if required,
then calls the various setXXX
methods to set the characteristics of the new
Property
, then finally calls getProperty()
to create the new Property
.
The builder may be reused if required by calling start(com.ashridgetech.jamda.uml.Property)
again.
Note: this class is not thread-safe. It will detect attempts to call start(com.ashridgetech.jamda.uml.Property)
again
before getProperty()
has been called.
Nested Class Summary | |
protected static class |
PropertyBuilder.PropertyImpl
Implementation of the Property interface returned by getProperty() . |
Constructor Summary | |
PropertyBuilder()
Construct a PropertyBuilder which is not connected to a base property . |
|
PropertyBuilder(Property baseProperty)
Construct a PropertyBuilder which is connected to a base property . |
|
PropertyBuilder(java.lang.String name,
Type type)
Construct a PropertyBuilder which is not connected to a base property ,
but has the name and type set. |
Method Summary | |
Property |
getBaseProperty()
Get the Property whose characteristics are the starting point for the new Property |
Property |
getProperty()
Get the new Property whose characteristics have been set. |
boolean |
isBuilding()
Show whether this instance is in the 'building' state. |
static Property |
makeProperty(java.lang.String name,
Type type)
Construct a Property object with just a name and type. |
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 Actor s 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 . |
void |
setWritable(boolean writable)
Set whether this Property is writable. |
void |
setWriters(java.util.Set writers)
Set the Actor s who can write this Property |
void |
start(Property baseProperty)
Start a new Property and set the Property
whose characteristics are the starting point for the new Property . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PropertyBuilder()
PropertyBuilder
which is not connected to a base property
.
Does NOT put this instance into the building
state.
The start(com.ashridgetech.jamda.uml.Property)
method must be called before any setXXX methods can be called.
start(com.ashridgetech.jamda.uml.Property)
public PropertyBuilder(java.lang.String name, Type type)
PropertyBuilder
which is not connected to a base property
,
but has the name and type set.
Puts this instance into the building
state.
name
- the name of the new Property
.type
- the type of the new Property
.public PropertyBuilder(Property baseProperty)
PropertyBuilder
which is connected to a base property
.
Puts this instance into the building
state.
baseProperty
- the Property
whose characteristics are the starting point for the
new Property
start(com.ashridgetech.jamda.uml.Property)
Method Detail |
public static Property makeProperty(java.lang.String name, Type type)
Property
object with just a name and type.
name
- the name of the new Property
.type
- the type of the new Property
.
Property
public Property getBaseProperty()
Property
whose characteristics are the starting point for the new Property
Property
- may be nullpublic void start(Property baseProperty)
Property
and set the Property
whose characteristics are the starting point for the new Property
.
Puts this instance into the building
state. Cannot be called again until after
getProperty()
has been called.
baseProperty
- the base property to set. May be null to start a new Property
with no base property
java.lang.IllegalStateException
- if this instance is already in the building
statepublic boolean isBuilding()
getProperty()
.
start(com.ashridgetech.jamda.uml.Property)
,
getProperty()
public Property getProperty()
Property
whose characteristics have been set.
This instance must be in the building
state.
Resets this instance so that it is no longer in the building
state.
Property
java.lang.IllegalStateException
- if this instance is not in the building
statepublic void setName(java.lang.String name)
Property
.
name
- the new namepublic void setType(Type type)
Type
of the new Property
.
type
- the new Type
public void setComment(java.lang.String comment)
Type
of this Property
public void setMultiple(boolean multiple)
Property
can have multiple values.
multiple
- true if the Property
has multiple valuespublic void setReadable(boolean readable)
Property
is readable.
readable
- true if the Property
is readablepublic void setReaders(java.util.Set readers)
Actor
s who can read this Property
readers
- the set of Actor
s. See Property.getReaders()
for the
values allowed.public void setWritable(boolean writable)
Property
is writable.
writable
- true if the Property
is writablepublic void setWriters(java.util.Set writers)
Actor
s who can write this Property
writers
- the set of Actor
s. See Property.getWriters()
for the
values allowed.public void setAggregation(StructuredType.Aggregation aggregation)
aggregation
- the new Aggregation
instancepublic void setOid(boolean oid)
oid
- true if this Property
is an oidpublic void setUnderlying(Attribute attribute)
Attribute
.
The getter
, setter
and association end
are all set to null.
attribute
- the new underlying element - may not be nullpublic void setUnderlying(Association.End associationEnd)
Association.End
.
The getter
, setter
and attribute
are all set to null.
associationEnd
- the new underlying element - may not be nullpublic void setUnderlying(Operation getter, Operation setter, Attribute attribute)
getter
, setter
and attribute
.
The association end
is set to null.
getter
- the getter Operation
associated with this Property
- may be null if setter
is not nullsetter
- the setter Operation
associated with this Property
- may be null if getter
is not nullpublic void setUnderlying(Parameter parameter)
Parameter
.
The getter
, setter
,
attribute
and association end
are all set to null.
parameter
- the new underlying element - may not be null
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |