Package com.nomagic.uml2.ext.jmi.reflect
Class AbstractRefAssociation
- java.lang.Object
-
- com.nomagic.uml2.ext.jmi.reflect.AbstractRefBaseObjectImpl
-
- com.nomagic.uml2.ext.jmi.reflect.AbstractRefAssociation
-
- All Implemented Interfaces:
MapOwner
,AbstractRefBaseObject
,RepositoryProvider
,javax.jmi.reflect.RefAssociation
,javax.jmi.reflect.RefBaseObject
- Direct Known Subclasses:
EcoreRefAssociation
public abstract class AbstractRefAssociation extends com.nomagic.uml2.ext.jmi.reflect.AbstractRefBaseObjectImpl implements javax.jmi.reflect.RefAssociation
The RefAssociation interface provides the metaobject description of an association. It also provides generic operations querying and updating the links that belong to the association. The model of association supported by this interface is of collection of two ended asymmetric links between objects. The links may be viewed as ordered on one or other of the ends, and there may be some form of cardinality constraints on either end. The RefAssociation interface is designed to be used with associations that contain no duplicate links, though this is not an absolute requirement. There is no assumption that different association objects for a given association type are mutually aware. Links are modeled as having no object identity.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class
mClass1
private java.lang.Class
mClass2
private boolean
mMultivalued1
private boolean
mNavigable1
private boolean
mNavigable2
private java.lang.String
mReferenceName1
private java.lang.String
mReferenceName2
private java.lang.String
mRoleName1
private java.lang.String
mRoleName2
-
Constructor Summary
Constructors Constructor Description AbstractRefAssociation(AbstractRepository repository, java.lang.String roleName1, java.lang.String referenceName1, boolean navigable1, boolean multivalued1, java.lang.Class class1, java.lang.String roleName2, java.lang.String referenceName2, boolean navigable2, boolean multivalued2, java.lang.Class class2)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.Collection
asCollction(java.lang.Object result)
private javax.jmi.reflect.RefClass
getRefClass(java.lang.Class cl1)
boolean
refAddLink(javax.jmi.reflect.RefObject endOne, javax.jmi.reflect.RefObject endTwo)
The "refAddLink" operation adds "newLink" into the set of links in the extent of this association object.java.util.Collection
refAllLinks()
The "refAllLinks" operation returns all links in the link set for this Association object.boolean
refLinkExists(javax.jmi.reflect.RefObject endOne, javax.jmi.reflect.RefObject endTwo)
The "refLinkExists" operation returns true if and only if the supplied link is a member of the link set for this association object.java.util.Collection
refQuery(java.lang.String queryEndName, javax.jmi.reflect.RefObject queryObject)
The "refQuery" operations return a list containing all instance objects that are linked to the supplied "queryObject" by links in the extent of this association object, where the links all have the "queryObject" at the "queryEnd"java.util.Collection
refQuery(javax.jmi.reflect.RefObject queryEnd, javax.jmi.reflect.RefObject queryObject)
The "refQuery" operations return a list containing all instance objects that are linked to the supplied "queryObject" by links in the extent of this association object, where the links all have the "queryObject" at the "queryEnd"boolean
refRemoveLink(javax.jmi.reflect.RefObject endOne, javax.jmi.reflect.RefObject endTwo)
The "refRemoveLink" operation removes the existing link from the association.-
Methods inherited from class com.nomagic.uml2.ext.jmi.reflect.AbstractRefBaseObjectImpl
getRepository, mapClear, mapPut, mapPutAll, mapRemove, mof_getRepository, refImmediatePackage, refMetaObject, refMofId, refOutermostPackage, refVerifyConstraints, setMofID, setOwner, setRefMetaObject, setRepository
-
-
-
-
Field Detail
-
mRoleName1
private final java.lang.String mRoleName1
-
mReferenceName1
private final java.lang.String mReferenceName1
-
mNavigable1
private final boolean mNavigable1
-
mMultivalued1
private final boolean mMultivalued1
-
mClass1
private final java.lang.Class mClass1
-
mRoleName2
private final java.lang.String mRoleName2
-
mReferenceName2
private final java.lang.String mReferenceName2
-
mNavigable2
private final boolean mNavigable2
-
mClass2
private final java.lang.Class mClass2
-
-
Constructor Detail
-
AbstractRefAssociation
public AbstractRefAssociation(AbstractRepository repository, java.lang.String roleName1, java.lang.String referenceName1, boolean navigable1, boolean multivalued1, java.lang.Class class1, java.lang.String roleName2, java.lang.String referenceName2, boolean navigable2, boolean multivalued2, java.lang.Class class2)
- Parameters:
repository
-roleName1
-referenceName1
-navigable1
-multivalued1
-class1
-roleName2
-referenceName2
-navigable2
-multivalued2
-class2
-
-
-
Method Detail
-
refAddLink
public boolean refAddLink(javax.jmi.reflect.RefObject endOne, javax.jmi.reflect.RefObject endTwo)
The "refAddLink" operation adds "newLink" into the set of links in the extent of this association object. If one or other of the association's ends is ordered, the link is inserted after the last link with respect to that ordering. Both RefObject members of the "newLink" parameter should be valid instance objects.- Specified by:
refAddLink
in interfacejavax.jmi.reflect.RefAssociation
-
refAllLinks
public java.util.Collection refAllLinks()
The "refAllLinks" operation returns all links in the link set for this Association object. specific analog: return type: isQuery: parameters: exceptions: none Collection yes none none This operation returns the current link set for the current association extent as defined for the specific version of this operation. Returns all links (Association instances )specified by this association. Returned collection does not support live update as it specified in jmi documentation.- Specified by:
refAllLinks
in interfacejavax.jmi.reflect.RefAssociation
- Returns:
- collection of
AssociationLink
.
-
getRefClass
private javax.jmi.reflect.RefClass getRefClass(java.lang.Class cl1)
-
refLinkExists
public boolean refLinkExists(javax.jmi.reflect.RefObject endOne, javax.jmi.reflect.RefObject endTwo)
The "refLinkExists" operation returns true if and only if the supplied link is a member of the link set for this association object. TypeMismatchException is raised if the parameters do not match the types of the respective association ends.- Specified by:
refLinkExists
in interfacejavax.jmi.reflect.RefAssociation
-
refQuery
public java.util.Collection refQuery(javax.jmi.reflect.RefObject queryEnd, javax.jmi.reflect.RefObject queryObject)
The "refQuery" operations return a list containing all instance objects that are linked to the supplied "queryObject" by links in the extent of this association object, where the links all have the "queryObject" at the "queryEnd"- Specified by:
refQuery
in interfacejavax.jmi.reflect.RefAssociation
-
refQuery
public java.util.Collection refQuery(java.lang.String queryEndName, javax.jmi.reflect.RefObject queryObject)
The "refQuery" operations return a list containing all instance objects that are linked to the supplied "queryObject" by links in the extent of this association object, where the links all have the "queryObject" at the "queryEnd"- Specified by:
refQuery
in interfacejavax.jmi.reflect.RefAssociation
-
asCollction
private java.util.Collection asCollction(java.lang.Object result)
- Parameters:
result
-- Returns:
-
refRemoveLink
public boolean refRemoveLink(javax.jmi.reflect.RefObject endOne, javax.jmi.reflect.RefObject endTwo)
The "refRemoveLink" operation removes the existing link from the association. Returns true if the link was successfully removed.- Specified by:
refRemoveLink
in interfacejavax.jmi.reflect.RefAssociation
-
-