Examples of MethodDef


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

        assertEquals("String", result.getParameters()[1].getType().getValue());
    }

    public void testMethodParametersWithArrays() throws Exception {
        builder.beginClass(new ClassDef());
        MethodDef mth = new MethodDef();

        FieldDef f1 = new FieldDef();
        f1.name = "count";
        f1.type = "int";
        f1.modifiers.add("final");
View Full Code Here

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

        assertEquals(2, result.getParameters()[1].getType().getDimensions());
    }

    public void testMethodExceptions() throws Exception {
        builder.beginClass(new ClassDef());
        MethodDef mth = new MethodDef();

        mth.exceptions.add("RuntimeException");
        mth.exceptions.add("java.io.IOException");

        builder.addMethod(mth);
View Full Code Here

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

        assertEquals("java.io.IOException", result.getExceptions()[1].getValue());
    }

    public void testMethodModifiers() throws Exception {
        builder.beginClass(new ClassDef());
        MethodDef mth = new MethodDef();

        mth.modifiers.add("public");
        mth.modifiers.add("final");
        mth.modifiers.add("synchronized");
View Full Code Here

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

    }

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

        MethodDef mth = new MethodDef();
        mth.name = "MyClass";
        mth.constructor = true;
        builder.addMethod(mth);

        MethodDef mth2 = new MethodDef();
        mth2.name = "method";
        mth2.returns = "void";
        builder.addMethod(mth2);
        builder.endClass();
View Full Code Here

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

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

        builder.addJavaDoc("Hello");
        builder.addMethod(new MethodDef());
        builder.endClass();

        JavaSource source = builder.getSource();

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

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

        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

        builder.endClass();

        JavaSource source = builder.getSource();
View Full Code Here

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

        builder.addJavaDocTag(new TagDef("cheese", "is good"));
        builder.beginClass(new ClassDef());

        builder.addJavaDoc("");
        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();
View Full Code Here

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

        ClassDef classDef = new ClassDef();
        classDef.name = "hello";
        assertTrue(classDef.hashCode() > 0);

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

        FieldDef fieldDef = new FieldDef();
        fieldDef.name = "hello";
        assertTrue(fieldDef.hashCode() > 0);
View Full Code Here

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

        setupLex(Parser.BRACECLOSE);
        setupLex(0);

        // expectations
        MethodDef mth = new MethodDef();
        mth.name = "doStuff";
        mth.returns = "void";
        FieldDef p1 = new FieldDef();
        p1.name = "stuff";
        p1.type = "int";
View Full Code Here

Examples of oracle.adf.model.adapter.dataformat.MethodDef

            TypeMapper typeMapper = defNode.getProviderInstance(TypeMapper.class);
            MovableStructureDefinition structDef =
                structProv.buildStructure(rootDataNode, getReturnStructName(rootStruct, defNode), typeMapper);

            // create MethodDef with StructureDef from StructureProvider as return value
            final MethodDef method = new MethodDef(defNode.getDatacontrolOperation(), rootStruct);
            rootStruct.addMethod(method);

            // add parameters to method-definition if data provider has dynamic parameters
            {
                final Set<DynamicParameter> dynamicParams = defNode.getDynamicParams();
                if (dynamicParams != null) {
                    for (DynamicParameter dynpar : dynamicParams) {
                        method.addParameter(dynpar.getName(), dynpar.getJavaType());
                    }
                }
            }

            // link StructureDef to MethodDef using a MethodReturnDef
            final MethodReturnDef methodReturn =
                new MethodReturnDef(rootDataNode.getName(), structDef, method, COLLECTION_FALSE,
                                    SCALAR_COLLECTION_FALSE);
            structDef.setParent(methodReturn);
            method.setReturnType(methodReturn);

            // apply customizations to the structure
            CustomizationProvider custProv = defNode.getProviderInstance(CustomizationProvider.class);
            if (custProv != null) {
                new Customizer(custProv).customize(method);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.