Package net.sf.jmd.metarepresentation.impl

Examples of net.sf.jmd.metarepresentation.impl.ModelItem


        architectsModel.setType(Model.Type.AM);
       
        developersModel = new Model();
        developersModel.setType(Model.Type.DM);
       
        dmModelItem = new ModelItem();
        dmModelItem.setType("interface");
        dmModelItem.setName("AddedInterface");

        developersModel.addModelItem(dmModelItem);
       
View Full Code Here


        model = new Model();
        other = new Model();
    }

    public void setUp() {
        IModelItem item = new ModelItem();
        item.setName("anItem");
        item.setNamespace("de.dlr.modi");
        item.setType("interface");
       
        Operation operation = new Operation();
        operation.setName("anOperation");
        operation.setNamespace(item.getIdentifier());
       
        Parameter parameter = new Parameter();
        parameter.setName("aParameter");
        parameter.setNamespace(operation.getIdentifier());
       
        operation.addParameter(parameter);
       
        Variable variable = new Variable();
        variable.setName("aVariable");
        variable.setNamespace(item.getIdentifier());

        item.addMember(operation);
        item.addMember(variable);
       
        //these two models are equal
        model.addModelItem(item);
        other.addModelItem(item);
    }
View Full Code Here

    }
   
    public void testAddModelItem(){
        IModel newModel = new Model();
        assertTrue(newModel.getItems().isEmpty());
        ModelItem newItem = new ModelItem();
        newModel.addModelItem(newItem);
        assertTrue(newModel.getItems().contains(newItem));
    }
View Full Code Here

        other.setRevision("r123");
        assertTrue(model.equals(other));

        //items
        assertTrue(model.equals(other));
        ModelItem newItem = new ModelItem();
        newItem.setName("anIdentifier");
        newItem.setType("interface");
       
        Operation operation = new Operation();
        operation.setName("voidFoo");
        operation.setNamespace(newItem.getIdentifier());
        newItem.addMember(operation);
       
        model.addModelItem(newItem);
        assertFalse(model.equals(other));
       
        other.addModelItem(newItem);
View Full Code Here

   
    public void testEqualsAfterInterfaceAdded() {
        assertEquals(model, other);
       
        ModelItem amItem = new ModelItem();
        amItem.setName("anotherInterface");
        amItem.setType("interface");
       
        Operation amOperation = new Operation();
        amOperation.setName("anotherMethod");
        amOperation.setNamespace(amItem.getIdentifier());
       
        Parameter amParameter = new Parameter();
        amParameter.setName("aParameter");
        amParameter.setNamespace(amOperation.getIdentifier());
       
        amOperation.addParameter(amParameter);
        amItem.addMember(amOperation);
        model.addModelItem(amItem);
       
        assertFalse(model.equals(other));
       
        ModelItem dmItem = new ModelItem();
        dmItem.setName("anotherInterface");
        dmItem.setType("interface");
       
        Operation dmOperation = new Operation();
        dmOperation.setName("anotherMethod");
        dmOperation.setNamespace(dmItem.getIdentifier());
       
        Parameter dmParameter = new Parameter();
        dmParameter.setName("aParameter");
        dmParameter.setNamespace(dmOperation.getIdentifier());
       
        dmOperation.addParameter(dmParameter);
        dmItem.addMember(dmOperation);
        other.addModelItem(dmItem);
       
        assertTrue(model.equals(other));
       
        //now the developer adds a parameter to the method:
View Full Code Here

    public ASTtoMetaRepresentationTransformer() {
    }

    public IModelItem walk(AST ast) {
        modelItem = new ModelItem();

        walkDepthFirst(ast);// walk the tree and fill the modelItem

        return modelItem;
    }
View Full Code Here

            int type = tmp.getType();
            switch (type) { // switch over the interesting types, ignoring the
            // rest.

            case GeneratedJavaTokenTypes.IDENT:
                IModelItem superclass = new ModelItem();
                superclass.setName(tmp.getText());
                modelItem.addExtendee(superclass);
                break;

            default:
                break;
View Full Code Here

            case GeneratedJavaTokenTypes.MODIFIERS:
                memberVariable.setModifiers(getLeafs(tmp));
                break;

            case GeneratedJavaTokenTypes.TYPE:
                ModelItem variableType = new ModelItem();
                String variableTypeIdentifier = tmp.getFirstChild().getText();
                variableType.setName(variableTypeIdentifier);
                memberVariable.setType(variableType);
                break;

            case GeneratedJavaTokenTypes.IDENT:
                String identifier = modelItem.getIdentifier() + "."
View Full Code Here

            case GeneratedJavaTokenTypes.MODIFIERS:
                memberOperation.setModifiers(getLeafs(tmp));
                break;

            case GeneratedJavaTokenTypes.TYPE:
                ModelItem operationType = new ModelItem();
                String operationTypeIdentifier = tmp.getFirstChild().getText();
                operationType.setName(operationTypeIdentifier);
                memberOperation.setType(operationType);
                break;

            case GeneratedJavaTokenTypes.IDENT:
                memberOperation.setNamespace(modelItem.getIdentifier());
View Full Code Here

            case GeneratedJavaTokenTypes.MODIFIERS:
                // TODO do we need something here?
                break;

            case GeneratedJavaTokenTypes.TYPE:
                ModelItem parameterType = new ModelItem();
                String parameterTypeIdentifier = tmp.getFirstChild().getText();
                // String parameterTypeIdentifer = getNodeTextForType(tmp,
                // GeneratedJavaTokenTypes.IDENT);
                parameterType.setName(parameterTypeIdentifier);
                parameter.setType(parameterType);
                break;

            case GeneratedJavaTokenTypes.IDENT:
                String identifier = tmp.getText();
View Full Code Here

TOP

Related Classes of net.sf.jmd.metarepresentation.impl.ModelItem

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.