net.sourceforge.nrl.parser.model
Class AbstractAttribute

java.lang.Object
  extended by net.sourceforge.nrl.parser.model.AbstractAttribute
All Implemented Interfaces:
IAttribute
Direct Known Subclasses:
UML2Attribute, XSDAttribute

public abstract class AbstractAttribute
extends Object
implements IAttribute

A basic attribute implementation, to be subclassed. This provides a very basic implementation that managements a name and attribute type.


Field Summary
 
Fields inherited from interface net.sourceforge.nrl.parser.model.IAttribute
UNBOUNDED
 
Constructor Summary
AbstractAttribute(String name)
           
 
Method Summary
 String getName()
          Return the attribute's name.
 String getOriginalName()
          Some attributes have to be renamed on loading.
 IClassifier getOwner()
          Return the classifier that owns the attribute.
 IModelElement getType()
          Return the type.
 Object getUserData(String key)
          Return user data stored on this attribute.
 boolean isRepeating()
          Returns true if the attribute can occur more than once, i.e.
 void setName(String name)
           
 void setOriginalName(String name)
           
 void setOwner(IClassifier owner)
           
 void setType(IModelElement type)
           
 void setUserData(String key, Object data)
          Set user data to be stored on this attribute.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.nrl.parser.model.IAttribute
getDocumentation, getMaxOccurs, getMinOccurs, isStatic
 

Constructor Detail

AbstractAttribute

public AbstractAttribute(String name)
Method Detail

getName

public String getName()
Description copied from interface: IAttribute
Return the attribute's name.

Specified by:
getName in interface IAttribute
Returns:
the name

getOriginalName

public String getOriginalName()
Description copied from interface: IAttribute
Some attributes have to be renamed on loading. For example, XML schema elements or UML classes that have a dot in them have their dots stripped out by the NRL model loader, otherwise they cannot be used. In these cases, this method will return the original name found in the model.

In all other cases, the method returns the same as IAttribute.getName().

Specified by:
getOriginalName in interface IAttribute
Returns:
the original name

getOwner

public IClassifier getOwner()
Description copied from interface: IAttribute
Return the classifier that owns the attribute.

Specified by:
getOwner in interface IAttribute
Returns:
the classifier

getType

public IModelElement getType()
Description copied from interface: IAttribute
Return the type.

Specified by:
getType in interface IAttribute
Returns:
the type

getUserData

public Object getUserData(String key)
Description copied from interface: IAttribute
Return user data stored on this attribute. This can be used to attach and retrieve processing information.

Specified by:
getUserData in interface IAttribute
Parameters:
key - the key under which the data is stored
Returns:
the data or null if not present

isRepeating

public boolean isRepeating()
Description copied from interface: IAttribute
Returns true if the attribute can occur more than once, i.e. max occurs is greater than 1 or unbounded.

Specified by:
isRepeating in interface IAttribute
Returns:
true if the attribute is repeating

setName

public void setName(String name)

setOriginalName

public void setOriginalName(String name)

setOwner

public void setOwner(IClassifier owner)

setType

public void setType(IModelElement type)

setUserData

public void setUserData(String key,
                        Object data)
Description copied from interface: IAttribute
Set user data to be stored on this attribute. This can be used to attach and retrieve processing information.

Specified by:
setUserData in interface IAttribute
Parameters:
key - the key under which the data is stored
data - the data


Copyright © 2006-2010 Christian Nentwich and others