}
if (imp instanceof TypeImport) {
TypeImport peImp = (TypeImport) imp;
EStructuralFeature eSF = peImp.eClass().getEStructuralFeature(
"type");
DispelType pe = (DispelType) peImp
.eGet(eSF, false);
if (pe.eIsProxy() && processingElements != null) {
String[] fragments = EcoreUtil.getURI(pe).fragment().split("_");
for (ProcessingElementDefinition nPe : processingElements) {
if (nPe.getName().equals(
fragments[fragments.length - 1])
&& nPe.getNamespacesAsString().equals(
imp.getNamespacesAsString())) {
ProcessingElementDefinition peDef = (ProcessingElementDefinition) EcoreUtil
.copy(nPe);
if (pck.getTypeDefinition(
peDef.getNamespacesAsString(),
peDef.getName()) == null) {
pck.getTypeDefinitions().add(
(ProcessingElementDefinition) peDef);
peImp.setType(peDef);
}
}
}
for (DispelFunction nFu : functions) {
if (nFu.getName().equals(
fragments[fragments.length - 1])
&& nFu.getNamespacesAsString().equals(
imp.getNamespacesAsString())) {
DispelFunction fuDef = (DispelFunction) EcoreUtil
.copy(nFu);
if (pck.getTypeDefinition(
fuDef.getNamespacesAsString(),
fuDef.getName()) == null) {
pck.getTypeDefinitions().add(
(DispelFunction)fuDef);
peImp.setType(fuDef);
}
}
}
/*DOMAIN TYPES !
for (DomainTypeDefinition nPe : domainTypes) {
if (nPe.getName().equals(
fragments[fragments.length - 1])
&& nPe.getNamespacesAsString().equals(
imp.getNamespacesAsString())) {
DomainTypeDefinition dtDef = (DomainTypeDefinition) EcoreUtil
.copy(nPe);
if (root.getTypeDefinition(
dtDef.getNamespacesAsString(),
dtDef.getName()) == null) {
root.getTypeDefinitions().add(
(DomainTypeDefinition) dtDef);
peImp.setType(dtDef);
}
}
}
*/
for (StructuralTypeDefinition nPe : structuralTypes) {
if (nPe.getName().equals(
fragments[fragments.length - 1])
&& nPe.getNamespacesAsString().equals(
imp.getNamespacesAsString())) {
StructuralTypeDefinition dtDef = (StructuralTypeDefinition) EcoreUtil
.copy(nPe);
if (pck.getTypeDefinition(
dtDef.getNamespacesAsString(),
dtDef.getName()) == null) {
pck.getTypeDefinitions().add(
(StructuralTypeDefinition) dtDef);
peImp.setType(dtDef);
}
}
}
}
}