Ejemplo n.º 1
0
  /**
   * Create new ClassInfo object
   *
   * @throws ShapeChangeAbortException
   */
  public ClassInfoEA(EADocument doc, PackageInfoEA pi, org.sparx.Element elmt)
      throws ShapeChangeAbortException {
    // Memorize document and parent package.
    document = doc;
    packageInfo = pi;
    // EA object reference. Fetch id and name.
    eaClassElement = elmt;
    eaClassId = eaClassElement.GetElementID();
    eaName = eaClassElement.GetName().trim();

    // Register as child of parent package.
    pi.childCI.add(this);

    if (options().isLoadGlobalIdentifiers()) {
      globalIdentifier =
          document.repository.GetProjectInterface().GUIDtoXML(eaClassElement.GetElementGUID());
    }

    // Determine some class flags
    isAbstract = eaClassElement.GetAbstract().equals("1");
    isLeaf = eaClassElement.GetIsLeaf();
    // Determine class category
    if (elmt.GetType().equalsIgnoreCase("enumeration")) category = Options.ENUMERATION;
    else establishCategory();

    // Cache if realisations should not be treated as generalisations
    /*
     * 2015-04-16 JE TBD: 'realisationLikeGeneralisation' should become a
     * general input parameter. Loading of the input model should not depend
     * on a specific target.
     */
    String realization =
        document.options.parameter(Options.TargetXmlSchemaClass, "realisationLikeGeneralisation");
    if (realization != null && realization.equalsIgnoreCase("false")) {
      this.realization = Boolean.FALSE;
    }
  } // ClassInfoEA Ctor