Package net.sf.jmd.metarepresentation.impl

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


     * @see junit.framework.TestCase#setUp()
     */
    protected void setUp() throws Exception {
        super.setUp();
        //an AM with an interface and a member in it
        voidTypeAM = new ModelItem();
        voidTypeAM.setName("void");
       
        amModelItem = new ModelItem();
        amModelItem.setType("interface");
        amModelItem.setName("AnInterface");
        amModelItem.addMember(amMember);
       
        amMember = new Operation();
        amMember.addModifier("public");
        amMember.addModifier("static");
        amMember.setType(voidTypeAM);
        amMember.setName("aMember");
        amMember.setNamespace(amModelItem.getIdentifier());

        architectsModel = new Model();
        architectsModel.setType(Model.Type.AM);
        architectsModel.addModelItem(amModelItem);

       
        //the DM with an interface and a member
        voidTypeDM = new ModelItem();
        voidTypeDM.setName("void");
       
        dmModelItem = new ModelItem();
        dmModelItem.setType("interface");
        dmModelItem.setName("AnInterface");
        dmModelItem.addMember(dmMember);

        dmMember = new Operation();
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() {
        ModelItem x = new ModelItem();
        ModelItem y = new ModelItem();
        ModelItem z = new ModelItem();
        assertTrue(x.equals(y) && y.equals(z) && x.equals(z));
    }
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

               
    }
   
    private void setUpAM() {
       
        amInterface = new ModelItem();
        amInterface.setName("AnInterface");
        amInterface.setType("interface");
       
        IMember amMethod =  new Operation();
        amMethod.setName("myMethod");
View Full Code Here

   
    private void setUpDM() {
        List<String> modifiers = new ArrayList<String>();
        modifiers.add("public");
        //set up an interface
        dmInterface = new ModelItem();
        dmInterface.setName("AnInterface");
        dmInterface.setType("interface");
       
        IMember dmMethod =  new Operation();
        dmMethod.setName("myMethod");
        dmInterface.addMember(dmMethod);
       
        //set up a implementing class
        dmClass = new ModelItem();
        dmClass.setName("MyClass");
        dmClass.setType("class");
        dmClass.addExtendee(dmInterface);//MyClass implements AnInterface
       
        IMember dmClassMethod =  new Operation();
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();

        // an AM with an interface and a member in it
        // member: "public void aMember();"
        voidTypeAM = new ModelItem();
        voidTypeAM.setName("void");
       
        amModelItem = new ModelItem();
        amModelItem.setType("interface");
        amModelItem.setName("AnInterface");

        amMember = new Operation();
        amMember.addModifier("public");
        amMember.setType(voidTypeAM);
        amMember.setNamespace(amModelItem.getIdentifier());
        amMember.setName("aMember");

        amModelItem.addMember(amMember);

        // the DM with an interface and a member
        voidTypeDM = new ModelItem();
        voidTypeDM.setName("void");
       
        dmModelItem = new ModelItem();
        dmModelItem.setType("interface");
        dmModelItem.setName("AnInterface");

        dmMember = new Operation();
        dmMember.addModifier("public");
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.