Package net.sf.jmd.metarepresentation

Examples of net.sf.jmd.metarepresentation.IModel


    /**
     * <b>The equals method is reflexive:</b> for any reference value x,
     * x.equals(x) should return true.
     */
    public void testEqualsReflexive() {
        IModel x = new Model();
        assertTrue(x.equals(x));
    }
View Full Code Here


    /**
     * <b>The equals method is symmetric:</b> for any reference values x and y,
     * x.equals(y) should return true if and only if y.equals(x) returns true.
     */
    public void testEqualsSymmetric() {
        IModel x = new Model();
        IModel y = new Model();
        assertTrue(x.equals(y) && y.equals(x));
    }
View Full Code Here

     * <b>The equals method is transitive:</b> for any reference values x, y,
     * and z, if x.equals(y) returns true and y.equals(z) returns true, then
     * x.equals(z) should return true.
     */
    public void testEqualsTransivity() {
        IModel x = new Model();
        IModel y = new Model();
        IModel z = new Model();
        //(x=y)&(y=z)=>(x=z) , x=>y is not(x)||y
        assertTrue((!(x.equals(y) && y.equals(z)) || x.equals(z)));
        //more readable
        assertTrue(x.equals(y));
        assertTrue(y.equals(z));
View Full Code Here

    public JavaTransformer() {
    }


    public IModel transform(List<File> modelFileList) throws MoDiException {
        IModel result = new Model();
        IModelItem item = null;

        IParser joda = new JavaParser();
        ITreeWalker luke = new ASTtoMetaRepresentationTransformer();
       
        for (File file : modelFileList) {
            //TODO remove debug
//           LOGGER.info("parsing file: " + file.getAbsolutePath());
            AST ast = joda.getAST(file);// parse the file
            item = luke.walk(ast); // build a ModelItem from the AST
            result.addModelItem(item); // add it to the model
        }
       
        return result;
    }
View Full Code Here

    public boolean equals(Object obj) {

        if (!(obj instanceof Model)) {
            return false;
        }
        IModel other = (IModel) obj;

        boolean result = false;

        boolean typeEquals = this.type.equals(other.getType());
        boolean authorEquals = this.author.equals(other.getAuthor());
        boolean revisionEquals = this.revision.equals(other.getRevision());

        boolean itemsSizeEquals = (this.getItems().size() == other.getItems()
                .size());
        boolean itemsContainsEquals = this.getItems().containsAll(
                other.getItems());
        boolean itemsEquals = (itemsSizeEquals && itemsContainsEquals);

        result = (typeEquals && authorEquals && revisionEquals && itemsEquals);

        return result;
View Full Code Here

    public JavaTransformer() {
    }


    public IModel transform(List<File> modelFileList) throws MoDiException {
        IModel result = new Model();
        IModelItem item = null;

        IParser joda = new JavaParser();
        ITreeWalker luke = new ASTtoMetaRepresentationTransformer();
       
        for (File file : modelFileList) {
            //TODO remove debug
//           LOGGER.info("parsing file: " + file.getAbsolutePath());
            AST ast = joda.getAST(file);// parse the file
            item = luke.walk(ast); // build a ModelItem from the AST
            result.addModelItem(item); // add it to the model
        }
       
        return result;
    }
View Full Code Here

TOP

Related Classes of net.sf.jmd.metarepresentation.IModel

Copyright © 2018 www.massapicom. 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.