org.cumt.model
Class BaseModelNode

java.lang.Object
  extended by org.cumt.model.IdentifiedObject
      extended by org.cumt.model.PropertyAwareObject
          extended by org.cumt.model.BaseModelNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DiagramModel, Model, ModelObject

public class BaseModelNode
extends PropertyAwareObject
implements java.lang.Cloneable

Base class for model objects.

Author:
Carlos Descalzi
See Also:
Serialized Form

Field Summary
static java.lang.String ATTRIBUTES
           
static java.lang.String DESCRIPTION
           
static java.lang.String IGNORED_ON_GENERATION
           
static java.lang.String NAME
           
 
Constructor Summary
BaseModelNode()
           
 
Method Summary
 java.lang.Object clone()
           
 java.lang.String getAttribute(java.lang.String key)
          Retrieves an attribute given its name
 java.util.Set<java.lang.String> getAttributeNames()
          Retrieves the attribute names
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
          Returns the map of arbitrary attributes.
 java.util.Date getCreationDate()
          Returns the date when the object has been created
protected  java.lang.String getDefaultName()
          Creates the default name for the object.
 java.lang.String getDescription()
           
 java.lang.String getName()
           
 Container getParent()
           
 boolean isIgnoredOnGeneration()
           
 void removeAttribute(java.lang.String attribute)
          Removes an attribute given its name
 void setAttribute(java.lang.String key, java.lang.String value)
          Sets an arbitrary text attribute
 void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
          Sets a map of arbitrary attributes
 void setDescription(java.lang.String description)
           
 void setIgnoredOnGeneration(boolean ignoredOnGeneration)
           
 void setName(java.lang.String name)
           
 void setParent(Container parent)
           
 java.lang.String toString()
           
 
Methods inherited from class org.cumt.model.PropertyAwareObject
addPropertyChangeListener, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class org.cumt.model.IdentifiedObject
equals, getId, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

ATTRIBUTES

public static final java.lang.String ATTRIBUTES
See Also:
Constant Field Values

DESCRIPTION

public static final java.lang.String DESCRIPTION
See Also:
Constant Field Values

IGNORED_ON_GENERATION

public static final java.lang.String IGNORED_ON_GENERATION
See Also:
Constant Field Values
Constructor Detail

BaseModelNode

public BaseModelNode()
Method Detail

getDefaultName

protected java.lang.String getDefaultName()
Creates the default name for the object. If the TypeAttributes annotation is present, takes it from the associated bundle value, otherwise uses the simple class name

Returns:
the default object name

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.String value)
Sets an arbitrary text attribute

Parameters:
key - the attribute name
value - the value
See Also:
attributes

setAttributes

public void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Sets a map of arbitrary attributes

Parameters:
attributes - a map of text attributes
See Also:
attributes

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Returns the map of arbitrary attributes.

Returns:
an unmodifiable map of attributes
See Also:
attributes

getAttribute

public java.lang.String getAttribute(java.lang.String key)
Retrieves an attribute given its name

Parameters:
key - the attribute to look for
Returns:
the attribute value or null if it has not been set
See Also:
attributes

getAttributeNames

public java.util.Set<java.lang.String> getAttributeNames()
Retrieves the attribute names

Returns:
a set of attribute names
See Also:
attributes

removeAttribute

public void removeAttribute(java.lang.String attribute)
Removes an attribute given its name

Parameters:
key - the attribute to remove
See Also:
attributes

getCreationDate

public java.util.Date getCreationDate()
Returns the date when the object has been created

Returns:
the creation date
See Also:
creationDate

getParent

public Container getParent()
Returns:
the node parent
See Also:
parent

setParent

public void setParent(Container parent)
See Also:
parent

getDescription

public java.lang.String getDescription()
Returns:
the description
See Also:
description

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - a description for the object
See Also:
description

isIgnoredOnGeneration

public boolean isIgnoredOnGeneration()
See Also:
ignoredOnGeneration

setIgnoredOnGeneration

public void setIgnoredOnGeneration(boolean ignoredOnGeneration)
See Also:
ignoredOnGeneration

toString

public java.lang.String toString()
Overrides:
toString in class IdentifiedObject

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object


Copyright © 2006 null. All Rights Reserved.