|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jupe.uml2model.UML2ModelRoot
public class UML2ModelRoot
Field Summary | |
---|---|
static java.lang.String |
PRIMITIVE_TYPES_PACKAGE
The name of the package where the primitives types are stored. |
static java.lang.String |
UNRESOLVED_TYPES_PACKAGE
The name of the package where unresolved types are temporary stored. |
Constructor Summary | |
---|---|
UML2ModelRoot(JupeProject project)
|
Method Summary | |
---|---|
void |
addToIDHash(org.eclipse.uml2.uml.Element element)
Checks if the element is already in the ID hash table (see IDFromElement ) and adds it with a new ID if not. |
java.util.List<ITypeContentProposal> |
completeInPrimitiveTypes(java.lang.String contents)
Searches for possible resolution of the given String to the type name of a primitive type. |
java.util.List<ITypeContentProposal> |
completeInUML2(java.lang.String contents)
Completes the given String to a type name found in the UML2 model. |
java.util.List<ITypeContentProposal> |
completeInUnresolvedTypes(java.lang.String contents)
Searches for possible auto-completion resolution of the given String to a type name that is in the package for unresolved types right now. |
java.lang.String |
getAbsoluteName(org.eclipse.uml2.uml.NamedElement element)
Convenience method to call getAbsoluteName(NamedElement, boolean) with the second parameter
set to true. |
java.lang.String |
getAbsoluteName(org.eclipse.uml2.uml.NamedElement element,
boolean noHiddenPackages)
Builds the absolute name for an given UML2 element. |
org.eclipse.uml2.uml.Element |
getElement(java.lang.String id)
Get the UML2 element that corresponds to a certain ID (see IDFromElement ). |
java.lang.String |
getID(org.eclipse.uml2.uml.Element element)
Get the unique ID of a UML2 element (see IDFromElement ). |
org.eclipse.uml2.uml.Model |
getUML2Model()
|
void |
registerTypeName(java.lang.String absoluteName)
Signal to the UML model that a type with a certain type name exists. |
void |
repopulateHashTable(org.eclipse.emf.ecore.xmi.XMLResource xml)
Reads the XML file that contains the UML2 model and fills the hash table that contains each UML2 element and its corresponding unique ID (see IDFromElement ). |
org.eclipse.uml2.uml.Classifier |
resolveType(java.lang.String absoluteName)
|
void |
setUML2Model(org.eclipse.uml2.uml.Model newModel)
|
void |
setUpHiddenPackages()
Creates two hidden packages: One for primitive types (e.g. int, boolean) which are loaded from the UML2 library, and another one for temporary unresolved types. |
void |
setXmiIDs(org.eclipse.emf.ecore.xmi.XMLResource xml)
Writes the unique IDs of UML2 elements that are stored in IDFromElement and elementFromID at runtime into the XML
file that contains the UML2 model. |
void |
unregisterTypeName(java.lang.String absoluteName)
Signal to the UML model that a type with a certain name doesn't exist anymore. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PRIMITIVE_TYPES_PACKAGE
public static final java.lang.String UNRESOLVED_TYPES_PACKAGE
A type is called unresolved here, if it doesn't exist in the rest of the UML2 model or in the source. E.g. unresolved types can be created when the user sets some type reference in a diagram to a type he will create later.
Constructor Detail |
---|
public UML2ModelRoot(JupeProject project)
Method Detail |
---|
public void setUpHiddenPackages()
public org.eclipse.uml2.uml.Model getUML2Model()
public void setUML2Model(org.eclipse.uml2.uml.Model newModel)
public void addToIDHash(org.eclipse.uml2.uml.Element element)
IDFromElement
) and adds it with a new ID if not.
element
- The UML2 element to add to the ID hash table.public java.lang.String getID(org.eclipse.uml2.uml.Element element)
IDFromElement
).
element
- A UML2 element.
public org.eclipse.uml2.uml.Element getElement(java.lang.String id)
IDFromElement
).
id
- An ID for a UML2 element.
public java.lang.String getAbsoluteName(org.eclipse.uml2.uml.NamedElement element, boolean noHiddenPackages)
element
- An UML2 element.noHiddenPackages
- When true, elements in the hidden packages won't be resolved,
but return their simple name.
public java.lang.String getAbsoluteName(org.eclipse.uml2.uml.NamedElement element)
getAbsoluteName(NamedElement, boolean)
with the second parameter
set to true.
element
-
getAbsoluteName(NamedElement, boolean)
public void setXmiIDs(org.eclipse.emf.ecore.xmi.XMLResource xml)
IDFromElement
and elementFromID
at runtime into the XML
file that contains the UML2 model.
This method should be called while saving the UML2 model.
xml
- The resource containing the UML2 model.public void repopulateHashTable(org.eclipse.emf.ecore.xmi.XMLResource xml)
IDFromElement
).
This method should be called while laoding the UML2 model.
xml
- The resource containing the UML2 model.public java.util.List<ITypeContentProposal> completeInUnresolvedTypes(java.lang.String contents)
contents
- The beginning of a type name.
public java.util.List<ITypeContentProposal> completeInPrimitiveTypes(java.lang.String contents)
contents
- The beginning of a type name.
public java.util.List<ITypeContentProposal> completeInUML2(java.lang.String contents)
contents
- The beginning of a type name.
public org.eclipse.uml2.uml.Classifier resolveType(java.lang.String absoluteName)
public void registerTypeName(java.lang.String absoluteName)
The method checks whether the new type allows resolution of a type that is marked as unresolved, and adds the type name to a internal hash table.
absoluteName
- The absolute name of the type.public void unregisterTypeName(java.lang.String absoluteName)
The method will remove the type from a internal hash table.
absoluteName
- The absolute name of the type.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |