Examples of PObjectMetaInfo


Examples of org.jresearch.flexess.core.model.impl.PObjectMetaInfo

  }

  @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;

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.