Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对#for指令的增强建议 #55

Closed
yingzhuo opened this issue Dec 17, 2013 · 1 comment
Closed

对#for指令的增强建议 #55

yingzhuo opened this issue Dec 17, 2013 · 1 comment
Assignees
Milestone

Comments

@yingzhuo
Copy link

#for (Domain domain : domains)
    ${for.index}
#end

除了index之外,请添加${for.isFirst} 与 ${for.isLast}

另外,建议#for 指令支持 enum 类型 参考

public enum Gender {

    MALE,

    FEMALE;

    public static void main(String[] args) {
        Gender[] array = Gender.values();
        for (Gender g : array) {
            System.out.println(g);
        }
    }
}
@ghost ghost assigned subchen Dec 17, 2013
@subchen
Copy link
Owner

subchen commented Dec 17, 2013

重写了 #for 指令的代码生成规则。
顺便把 ${for.size} 也加上了

#for (String x : ["a","b","c","d"])
    ${for.index}
    ${for.size}
    ${for.first}
    ${for.last}
    ${x}
#end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants