Interface Marshaller<EntityType>

Type Parameters:
EntityType - The managed Java type.
All Known Subinterfaces:
Reader<EntityType>, Writer<EntityType>
All Known Implementing Classes:
AbstractCSVWriter, AbstractJsonEnricher, AbstractJsonReader, AbstractJsonWriter, AbstractLayoutJsonWriter, ACLJsonEnricher, ACPJsonWriter, AggregateJsonWriter, AnnotationJsonReader, AnnotationJsonWriter, AnnotationListJsonReader, AnnotationListJsonWriter, AuditJsonEnricher, AuthenticationTokenListWriter, AuthenticationTokenWriter, BasePermissionsJsonEnricher, BinaryManagerStatusJsonWriter, BlobAppLinksJsonEnricher, BlobJsonReader, BlobPreviewJsonEnricher, BreadcrumbJsonEnricher, BulkCommandJsonReader, BulkCommandJsonWriter, BulkStatusJsonReader, BulkStatusJsonWriter, CapabilitiesJsonWriter, ChildrenJsonEnricher, CollectionsJsonEnricher, CommentJsonReader, CommentJsonWriter, CommentListJsonReader, CommentListJsonWriter, ConfigurationPropertiesJsonWriter, ConstraintJsonWriter, ConstraintListJsonWriter, ContextualParametersJsonEnricher, DefaultListJsonReader, DefaultListJsonWriter, DirectoryEntryJsonReader, DirectoryEntryJsonWriter, DirectoryEntryListJsonReader, DirectoryEntryListJsonWriter, DirectoryJsonWriter, DirectoryListJsonWriter, DocumentModelCSVWriter, DocumentModelJsonReader, DocumentModelJsonWriter, DocumentModelListCSVWriter, DocumentModelListJsonReader, DocumentModelListJsonWriter, DocumentPropertiesJsonReader, DocumentPropertyCSVWriter, DocumentPropertyJsonWriter, DocumentRouteListWriter, DocumentRouteWriter, DocumentTypeJsonWriter, DocumentTypeListJsonWriter, DocumentUrlJsonEnricher, DocumentValidationReportJsonWriter, EntityJsonReader, ExtensibleEntityJsonWriter, FacetJsonWriter, FacetListJsonWriter, FavoritesJsonEnricher, FieldDefinitionJsonWriter, FirstAccessibleAncestorJsonEnricher, GraphRouteWriter, HasContentJsonEnricher, HasFolderishChildJsonEnricher, HighlightJsonEnricher, LayoutDefinitionJsonWriter, LayoutDefinitionsJsonWriter, LayoutJsonWriter, LayoutTypeConfigurationJsonWriter, LayoutTypeDefinitionJsonWriter, LayoutTypeDefinitionsJsonWriter, LogEntryCSVWriter, LogEntryJsonWriter, LogEntryListCSVWriter, LogEntryListJsonWriter, MigrationJsonWriter, MigrationListJsonWriter, NotificationsJsonEnricher, NuxeoGroupJsonReader, NuxeoGroupJsonWriter, NuxeoGroupListJsonReader, NuxeoGroupListJsonWriter, NuxeoOAuth2ServiceProviderListWriter, NuxeoOAuth2ServiceProviderReader, NuxeoOAuth2ServiceProviderWriter, NuxeoOAuth2TokenListWriter, NuxeoOAuth2TokenReader, NuxeoOAuth2TokenWriter, NuxeoPrincipalJsonReader, NuxeoPrincipalJsonWriter, NuxeoPrincipalListJsonReader, NuxeoPrincipalListJsonWriter, OAuth2ClientListWriter, OAuth2ClientReader, OAuth2ClientWriter, PendingTasksJsonEnricher, PreviewJsonEnricher, ProbeInfoJsonWriter, ProbeInfoListJsonWriter, ProbeStatusJsonWriter, PublicationJsonEnricher, RenderingInfoJsonWriter, RenditionJsonEnricher, RunnableWorkflowJsonEnricher, RunningWorkflowJsonEnricher, SavedSearchListReader, SavedSearchListWriter, SavedSearchRequestReader, SavedSearchWriter, ScheduleJsonWriter, ScheduleListJsonWriter, SchemaJsonWriter, SchemaListJsonWriter, ScimResourceReader, ScimResourceWriter, SequencerJsonWriter, SequencerListJsonWriter, SimplifiedServerInfoJsonWriter, SubtypesJsonEnricher, SubtypesJsonEnricher, TagsJsonEnricher, TaskCompletionRequestJsonReader, TaskListWriter, TaskWriter, ThumbnailJsonEnricher, UserProfileEnricher, UserVisiblePermissionsJsonEnricher, WidgetDefinitionJsonWriter, WidgetReferenceJsonWriter, WidgetSelectOptionJsonWriter, WidgetTypeConfigurationJsonWriter, WidgetTypeDefinitionJsonWriter, WidgetTypeDefinitionsJsonWriter, WOPIJsonEnricher, WorkflowRequestJsonReader

public interface Marshaller<EntityType>
Interface of Java type converter.

You must add Setup annotation to every class implementing this interface. You should add Supports annotation to define supported mimetype. You can add Inject annotation to your properties to get current RenderingContext or any Nuxeo service.

To get an instance of this class with injected properties, call MarshallerRegistry.getInstance(RenderingContext, Class).

Since:
7.2
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accept(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediatype)
    Checks if this marshaller can handle the marshalling request.
  • Method Details

    • accept

      boolean accept(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediatype)
      Checks if this marshaller can handle the marshalling request.

      Please note it's useless to check that clazz is an instance of EntityType or if generic type and entity type are compatible (unlike JAX-RS which just checks the clazz, not the generic type). It's also useless to check Supports is compatible with mediatype. This is already done by the MarshallerRegistry

      This method implementation can use injected properties. So you can check the current RenderingContext to accept or reject a marshalling request.

      Parameters:
      clazz - The type to marshall.
      genericType - The generic type to marshall.
      mediatype - The managed mimetype.
      Returns:
      true if this converter handle the request, false otherwise.
      Since:
      7.2