astah-professional-6.8.zip


astah-professional-6.8.zip
资源截图
代码片段和文件信息
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.change_vision.jude.api.inf.exception.LicenseNotFoundException;
import com.change_vision.jude.api.inf.exception.NonCompatibleException;
import com.change_vision.jude.api.inf.exception.ProjectLockedException;
import com.change_vision.jude.api.inf.exception.ProjectNotFoundException;
import com.change_vision.jude.api.inf.model.IAttribute;
import com.change_vision.jude.api.inf.model.IClass;
import com.change_vision.jude.api.inf.model.IConstraint;
import com.change_vision.jude.api.inf.model.IElement;
import com.change_vision.jude.api.inf.model.IGeneralization;
import com.change_vision.jude.api.inf.model.IModel;
import com.change_vision.jude.api.inf.model.INamedElement;
import com.change_vision.jude.api.inf.model.IOperation;
import com.change_vision.jude.api.inf.model.IPackage;
import com.change_vision.jude.api.inf.model.IParameter;
import com.change_vision.jude.api.inf.model.IRealization;
import com.change_vision.jude.api.inf.project.ProjectAccessor;
import com.change_vision.jude.api.inf.AstahAPI;

/**
 * Class to build class definition from selected project.
 */
public class ClassDefinitionBuilder {

    private static final String EMPTY_COLUMN = ““;

    private String inputFile;
    
    /**
     * @param inputFile
     *            File to input
     */
    public ClassDefinitionBuilder(String inputFile) {
        this.inputFile = inputFile;
    }

    /**
     * Get class information.
     * 
     * @return Class information (String List stored in the List)
     * @throws LicenseNotFoundException
     *             License cannot be found 
     * @throws ProjectNotFoundException
     *             Project cannot be found
     * @throws NonCompatibleException
     *             Old Model Version (The version of API is older than the version of Astah that the project has been last edited with)
     * @throws ClassNotFoundException
     *             Cannot read some models
     * @throws IOException
     *             Input/Output error
     * @throws ProjectLockedException
     *             Project file has been locked
     */
    public List getContents() throws LicenseNotFoundException ProjectNotFoundException
            NonCompatibleException IOException ClassNotFoundException ProjectLockedException Throwable {

     // Open a project. And get the model.
        ProjectAccessor prjAccessor = AstahAPI.getAstahAPI().getProjectAccessor();
        prjAccessor.open(inputFile);
        IModel iModel = prjAccessor.getProject();

        List contents = new ArrayList();
        contents.add(getHeader());

        // get all packages of the project.
        List iPackages = getAllPackages(iModel);

        // build the information for each package.
        for (Iterator iter = iPackages.iterator(); iter.hasNext();) {
            IPackage iPackage = (IPackage)iter.next();
            contents.addAll(getClassInfos(iPackage));
      

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-12-12 17:28  __MACOSX
     文件         171  2015-12-12 17:22  __MACOSX._astah使用说明.txt
     目录           0  2015-12-12 17:28  __MACOSXastah_professional
     文件         171  2015-12-12 17:22  __MACOSXastah_professional._astah使用说明.txt
     目录           0  2015-07-26 15:22  astah_professional
     文件        1978  2014-01-14 20:34  astah_professionalAstah_API_sample_program_license_agreement.txt
     文件        1666  2014-01-14 20:34  astah_professionalAstah_API_sample_program_license_agreement_ja.txt
     文件        5192  2014-01-14 20:34  astah_professionalCommandRunner.html
     文件        5518  2014-01-14 20:34  astah_professionalCommandRunner_ja.html
     文件        5943  2015-07-17 11:14  astah_professionalFlowchart0.asta
     文件     7738275  2014-01-14 20:34  astah_professionalReferenceManual-astah-UML_professional.pdf
     文件     7599262  2014-01-14 20:34  astah_professionalReferenceManual-astah-UML_professional_ja.pdf
     文件      118208  2014-01-14 20:39  astah_professionalSample.asta
     文件       45480  2014-01-14 20:39  astah_professionalWelcome.asta
     文件       45976  2014-01-14 20:39  astah_professionalWelcome_ja.asta
     目录           0  2015-04-22 17:55  astah_professionalapi
     目录           0  2015-04-22 17:55  astah_professionalapien
     目录           0  2015-04-22 17:55  astah_professionalapiendoc
     文件         592  2014-01-14 20:34  astah_professionalapiendocapi_search.html
     文件      322431  2014-01-14 20:34  astah_professionalapiendocastahAPI.asta
     文件        5292  2014-01-14 20:34  astah_professionalapiendocastahAPI_create.html
     文件        3938  2014-01-14 20:34  astah_professionalapiendocastahAPI_diagram_create.html
     文件       13188  2014-01-14 20:34  astah_professionalapiendocastahAPI_diagram_editor_outline.html
     文件        1206  2014-01-14 20:34  astah_professionalapiendocastahAPI_easy_merge.html
     文件        2048  2014-01-14 20:34  astah_professionalapiendocastahAPI_edit.html
     文件       22240  2014-01-14 20:34  astah_professionalapiendocastahAPI_language.html
     文件       14901  2014-01-14 20:34  astah_professionalapiendocastahAPI_models.html
     文件       27490  2014-01-14 20:34  astah_professionalapiendocastahAPI_presentation_create.html
     文件        4411  2014-01-14 20:34  astah_professionalapiendocastahAPI_presentation_edit.html
     文件       21072  2014-01-14 20:34  astah_professionalapiendocastahAPI_presentation_outline.html
     文件        1278  2014-01-14 20:34  astah_professionalapiendocastahAPI_presentation_reference.html
............此处省略1329个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)