return ed;
}
@SuppressWarnings("unchecked")
protected IPermissionMetaInfo loadPermission(String modelId, Permission permission) {
PermissionMetaInfo pm = new PermissionMetaInfo();
pm.setModelId(modelId);
String description = EcoreUtil.getAnnotation(permission, UamPackage.eNS_URI, IPObjectConstant.DESCRIPTION_ATTR);
pm.setDescription(description);
Constraint constraint = permission.getConstraint();
if (constraint != null) {
pm.setConstraint(constraint.getExpession());
}
pm.setId(permission.getId());
pm.setName(permission.getName());
for (Iterator<EAttribute> it = permission.getEAttributes().iterator(); it.hasNext();) {
EAttribute attr = it.next();
createMetaAttribute(pm, attr);
}
for (Iterator<POperation> it = permission.getPOperation().iterator(); it.hasNext();) {
POperation pop = it.next();
ElementDescription ed = createElementDescription(pop);
pm.addOperation(ed);
}
for (Iterator<Role> it = EMFUtil.getRoles(permission).iterator(); it.hasNext();) {
Role role = it.next();
ElementDescription ed = createElementDescription(role);
pm.addRole(ed);
}
PObject po = permission.getPObject();
if (permission.getPOperation().isEmpty() && po != null) {
ElementDescription ed = createElementDescription(po);
pm.setPObjectDescription(ed);
}
return pm;
}