}
// Find the corresponding ParameterPort and delete it
if (toDelete != null) {
NamedObj container = toDelete.getContainer();
if (container != null && container instanceof Entity) {
Attribute attribute = ((Entity) container)
.getAttribute(portName);
if (attribute != null
&& attribute instanceof PortParameter) {
DeleteRequest request = new DeleteRequest(
_DELETE_PROPERTY, attribute.getName(), null);
// Only defer if we are in a class, entity, or
// model context, which is equivalent to the
// _current being an instance of
// InstantiableNamedObj.
if ((_deleteRequests != null)
&& _current instanceof InstantiableNamedObj) {
_deleteRequests.add(request);
} else {
// Very likely, the context is null, in which
// case the following will throw an exception.
// We defer to it in case somehow a link request
// is being made at the top level with a non-null
// context (e.g. via a change request).
request.execute();
}
}
}
}
// Link is stored and processed last, but before deletions.
DeleteRequest request = new DeleteRequest(_DELETE_PORT,
portName, entityName);
// Only defer if we are in a class, entity, or model context,
// which is equivalent to the _current being an instance of
// InstantiableNamedObj.
if ((_deleteRequests != null)
&& _current instanceof InstantiableNamedObj) {
_deleteRequests.add(request);
} else {
// Very likely, the context is null, in which
// case the following will throw an exception.
// We defer to it in case somehow a link request
// is being made at the top level with a non-null
// context (e.g. via a change request).
request.execute();
}
// NOTE: deletePort is not supposed to have anything
// inside it, so we do not push the context.
//////////////////////////////////////////////////////////////
//// deleteProperty
} else if (elementName.equals("deleteProperty")) {
String propName = (String) _attributes.get("name");
_checkForNull(propName,
"No name for element \"deleteProperty\"");
// Link is stored and processed last, but before deletions.
DeleteRequest request = new DeleteRequest(_DELETE_PROPERTY,
propName, null);
// We use toDelete to find any PortParameters
Attribute toDelete = _searchForAttribute(propName);
// Only defer if we are in a class, entity, or model context,
// which is equivalent to the _current being an instance of
// InstantiableNamedObj.
if ((_deleteRequests != null)
&& _current instanceof InstantiableNamedObj) {
_deleteRequests.add(request);
} else {
// Very likely, the context is null, in which
// case the following will throw an exception.
// We defer to it in case somehow a link request
// is being made at the top level with a non-null
// context (e.g. via a change request).
request.execute();
}
// Find the corresponding PortParameter and delete it
NamedObj container = toDelete.getContainer();
if (container != null && container instanceof Entity) {
Port port = ((Entity) container).getPort(propName);
if (port != null && port instanceof ParameterPort) {
request = new DeleteRequest(_DELETE_PORT, port
.getName(), container.getFullName());