Skip to content

Supporting Methods

Andi Huber edited this page Nov 11, 2019 · 1 revision

Intro

Supporting methods provide additional information for domain-object actions or properties:

@Action
Object anAction(X, Y, Z)
                ^
                :
+---------------+
:
+
X default0AnAction(); // provides a default for parameter index=0 (X)

Existing supporting methods (version 1.16.x)

Note
Those returning String also have a variant returning TranslatableString. Those returning Collection<T> also support T[].

For simplicity we only list those for actions. (There are variants for domain-object properties as well, but these are all no-arg supporting methods.)

No-arg supporting methods

@Action
Object anAction(X, Y, Z)

String disableAnAction(); // decides 'edit-ability', returns reason (if any)
@Action
Object anAction(X, Y, Z)

boolean hideAnAction(); // decides rendering visibility
@Action
Object anAction(X, Y, Z)
                ^
                :
     +----------+
     :  Choices
     +
Collection<X> choices0AnAction(); // provides choices for parameter index=0 (X)
@Action
Object anAction(X, Y, Z)
                ^
                :
+---------------+
:
+
X default0AnAction(); // provides a default for parameter index=0 (X)

Single-arg supporting methods

@Action
Object anAction(X, Y, Z)
                +
                :
                +--------+
                         :
                         +
String validate0AnAction(X); // returns validation-failure (if any) for parameter index=0 (X)
@Action
Object anAction(X, Y, Z)
                ^
                :
     +----------+
     :  Choices
     +
Collection<X> autoComplete0AnAction(String search); // provides 'narrowed' choices for parameter index=0 (X)

Multi-arg supporting methods

choices (dependent)

@Action
Object anAction(X, Y, Z)
                ^  +  +
                :  :  :
     +----------+  +--+--------+--+
     :  Choices                :  :
     +                         +  +
Collection<X> choices0AnAction(Y, Z); // provides dependent choices for parameter index=0 (X)

validate (all args)

@Action
Object anAction(X, Y, Z)
                +  +  +
                :  :  :
                +--+--+-+--+--+
                        :  :  :
                        +  +  +
String validateAnAction(X, Y, Z); // returns validation-failure (if any)