Package com.pogofish.jadt.ast

Examples of com.pogofish.jadt.ast.Constructor


    /**
     * If a factory has no args but does have type parameters it should be a constant with some warning suppression
     */
    @Test
    public void testNoArgTypesFactory() {
        final Constructor constructor = new Constructor(NO_COMMENTS, "Whatever", Util.<Arg>list());
        final StringSink sink = new StringSink("test");
        try {
            emitter.constructorFactory(sink, "SomeDataType", "SomeFactory", list("A", "B"), constructor);
        } finally {
            sink.close();           
View Full Code Here


    /**
     * If a factory has args but not types then it must be a simple method
     */
    @Test
    public void testArgsNoTypesFactory() {
        final Constructor constructor = new Constructor(NO_COMMENTS, "Foo", list(
                                new Arg(Util.<ArgModifier>list(), _Ref(_ClassType("Integer", Util.<RefType>list())), "yeah"),
                                new Arg(Util.<ArgModifier>list(), _Ref(_ClassType("String", Util.<RefType>list())), "hmmm")
                        ));
       
        final StringSink sink = new StringSink("test");
View Full Code Here

    /**
     * If a factory has args and types then it must be a slightly more complicated method
     */
    @Test
    public void testArgsTypesFactory() {
        final Constructor constructor = new Constructor(NO_COMMENTS, "Foo", list(
                                new Arg(Util.<ArgModifier>list(), _Ref(_ClassType("Integer", Util.<RefType>list())), "yeah"),
                                new Arg(Util.<ArgModifier>list(), _Ref(_ClassType("String", Util.<RefType>list())), "hmmm")
                        ));
       
        final StringSink sink = new StringSink("test");
View Full Code Here

    /**
     * How does the Java class constructor look?
     */
    @Test
    public void testConstructorMethod() {
        final Constructor constructor = new Constructor(list(_JavaDocComment("/**", list(_JDEOL("\n")), list(_JDTagSection("@param", list(_JDWhiteSpace(" "), _JDAsterisk(), _JDWhiteSpace(" "), _JDTag("@param"), _JDWhiteSpace(" "), _JDWord("um"), _JDWhiteSpace(" "), _JDWord("this is the um"), _JDEOL("\n"), _JDWhiteSpace(" ")))), "*/")), "Foo",
                list(new Arg(Util.<ArgModifier>list(), _Ref(_ClassType("String", Util.<RefType> list())), "um"), new Arg(Util.list(_Final(), _Transient(), _Volatile()), _Primitive(_IntType()),
                        "yeah")));

        final StringSink sink = new StringSink("test");
        try {
View Full Code Here

    /**
     * toString with no args
     */
    @Test
    public void testNoArgToString() {
        final Constructor constructor = new Constructor(NO_COMMENTS, "Whatever", Util.<Arg>list());
       
        final StringSink sink = new StringSink("test");
        try {
           
            emitter.emitToString(sink, "    ", constructor);
View Full Code Here

    /**
     * toString with one arg
     */
    @Test
    public void testOneArgToString() {
        final Constructor constructor = new Constructor(NO_COMMENTS, "Foo", list(
                new Arg(Util.<ArgModifier>list(), _Ref(_ClassType("Integer", Util.<RefType>list())), "um")
        ));
       
        final StringSink sink = new StringSink("test");
        try {
View Full Code Here

    /**
     * toString with multiple args
     */
    @Test
    public void testArgsToString() {
        final Constructor constructor = new Constructor(NO_COMMENTS, "Foo", list(
                new Arg(Util.<ArgModifier>list(), _Ref(_ClassType("Integer", Util.<RefType>list())), "um"),
                new Arg(Util.<ArgModifier>list(), _Ref(_ClassType("String", Util.<RefType>list())), "yeah")
        ));
       
        final StringSink sink = new StringSink("test");
View Full Code Here

    /**
     * equals with no args
     */
    @Test
    public void testNoArgsNoTypesEquals() {
        final Constructor constructor = new Constructor(NO_COMMENTS, "Whatever", Util.<Arg>list());
       
        final StringSink sink = new StringSink("test");
        try {
           
            emitter.emitEquals(sink, "    ", constructor, Util.<String>list());
View Full Code Here

    /**
     * equals with args and no types
     */
    @Test
    public void testArgsNoTypesEquals() {
        final Constructor constructor = new Constructor(NO_COMMENTS, "Foo", list(
                new Arg(Util.<ArgModifier>list(), _Primitive(_IntType()), "um"),
                new Arg(Util.<ArgModifier>list(), _Ref(_ClassType("String", Util.<RefType>list())), "yeah"),
                new Arg(Util.<ArgModifier>list(), _Ref(_ArrayType(_Primitive(_IntType()))), "oh")
        ));
       
View Full Code Here

    /**
     * equals with args and types
     */
    @Test
    public void testArgsTypesEquals() {
        final Constructor constructor = new Constructor(NO_COMMENTS, "Foo", list(
                new Arg(Util.<ArgModifier>list(), _Primitive(_IntType()), "um"),
                new Arg(Util.<ArgModifier>list(), _Ref(_ClassType("String", Util.<RefType>list())), "yeah"),
                new Arg(Util.<ArgModifier>list(), _Ref(_ArrayType(_Primitive(_IntType()))), "oh")
        ));
       
View Full Code Here

TOP

Related Classes of com.pogofish.jadt.ast.Constructor

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.