net.sourceforge.nrl.parser.model
Interface IAttribute

All Known Implementing Classes:
AbstractAttribute, UML2Attribute, XSDAttribute

public interface IAttribute

An attribute has a name, a type and a multiplicity. The type is a model element.


Field Summary
static int UNBOUNDED
          Constant for unbounded upper and lower occurrence
 
Method Summary
 List<String> getDocumentation()
          Return any documentation associated with the attribute.
 int getMaxOccurs()
          Return the maximum number of occurrences of the attribute (0 or more).
 int getMinOccurs()
          Return the minimum number of occurrences of the attribute (0 or more).
 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.
 boolean isStatic()
          Returns true if the attribute is static, or if it is an enum value.
 void setUserData(String key, Object data)
          Set user data to be stored on this attribute.
 

Field Detail

UNBOUNDED

static final int UNBOUNDED
Constant for unbounded upper and lower occurrence

See Also:
Constant Field Values
Method Detail

getDocumentation

List<String> getDocumentation()
Return any documentation associated with the attribute.

Returns:
the documentation or an empty list

getName

String getName()
Return the attribute's name.

Returns:
the name

getMinOccurs

int getMinOccurs()
Return the minimum number of occurrences of the attribute (0 or more).

Returns:
the occurrences

getMaxOccurs

int getMaxOccurs()
Return the maximum number of occurrences of the attribute (0 or more).

Returns:
the occurrences

getOriginalName

String getOriginalName()
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 getName().

Returns:
the original name

getOwner

IClassifier getOwner()
Return the classifier that owns the attribute.

Returns:
the classifier

getUserData

Object getUserData(String key)
Return user data stored on this attribute. This can be used to attach and retrieve processing information.

Parameters:
key - the key under which the data is stored
Returns:
the data or null if not present

getType

IModelElement getType()
Return the type.

Returns:
the type

isRepeating

boolean isRepeating()
Returns true if the attribute can occur more than once, i.e. max occurs is greater than 1 or unbounded.

Returns:
true if the attribute is repeating

isStatic

boolean isStatic()
Returns true if the attribute is static, or if it is an enum value.

Returns:
true if static

setUserData

void setUserData(String key,
                 Object data)
Set user data to be stored on this attribute. This can be used to attach and retrieve processing information.

Parameters:
key - the key under which the data is stored
data - the data


Copyright © 2006-2010 Christian Nentwich and others