Class DefaultApiRestEntityFactory
java.lang.Object
com.atlassian.confluence.api.impl.DefaultApiRestEntityFactory
- All Implemented Interfaces:
ApiRestEntityFactory
- Since:
- 9.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.confluence.core.ApiRestEntityFactory
ApiRestEntityFactory.SchemaType -
Constructor Summary
ConstructorsConstructorDescriptionDefaultApiRestEntityFactory(ContentFactory contentFactory, SpaceFactory spaceFactory, RestEntityEnrichmentManager restEntityEnrichmentManager) -
Method Summary
Modifier and TypeMethodDescriptionbuildRestEntityFrom(ContentEntityObject entity, Expansions expansions) Build a REST API entity from a ContentEntityObject.buildRestEntityFrom(Space space, Expansions expansions) Build a REST API entity from a hibernate Space object.buildRestEntityFromContent(Iterable<? extends ContentEntityObject> entities, Expansions expansions) Build a list of REST API entity objects from ContentEntityObject objects.buildRestEntityFromSpaces(Iterable<Space> spaces, Expansions expansions) Build a list of REST API entity objects from hibernate Space objects.convertAndEnrich(Object entity, ApiRestEntityFactory.SchemaType schemaType) Converts the given entity into a RestEntity if the entity has the RestEnrichable annotation or is a PageResponse that contains RestEnrichable entities.getEnrichedPropertyTypes(Type type, boolean root) 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 Details
-
DefaultApiRestEntityFactory
public DefaultApiRestEntityFactory(ContentFactory contentFactory, SpaceFactory spaceFactory, RestEntityEnrichmentManager restEntityEnrichmentManager)
-
-
Method Details
-
buildRestEntityFrom
Description copied from interface:ApiRestEntityFactoryBuild a REST API entity from a ContentEntityObject.- Specified by:
buildRestEntityFromin interfaceApiRestEntityFactory- Parameters:
entity- The entity objectexpansions- The expansions to apply to the returned data- Returns:
- The REST API entity
-
buildRestEntityFrom
Description copied from interface:ApiRestEntityFactoryBuild a REST API entity from a hibernate Space object.- Specified by:
buildRestEntityFromin interfaceApiRestEntityFactoryexpansions- The expansions to apply to the returned data- Returns:
- The REST API entity
-
buildRestEntityFromContent
public Iterable<RestEntity> buildRestEntityFromContent(Iterable<? extends ContentEntityObject> entities, Expansions expansions) Description copied from interface:ApiRestEntityFactoryBuild a list of REST API entity objects from ContentEntityObject objects.- Specified by:
buildRestEntityFromContentin interfaceApiRestEntityFactoryexpansions- The expansions to apply to the returned data- Returns:
- The REST API entity list
-
buildRestEntityFromSpaces
public Iterable<RestEntity> buildRestEntityFromSpaces(Iterable<Space> spaces, Expansions expansions) Description copied from interface:ApiRestEntityFactoryBuild a list of REST API entity objects from hibernate Space objects.- Specified by:
buildRestEntityFromSpacesin interfaceApiRestEntityFactoryexpansions- The expansions to apply to the returned data- Returns:
- The REST API entity list
-
isEnrichableList
Description copied from interface:ApiRestEntityFactoryGet whether an object type can be enriched using a RestList.- Specified by:
isEnrichableListin interfaceApiRestEntityFactory
-
isEnrichableEntity
Description copied from interface:ApiRestEntityFactoryGet whether an object type can be enriched using a RestEntity.- Specified by:
isEnrichableEntityin interfaceApiRestEntityFactory
-
getEnrichedPropertyTypes
Description copied from interface:ApiRestEntityFactoryGet 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 interfaceApiRestEntityFactory- Parameters:
type- The type of the object being enriched- Returns:
- A map of property names to property types
-
convertAndEnrich
Description copied from interface:ApiRestEntityFactoryConverts the given entity into a RestEntity if the entity has the RestEnrichable annotation or is a PageResponse that contains RestEnrichable entities.- Specified by:
convertAndEnrichin interfaceApiRestEntityFactory- Parameters:
entity- the entity to enrichschemaType- rest or graphql- Returns:
- a converted rest entity or the entity that was given
-