net.sourceforge.nrl.parser.model
Class AbstractClassifier
java.lang.Object
net.sourceforge.nrl.parser.model.AbstractModelElement
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.
- Author:
- Christian Nentwich
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 |
clone, equals, finalize, 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 |
nameToAttribute
protected Map<String,IAttribute> nameToAttribute
AbstractClassifier
public AbstractClassifier(String name,
IPackage container)
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 forincludeInherited
- 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
rebuildAttributeNameMap
public void rebuildAttributeNameMap()
removeAttribute
public void removeAttribute(IAttribute attribute)
removeAttributeNameMapping
public void removeAttributeNameMapping(String name)
setEnumeration
public void setEnumeration(boolean enumeration)
Copyright © 2006-2013. All Rights Reserved.