Annotation Type ApiModel
Registers a model with the Api Framework. This is the starting point for further processing. This binds either a sling:resourceType
or some programmatically mapped Pojo to a resource in Sling.
- See Also:
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe default media type to use to find a HypermediaConverter to serialize the model.booleanMark this as the default model for the category.Class<?> Use this to signal to the framework to managed this object via a different interface.Class<? extends ModelLookup> If a Pojo can't be simply bound to a sling resource type or no resource types exist for the resource then pass this lookup class back and programmatically return the Pojos to use.The sling:resourcetype to bind this Model to.String[]Returns a list of classes that will be used when Siren serializes this Pojo to JS.
-
Element Details
-
resourceType
String resourceTypeThe sling:resourcetype to bind this Model to. This does not use isA to determine hierarchy for now it only matches on the string value.- Returns:
- the resource type to bind to
- Default:
""
-
category
String categoryThe category this API belongs to is the first token in the URL after the api root. This allows different Pojos to represent the same resource types differently based on context.- Returns:
- the category this belongs in
-
type
String[] typeReturns a list of classes that will be used when Siren serializes this Pojo to JS.- Returns:
- array of strings for the class of this object
- Default:
{"default"}
-
modelLookup
Class<? extends ModelLookup> modelLookupIf a Pojo can't be simply bound to a sling resource type or no resource types exist for the resource then pass this lookup class back and programmatically return the Pojos to use.- Returns:
- class that will manage the lookups for this model
- Default:
com.adobe.granite.haf.apimodel.impl.NullModelLookup.class
-
defaultConverterMediaType
String defaultConverterMediaTypeThe default media type to use to find a HypermediaConverter to serialize the model. This will be used if the accepts header in the request doesn't request a specific media type that can be satisfied by one of the registered converters in the system.- Returns:
- The media type used to look up the HypermediaConverter to use as a default.
- Default:
""
-
isDefault
boolean isDefaultMark this as the default model for the category. If no model is found in the resource type registration or in the model lookup calls a model with this attribute set to true will be used. Only one default model is allowed per category.- Returns:
- if the model is the default
- Default:
false
-
modelClass
Class<?> modelClassUse this to signal to the framework to managed this object via a different interface. This is especially useful if this model also uses SlingModels. This value should track one of the adapters registrations.- Returns:
- the model class
- Default:
java.lang.Object.class
-