Package com.yahoo.elide.swagger
Class JsonApiModelResolver
- java.lang.Object
-
- io.swagger.jackson.AbstractModelConverter
-
- io.swagger.jackson.ModelResolver
-
- com.yahoo.elide.swagger.JsonApiModelResolver
-
- All Implemented Interfaces:
io.swagger.converter.ModelConverter
public class JsonApiModelResolver extends io.swagger.jackson.ModelResolverSwagger ModelResolvers map POJO classes to Swagger example.models. This resolver maps the POJO to a JSON-API Resource.
-
-
Constructor Summary
Constructors Constructor Description JsonApiModelResolver(com.yahoo.elide.core.dictionary.EntityDictionary dictionary)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetClassPermissions(com.yahoo.elide.core.type.Type<?> clazz)Get the class-level permission annotation value.protected StringgetCreatePermission(com.yahoo.elide.core.type.Type<?> clazz)Get the calculatedCreatePermissionvalue for the field.protected StringgetDeletePermission(com.yahoo.elide.core.type.Type<?> clazz)Get the calculatedDeletePermissionvalue for the field.protected StringgetFieldPermissions(com.yahoo.elide.core.type.Type<?> clazz, String fieldName)Get the field level permission annotation value.protected StringgetReadPermission(com.yahoo.elide.core.type.Type<?> clazz, String fieldName)Get the calculatedReadPermissionvalue for the field.protected StringgetUpdatePermission(com.yahoo.elide.core.type.Type<?> clazz, String fieldName)Get the calculatedUpdatePermissionvalue for the field.io.swagger.models.Modelresolve(Type type, io.swagger.converter.ModelConverterContext context, Iterator<io.swagger.converter.ModelConverter> next)-
Methods inherited from class io.swagger.jackson.ModelResolver
_addEnumProps, applyBeanValidatorAnnotations, decorateModelName, getInnerType, ignore, objectMapper, resolve, resolveProperty, resolveProperty, shouldIgnoreClass
-
Methods inherited from class io.swagger.jackson.AbstractModelConverter
_description, _findDefaultValue, _findExampleValue, _findReadOnly, _findReadOnlyFromAccessMode, _findTypeName, _isSetType, _subTypeName, _typeName, _typeName, _typeQName, getPropertyComparator, prioritizeAnnotationInspectorSchemaName
-
-
-
-
Method Detail
-
resolve
public io.swagger.models.Model resolve(Type type, io.swagger.converter.ModelConverterContext context, Iterator<io.swagger.converter.ModelConverter> next)
- Specified by:
resolvein interfaceio.swagger.converter.ModelConverter- Overrides:
resolvein classio.swagger.jackson.ModelResolver
-
getClassPermissions
protected String getClassPermissions(com.yahoo.elide.core.type.Type<?> clazz)
Get the class-level permission annotation value.- Parameters:
clazz- the entity class- Returns:
- the create and delete permissions for the entity class.
-
getFieldPermissions
protected String getFieldPermissions(com.yahoo.elide.core.type.Type<?> clazz, String fieldName)
Get the field level permission annotation value.- Parameters:
clazz- the entity classfieldName- the field- Returns:
- read and update permissions for a field.
-
getReadPermission
protected String getReadPermission(com.yahoo.elide.core.type.Type<?> clazz, String fieldName)
Get the calculatedReadPermissionvalue for the field.- Parameters:
clazz- the entity classfieldName- the field- Returns:
- the read permissions for a field
-
getUpdatePermission
protected String getUpdatePermission(com.yahoo.elide.core.type.Type<?> clazz, String fieldName)
Get the calculatedUpdatePermissionvalue for the field.- Parameters:
clazz- the entity classfieldName- the field- Returns:
- the update permissions for a field
-
getCreatePermission
protected String getCreatePermission(com.yahoo.elide.core.type.Type<?> clazz)
Get the calculatedCreatePermissionvalue for the field.- Parameters:
clazz- the entity class- Returns:
- the create permissions for an entity
-
getDeletePermission
protected String getDeletePermission(com.yahoo.elide.core.type.Type<?> clazz)
Get the calculatedDeletePermissionvalue for the field.- Parameters:
clazz- the entity class- Returns:
- the delete permissions for an entity
-
-