public enum OwningWg extends java.lang.Enum<OwningWg>
We assume that the current UML model has three standard model packages (one that contains canonical CIM top-level packages, one with CIM profiles, and one that contains IEC61850 top-level packages) and any number of custom model packages (both CIM and non-CIM extensions).
TODO: We may want to replace this enum with a class to allow for more flexibility for non-standard packages that could be specified in the "config.properties" file.
Implementation note: We keep this class in the common package instead of model package because
Config
depends on it.
Enum Constant and Description |
---|
JWG25 |
OTHER_CIM |
OTHER_IEC61850 |
WG10 |
WG13 |
WG14 |
WG16 |
WG17 |
WG18 |
WG19 |
Modifier and Type | Method and Description |
---|---|
static OwningWg |
determineAssociationOwner(OwningWg oneEndOwner,
OwningWg otherEndOwner)
Returns the owner of an association if both ends have been initialised, null otherwise.
|
java.util.EnumSet<OwningWg> |
getAllowedOtherEndOwners()
Returns the allowed dependencies of this owner, as per IEC TC57 top-level package
dependencies rules.
|
java.lang.String |
getAppDomain() |
Nature |
getNature() |
static OwningWg |
getOwnerForTopPackage(java.lang.String topPackageName)
Utility method: returns the owner for the given name of top package, null if there is no such
a name assigned to an owner.
|
static java.util.Collection<java.lang.String> |
getReservedTopPackageNames()
Returns reserved (standard) top package names.
|
java.lang.String |
getTopPackageName() |
boolean |
involvedIn(OwningWg oneEnd,
OwningWg otherEnd)
Returns whether one of the arguments has this owner.
|
static OwningWg |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static OwningWg[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final OwningWg WG13
public static final OwningWg WG14
public static final OwningWg WG16
public static final OwningWg OTHER_CIM
public static final OwningWg WG10
public static final OwningWg WG17
public static final OwningWg WG18
public static final OwningWg JWG25
public static final OwningWg WG19
public static final OwningWg OTHER_IEC61850
public static OwningWg[] values()
for (OwningWg c : OwningWg.values()) System.out.println(c);
public static OwningWg valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String getTopPackageName()
public Nature getNature()
public java.lang.String getAppDomain()
public static java.util.Collection<java.lang.String> getReservedTopPackageNames()
public static OwningWg getOwnerForTopPackage(java.lang.String topPackageName)
public java.util.EnumSet<OwningWg> getAllowedOtherEndOwners()
public static OwningWg determineAssociationOwner(OwningWg oneEndOwner, OwningWg otherEndOwner)
UML generalisation (inheritance) and UML dependency (hand-drawn in the model, among elements)
are relationships that have natural dependency direction, i.e., explicitly from source end to
target end. However, for associations in CIM, we unfortunately cannot rely on natural
dependencies, because associations are agreed to be bi-directional (we always have
association end names on both sides of an association). So, in this method, it does not
matter what is source and what is target - oneEndOwner
and
otherEndOwner
. Owner is assigned for the fact that there is an association
between two classes, potentially from different top-level packages (i.e., with potentially
different owner).
The owner returned is in the reverse direction of IEC TC57 agreed dependencies. For instance,
for an association involving classes between WG13
and WG14
, owner is
WG14
, because the class of WG14
depends on the class of WG13
, and
this latter need not know about who links to it. Therefore, we calculate the actual owner
according to the IEC TC57 top-level package dependencies reverse order, as follows:
[
any ->
WG13
-> WG14
WG13
-> WG14
-> WG16
-> OTHER_CIM
WG13
-> WG14
| WG10
-> WG17
| WG10
-> WG18
| WG10
-> JWG25
] -> WG19
OTHER_IEC61850
.
Model validators have the job of detecting inconsistencies in dependencies by using
getAllowedOtherEndOwners()
.
oneEndOwner
- owner of one end of the association.otherEndOwner
- owner of the other end of the association.Copyright 2009-2016 Tatjana (Tanja) Kostic