Package com.thoughtworks.qdox.parser.structs

Examples of com.thoughtworks.qdox.parser.structs.FieldDef


    }

    public void testSimpleField() throws Exception {
        builder.beginClass(new ClassDef());

        FieldDef fld = new FieldDef();
        fld.name = "count";
        fld.type = "int";
        builder.addField(fld);
        builder.endClass();
View Full Code Here


    }

    public void testFieldWithModifiers() throws Exception {
        builder.beginClass(new ClassDef());

        FieldDef fld = new FieldDef();
        fld.modifiers.add("blah");
        fld.modifiers.add("blah2");
        builder.addField(fld);
        builder.endClass();
View Full Code Here

    }

    public void testFieldNoArray() throws Exception {
        builder.beginClass(new ClassDef());

        FieldDef fld = new FieldDef();
        fld.name = "count";
        fld.type = "int";
        fld.dimensions = 0;
        builder.addField(fld);
        builder.endClass();
View Full Code Here

    }

    public void testField1dArray() throws Exception {
        builder.beginClass(new ClassDef());

        FieldDef fld = new FieldDef();
        fld.name = "count";
        fld.type = "int";
        fld.dimensions = 1;
        builder.addField(fld);
        builder.endClass();
View Full Code Here

    }

    public void testField2dArray() throws Exception {
        builder.beginClass(new ClassDef());

        FieldDef fld = new FieldDef();
        fld.name = "count";
        fld.type = "int";
        fld.dimensions = 2;
        builder.addField(fld);
        builder.endClass();
View Full Code Here

    public void testJavaDocOnField() throws Exception {
        builder.beginClass(new ClassDef());

        builder.addJavaDoc("Hello");
        builder.addField(new FieldDef());
        builder.endClass();

        JavaSource source = builder.getSource();

        assertNull(source.getClasses()[0].getComment());
View Full Code Here

    public void testJavaDocOnMethodsAndFields() throws Exception {
        builder.addJavaDoc("Thing");
        builder.beginClass(new ClassDef());

        builder.addField(new FieldDef());// f0

        builder.addJavaDoc("Hello");
        builder.addMethod(new MethodDef());//m0

        builder.addJavaDoc("Hello field");
        builder.addField(new FieldDef());//f1

        builder.addMethod(new MethodDef());//m1

        builder.addJavaDoc("World");
        builder.addMethod(new MethodDef());//m2
View Full Code Here

        builder.addJavaDocTag(new TagDef("food", "is great"));
        builder.addMethod(new MethodDef());

        builder.addJavaDoc("");
        builder.addJavaDocTag(new TagDef("chairs", "are boring"));
        builder.addField(new FieldDef());
        builder.endClass();

        JavaSource source = builder.getSource();

        assertEquals("cheese", source.getClasses()[0].getTags()[0].getName());
View Full Code Here

        MethodDef methodDef = new MethodDef();
        methodDef.name = "hello";
        assertTrue(methodDef.hashCode() > 0);

        FieldDef fieldDef = new FieldDef();
        fieldDef.name = "hello";
        assertTrue(fieldDef.hashCode() > 0);

        JavaParameter javaParameter = new JavaParameter(new Type("q"), "w");
        assertTrue(javaParameter.hashCode() > 0);

    }
View Full Code Here

        // parameters
        {
            JavaParameter[] params = new JavaParameter[def.params.size()];
            int i = 0;
            for (Iterator iterator = def.params.iterator(); iterator.hasNext();) {
                FieldDef fieldDef = (FieldDef) iterator.next();
                params[i++] = new JavaParameter(createType(fieldDef.type, fieldDef.dimensions), fieldDef.name, fieldDef.isVarArgs);
            }
            currentMethod.setParameters(params);
        }
View Full Code Here

TOP

Related Classes of com.thoughtworks.qdox.parser.structs.FieldDef

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.