}
@SuppressWarnings("unchecked")
protected PObjectMetaInfo internalLoadPobject(String modelId, PObject po, boolean withPermissions) {
PObjectMetaInfo poMeta = new PObjectMetaInfo();
poMeta.setId(po.getId());
poMeta.setModelId(modelId);
String annotation = EcoreUtil.getAnnotation(po, UamPackage.eNS_URI, IPObjectConstant.CLASSNAME_ATTR);
if (annotation == null) {
throw new IllegalArgumentException("Illegal PObject. Must contain " + IPObjectConstant.CLASSNAME_ATTR);
}
String mapper = EcoreUtil.getAnnotation(po, UamPackage.eNS_URI, IPObjectConstant.MAPPER_CLASS_NAME_ATTR);
if (mapper == null) {
throw new IllegalArgumentException("Illegal PObject. Must contain annotation " + IPObjectConstant.MAPPER_CLASS_NAME_ATTR);
}
poMeta.setMapperName(mapper);
poMeta.setClassName(annotation);
poMeta.setName(po.getName());
annotation = EcoreUtil.getAnnotation(po, UamPackage.eNS_URI, IPObjectConstant.DESCRIPTION_ATTR);
poMeta.setDescription(annotation);
for (Iterator<EAttribute> it = po.getEAttributes().iterator(); it.hasNext();) {
EAttribute attr = it.next();
createMetaAttribute(poMeta, attr);
}
for (Iterator<EOperation> it2 = po.getEOperations().iterator(); it2.hasNext();) {
EOperation op = it2.next();
if (op instanceof POperation) {
createMetaOperation(poMeta, (POperation) op, withPermissions);
}
}
for (Iterator<Permission> it3 = po.getPermission().iterator(); it3.hasNext();) {
Permission perm = it3.next();
ElementDescription ed = createElementDescription(perm);
poMeta.addPermission(ed);
}
return poMeta;
}