net.sourceforge.nrl.parser.model
Class AbstractClassifier

java.lang.Object
  extended by net.sourceforge.nrl.parser.model.AbstractModelElement
      extended by net.sourceforge.nrl.parser.model.AbstractClassifier
All Implemented Interfaces:
IClassifier, IModelElement
Direct Known Subclasses:
UML2Classifier, UML2DataType, XSDClassifier, XSDDataType

public abstract class AbstractClassifier
extends AbstractModelElement
implements IClassifier

Abstract basic implementation of a classifier that manages attribute collections. Subclasses need to provide further detail.


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sourceforge.nrl.parser.model.IModelElement
IModelElement.ElementType
 
Constructor Summary
AbstractClassifier(String name, IPackage container)
           
 
Method Summary
 void addAttribute(IAttribute attribute)
           
 IAttribute getAttributeByName(String name, boolean includeInherited)
          Return an attribute by name, or null if not found.
 List<IAttribute> getAttributes()
          Return the actual, unmodified attribute list for use by subclasses.
 List<IAttribute> getAttributes(boolean includeInherited)
          Return a collection of IAttribute objects.
 boolean hasAttribute(String name)
          Return true if a classifier has an attribute with a given name, or false otherwise.
 boolean hasNonStaticAttributes()
           
 boolean hasStaticAttributes()
          Return true if the classifier contains any static attributes.
 boolean isEnumeration()
          Return true if the classifier is just an enumeration.
 void removeAttribute(IAttribute attribute)
           
 void removeAttributeNameMapping(String name)
           
 void setEnumeration(boolean enumeration)
           
 
Methods inherited from class net.sourceforge.nrl.parser.model.AbstractModelElement
addChild, getContainingPackage, getDescendants, getName, getOriginalName, getParent, getQualifiedName, getUserData, isAssignableFrom, isSupplementary, setName, setOriginalName, setParent, setSupplementary, setUserData
 
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.IModelElement
getContainingPackage, getDescendants, getDocumentation, getElementType, getName, getOriginalName, getParent, getQualifiedName, getUserData, isAssignableFrom, isSupplementary, setUserData
 

Constructor Detail

AbstractClassifier

public AbstractClassifier(String name,
                          IPackage container)
Method Detail

addAttribute

public void addAttribute(IAttribute attribute)

getAttributes

public List<IAttribute> getAttributes(boolean includeInherited)
Description copied from interface: IClassifier
Return a collection of IAttribute objects.

Specified by:
getAttributes in interface IClassifier
Parameters:
includeInherited - if true, move up the inheritance hierarchy and include all attributes declared in superclasses
Returns:
the attributes

getAttributes

public List<IAttribute> getAttributes()
Return the actual, unmodified attribute list for use by subclasses.

Returns:
the list

getAttributeByName

public IAttribute getAttributeByName(String name,
                                     boolean includeInherited)
Description copied from interface: IClassifier
Return an attribute by name, or null if not found.

Specified by:
getAttributeByName in interface IClassifier
Parameters:
name - the name to look for
includeInherited - if true, search the inherited attributes for the name
Returns:
the attribute or null

hasAttribute

public boolean hasAttribute(String name)
Description copied from interface: IClassifier
Return true if a classifier has an attribute with a given name, or false otherwise.

Specified by:
hasAttribute in interface IClassifier
Parameters:
name - the name
Returns:
true if the attribute is present

hasNonStaticAttributes

public boolean hasNonStaticAttributes()

hasStaticAttributes

public boolean hasStaticAttributes()
Description copied from interface: IClassifier
Return true if the classifier contains any static attributes.

Specified by:
hasStaticAttributes in interface IClassifier
Returns:
true or false

isEnumeration

public boolean isEnumeration()
Description copied from interface: IClassifier
Return true if the classifier is just an enumeration. An enumeration is a collection of static attributes.

Specified by:
isEnumeration in interface IClassifier
Returns:
true or false

removeAttribute

public void removeAttribute(IAttribute attribute)

removeAttributeNameMapping

public void removeAttributeNameMapping(String name)

setEnumeration

public void setEnumeration(boolean enumeration)


Copyright © 2006-2010 Christian Nentwich and others