public class ExtensionLoader extends Object
The vendor extension starting point is defined over an existing API-contract component (e.g. operation). To add your
own extension to that class you create an interface that contains a getter for that property. That method must be
annotated with @AMFProperty, to supply the IRI of that property.
The type of the getter can be a primitive (like String). However, it can also be a mapping. To support mappings you
would return a POJO that has been annotated with @AMFMapping. This POJO will have its constructor called
with the values in the mapping. For this to work each of the constructor parameters must be annotated with @AMFProperty.
These parameters can be mapping as well, and they will be recursively processed.
| Constructor and Description |
|---|
ExtensionLoader(Class<?>... mappingClasses) |
ExtensionLoader(@NotNull List<Class<?>> mappingClasses) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
extend(@NotNull amf.core.client.platform.model.domain.Graph graph,
@NotNull Class<T> extenderInterface)
Enables accessing vendor extensions.
|
@NotNull Object |
loadMapping(@NotNull amf.aml.client.platform.model.domain.DialectDomainElement element)
Loads an AML mapping into an object.
|
public ExtensionLoader(@NotNull
Class<?>... mappingClasses)
@Contract(pure=true)
@NotNull
public <T> T extend(@NotNull
@NotNull amf.core.client.platform.model.domain.Graph graph,
@NotNull
@NotNull Class<T> extenderInterface)
This function returns an instance of the passed interface that allows you to get extension
properties from an AMF graph. The passed interface must have methods annotated with @AMFProperty
to define those properties.
graph - an AMF graph with extension propertiesextenderInterface - an interface with annotated methods@NotNull public @NotNull Object loadMapping(@NotNull @NotNull amf.aml.client.platform.model.domain.DialectDomainElement element)
The mapping class is selected according to the passed element intrinsic type, as defined by its DialectDomainElement.getTypeIris() method.
element - the source elementCopyright © 2023 Mulesoft. All rights reserved.