Class DefaultRestEntityEnrichmentManager
- java.lang.Object
-
- com.atlassian.confluence.plugins.restapi.enrich.DefaultRestEntityEnrichmentManager
-
- All Implemented Interfaces:
RestEntityEnrichmentManager
@Internal @Component("restEntityEnrichmentManager") public class DefaultRestEntityEnrichmentManager extends Object implements RestEntityEnrichmentManager- Since:
- 6.12.0
-
-
Constructor Summary
Constructors Constructor Description DefaultRestEntityEnrichmentManager(RestNavigationService navBuilderService, GraphQL graphql, DefaultRestEntityFactory restEntityFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectconvertAndEnrich(Object entity, SchemaType schemaType)Converts the given entity into a RestEntity if the entity has the RestEnrichable annotation or is a PageResponse that contains RestEnrichable entities.@NonNull Map<String,Type>getEnrichedPropertyTypes(Type type, boolean isRoot)Get the types of the properties that may possibly be provided by the enrichers.booleanisEnrichableEntity(Class entityType)Get whether an object type can be enriched using a RestEntity.booleanisEnrichableList(Class listType)Get whether an object type can be enriched using a RestList.
-
-
-
Constructor Detail
-
DefaultRestEntityEnrichmentManager
@Autowired public DefaultRestEntityEnrichmentManager(RestNavigationService navBuilderService, GraphQL graphql, DefaultRestEntityFactory restEntityFactory)
-
-
Method Detail
-
isEnrichableList
public boolean isEnrichableList(Class listType)
Description copied from interface:RestEntityEnrichmentManagerGet whether an object type can be enriched using a RestList.- Specified by:
isEnrichableListin interfaceRestEntityEnrichmentManager
-
isEnrichableEntity
public boolean isEnrichableEntity(Class entityType)
Description copied from interface:RestEntityEnrichmentManagerGet whether an object type can be enriched using a RestEntity.- Specified by:
isEnrichableEntityin interfaceRestEntityEnrichmentManager
-
getEnrichedPropertyTypes
public @NonNull Map<String,Type> getEnrichedPropertyTypes(Type type, boolean isRoot)
Description copied from interface:RestEntityEnrichmentManagerGet the types of the properties that may possibly be provided by the enrichers. This is used to populate the graph-ql schema.- Specified by:
getEnrichedPropertyTypesin interfaceRestEntityEnrichmentManager- Parameters:
type- The type of the object being enriched- Returns:
- A map of property names to property types
-
convertAndEnrich
public Object convertAndEnrich(Object entity, SchemaType schemaType)
Description copied from interface:RestEntityEnrichmentManagerConverts the given entity into a RestEntity if the entity has the RestEnrichable annotation or is a PageResponse that contains RestEnrichable entities.- Specified by:
convertAndEnrichin interfaceRestEntityEnrichmentManager- Parameters:
entity- the entity to enrichschemaType- rest or graphql- Returns:
- a converted rest entity or the entity that was given
-
-