@Documented @Target(value={METHOD,FIELD}) @Retention(value=RUNTIME) public @interface Optional
CreoleParameter to mark
parameters that are optional.
@Optional
@CreoleParameter
public void setAnnotationTypes(List<String> types) { ... }
While usually used to mark parameters as optional, this annotation
also supports an optional boolean flag, so it can be used as
@Optional(false) to mark required parameters. This is not
generally necessary, as parameters are required by default, however if a
given parameter has been annotated as @Optional in a superclass
this will be inherited. If you want to change the parameter to be required
in a subclass then you must use @Optional(false).| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
value
Defaults to true but can be set to false to explicitly mark a parameter as
required rather than optional.
|
Copyright © 2024 GATE. All rights reserved.