net.sourceforge.nrl.parser.model.uml2
Class UML2Attribute

java.lang.Object
  extended by net.sourceforge.nrl.parser.model.AbstractAttribute
      extended by net.sourceforge.nrl.parser.model.uml2.UML2Attribute
All Implemented Interfaces:
IAttribute

public class UML2Attribute
extends AbstractAttribute

Extension of a standard attribute that holds a UML2 typed element reference.

Author:
Christian Nentwich

Field Summary
 
Fields inherited from interface net.sourceforge.nrl.parser.model.IAttribute
UNBOUNDED
 
Constructor Summary
UML2Attribute(org.eclipse.uml2.uml.NamedElement namedElement)
          Initialise the attribute using a UML2 named element object.
UML2Attribute(org.eclipse.uml2.uml.NamedElement namedElement, int minOccurs, int maxOccurs)
           
UML2Attribute(org.eclipse.uml2.uml.NamedElement namedElement, String nameOverride)
           
UML2Attribute(org.eclipse.uml2.uml.NamedElement namedElement, String nameOverride, int minOccurs, int maxOccurs)
           
 
Method Summary
 List<String> getDocumentation()
          Extract the documentation from the UML 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).
 org.eclipse.uml2.uml.Type getUMLType()
           
 Object getUserData(String key)
          Return user data stored on this attribute.
 boolean isStatic()
          Returns true if the attribute is static, or if it is an enum value.
protected  void resolve(Map<org.eclipse.uml2.uml.Classifier,IClassifier> umlClassToModelElement)
          Resolve the types of the attribute
 
Methods inherited from class net.sourceforge.nrl.parser.model.AbstractAttribute
getName, getOriginalName, getOwner, getType, isRepeating, setName, setOriginalName, setOwner, setType, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UML2Attribute

public UML2Attribute(org.eclipse.uml2.uml.NamedElement namedElement)
Initialise the attribute using a UML2 named element object. The type of the attribute will remain unresolved until resolve(Map) is called.

Parameters:
namedElement - the element

UML2Attribute

public UML2Attribute(org.eclipse.uml2.uml.NamedElement namedElement,
                     String nameOverride)

UML2Attribute

public UML2Attribute(org.eclipse.uml2.uml.NamedElement namedElement,
                     int minOccurs,
                     int maxOccurs)

UML2Attribute

public UML2Attribute(org.eclipse.uml2.uml.NamedElement namedElement,
                     String nameOverride,
                     int minOccurs,
                     int maxOccurs)
Method Detail

getDocumentation

public List<String> getDocumentation()
Extract the documentation from the UML attribute.

Returns:
the documentation or an empty list

getMinOccurs

public int getMinOccurs()
Description copied from interface: IAttribute
Return the minimum number of occurrences of the attribute (0 or more).

Returns:
the occurrences

getMaxOccurs

public int getMaxOccurs()
Description copied from interface: IAttribute
Return the maximum number of occurrences of the attribute (0 or more).

Returns:
the occurrences

isStatic

public boolean isStatic()
Description copied from interface: IAttribute
Returns true if the attribute is static, or if it is an enum value.

Returns:
true if static

getUMLType

public org.eclipse.uml2.uml.Type getUMLType()

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
Overrides:
getUserData in class AbstractAttribute
Parameters:
key - the key under which the data is stored
Returns:
the data or null if not present

resolve

protected void resolve(Map<org.eclipse.uml2.uml.Classifier,IClassifier> umlClassToModelElement)
Resolve the types of the attribute



Copyright © 2006-2013. All Rights Reserved.