@Retention(value=RUNTIME) @Target(value=TYPE) public @interface Config
The methods of the interface annotated with Attribute
form the schema of the service,
which will be used by SMS to automatically generate REST endpoints for manipulating the service.
All methods MUST be annotated with Attribute
, Id
, SubConfig
or have a default implementation.
The schema created for a particular annotated method is controlled by a TypeAdapter
. The
adapter for a method is chosen as follows:
TypeAdapter
, it is used.TypeAdapter
is inferred from the return type of the method.
Interfaces annotated with this annotation should be registered with the AnnotatedServiceRegistry
. The
registry can then be used to obtain concrete implementations of the interface.
Example:
@Config(scope = GLOBAL)
interface MyGlobalServiceConfig {
@Attribute(order = 100)
String myAttribute();
@Attribute(order = 300)
default int myDefaultedAttribute() {
return 5;
}
@Attribute(order = 200)
@MyType
CustomType anotherAttribute();
}
Attribute
Copyright © 2010-2018, ForgeRock All Rights Reserved.