public class NamedObjId extends StringAttribute implements ChangeListener
NamedObj.ContainedObjectsIterator
Settable.Visibility
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
EXPERT, FULL, NONE, NOT_EDITABLE
Constructor and Description |
---|
NamedObjId()
Constructor
|
NamedObjId(NamedObj container,
java.lang.String name)
Constructor
|
NamedObjId(Workspace workspace)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener listener)
Add a change listener, if the container is null the listener
is not added.
|
void |
addValueListener(ValueListener listener)
add a valueListener
|
static void |
assignIdTo(NamedObj no)
Generate a new KeplerLSID and assign it to this NamedObj.
|
static void |
assignIdTo(NamedObj no,
KeplerLSID lsid)
Assign the given KeplerLSID to this NamedObj.
|
static void |
assignIdTo(NamedObj no,
KeplerLSID lsid,
boolean updateReferrals)
Assign the given KeplerLSID to this NamedObj.
|
void |
changeExecuted(ChangeRequest change)
React to a change request has been successfully executed.
|
void |
changeFailed(ChangeRequest change,
java.lang.Exception exception)
React to a change request has resulted in an exception.
|
java.lang.Object |
clone(Workspace workspace)
Clone the object into the specified workspace.
|
boolean |
equals(java.lang.Object obj)
Description of the Method
|
java.lang.String |
getDefaultExpression()
returns the default expression which is null
|
KeplerLSID |
getId() |
static NamedObjId |
getIdAttributeFor(NamedObj no)
Return the NamedObjId associated with the given NamedObj or null if no
associated NamedObjId.
|
static KeplerLSID |
getIdFor(NamedObj no)
Return the LSID for the given NamedObj.
|
static NamedObjIdReferralList |
getIDListAttributeFor(NamedObj no)
Return the KeplerIDListAttribute associated with the given NamedObj or
null if no KeplerIDListAttribute exists.
|
NamedObjId |
getParentId() |
Settable.Visibility |
getVisibility()
NamedObjIds should be invisible to the user
|
static boolean |
idMatches(KeplerLSID lsid,
NamedObj no,
boolean matchRevision)
Check the given NamedObj to see if it matches the search ID.
|
static void |
incrementLSIDOnWorkflowChange(boolean listen)
Set if workflow changes should increment LSIDs.
|
void |
removeValueListener(ValueListener listener)
remove the indicated listener
|
void |
requestNamedObjIdChange() |
void |
setContainer(NamedObj container)
Override setContainer method to handle adding and removing the listener
based on whether or not there is a container.
|
void |
setExpression(KeplerLSID lsid)
Helper method for setting the expression directly with a KeplerLSID
object.
|
void |
setExpression(java.lang.String expression)
set the value of this id.
|
void |
setParentId(NamedObjId parent) |
void |
setVisibility(Settable.Visibility visibility)
this method does not change the visibility.
|
void |
updateRevision()
The updateRevision() method is used to retrieve the next available
revision from the LSIDGenerator and updates the revision accordingly.
|
java.util.Collection |
validate()
validate the expression.
|
_propagateValue, exportMoML, getExpression
getValueAsString
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDisplayName
description, getContainer, getFullName, getName, getName, setName
public static final java.lang.String NAME
public NamedObjId()
public NamedObjId(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- Description of the Parametername
- Description of the ParameterIllegalActionException
- Description of the ExceptionNameDuplicationException
- Description of the Exceptionpublic NamedObjId(Workspace workspace)
workspace
- Description of the Parameterpublic NamedObjId getParentId()
public void setParentId(NamedObjId parent)
public static void assignIdTo(NamedObj no) throws java.lang.Exception
no
- the NamedObj.java.lang.Exception
public static void assignIdTo(NamedObj no, KeplerLSID lsid) throws java.lang.Exception
no
- lsid
- java.lang.Exception
public static void assignIdTo(NamedObj no, KeplerLSID lsid, boolean updateReferrals) throws java.lang.Exception
no
- the NamedObjlsid
- the new LSID to assign.updateReferrals
- if true, update the referrals list.java.lang.Exception
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class StringAttribute
workspace
- The workspace for the new object.java.lang.CloneNotSupportedException
- If any of the attributes
cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public java.lang.String getDefaultExpression()
getDefaultExpression
in interface Settable
getDefaultExpression
in class AbstractSettableAttribute
AbstractSettableAttribute.setExpression(String)
,
Instantiable
public KeplerLSID getId()
public static KeplerLSID getIdFor(NamedObj no)
no
- public static NamedObjIdReferralList getIDListAttributeFor(NamedObj no) throws IllegalActionException, NameDuplicationException
no
- * @throws NameDuplicationExceptionIllegalActionException
NameDuplicationException
public static NamedObjId getIdAttributeFor(NamedObj no)
no
- public void setExpression(java.lang.String expression) throws IllegalActionException
setExpression
in interface Settable
setExpression
in class StringAttribute
expression
- The new expression valueIllegalActionException
- If the change is not acceptable
to the container.requestNamedObjIdChange()
public void setExpression(KeplerLSID lsid) throws IllegalActionException
lsid
- IllegalActionException
public void addValueListener(ValueListener listener)
addValueListener
in interface Settable
addValueListener
in class StringAttribute
listener
- The feature to be added to the ValueListener attributeStringAttribute.removeValueListener(ValueListener)
public Settable.Visibility getVisibility()
getVisibility
in interface Settable
getVisibility
in class StringAttribute
StringAttribute.setVisibility(Settable.Visibility)
public void setVisibility(Settable.Visibility visibility)
setVisibility
in interface Settable
setVisibility
in class StringAttribute
visibility
- The new visibility valueStringAttribute.getVisibility()
public void removeValueListener(ValueListener listener)
removeValueListener
in interface Settable
removeValueListener
in class StringAttribute
listener
- Description of the ParameterStringAttribute.addValueListener(ValueListener)
public static boolean idMatches(KeplerLSID lsid, NamedObj no, boolean matchRevision)
no
- java.lang.Exception
public void changeExecuted(ChangeRequest change)
ChangeListener
changeExecuted
in interface ChangeListener
change
- The change that has been executed, or null if
the change was not done via a ChangeRequest.public void updateRevision() throws java.lang.Exception
java.lang.Exception
public void requestNamedObjIdChange()
public void changeFailed(ChangeRequest change, java.lang.Exception exception)
ChangeListener
changeFailed
in interface ChangeListener
change
- The change that was attempted or null if
the change was not done via a ChangeRequest.exception
- The exception that resulted.public java.util.Collection validate()
validate
in interface Settable
validate
in class StringAttribute
public void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException
setContainer
in class Attribute
container
- The container to attach this attribute to..IllegalActionException
- If this attribute is not of the
expected class for the container, or it has no name,
or the attribute and container are not in the same workspace, or
the proposed container would result in recursive containment.NameDuplicationException
- If the container already has
an attribute with the name of this attribute.Attribute.getContainer()
public void addChangeListener(ChangeListener listener)
addChangeListener
in interface Changeable
addChangeListener
in class NamedObj
listener
- The listener to add.NamedObj.removeChangeListener(ChangeListener)
,
NamedObj.requestChange(ChangeRequest)
,
Changeable
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Description of the Parameterpublic static void incrementLSIDOnWorkflowChange(boolean listen)