cuba-platform / documentation

CUBA Platform Documentation
https://www.cuba-platform.com
Creative Commons Attribution 4.0 International
26 stars 45 forks source link

Add example of NamePattern method implementation #629

Closed alexbudarov closed 4 years ago

alexbudarov commented 4 years ago

Environment

Description of the bug or enhancement

Example of NamePattern with method does not show method implementation code. Why shouldn't we add implementation example, showing an idea of forming a non-trivial caption?

For example:

@NamePattern("#getCaption|gender,name")
...

public String getCaption() {
    String prefix = "";
    if (gender == Gender.MALE) {
        prefix = "Mr ";
    } else if (gender == Gender.FEMALE) {
        prefix = "Ms ";
    }
    return prefix + name;
}