public class DelegatingStorageMacroMarshaller extends Object implements Marshaller<MacroDefinition>, MigrationAware
Marshaller
of MacroDefinition
s which decided which macro storage format to marshal,
depending on the MacroDefinition
.MigrationAware.MigrationPerformedPredicate
Constructor and Description |
---|
DelegatingStorageMacroMarshaller(StorageMacroV1Marshaller v1Marshaller,
StorageMacroV2Marshaller v2Marshaller,
MacroMetadataManager macroMetadataManager,
MacroManager macroManager) |
DelegatingStorageMacroMarshaller(StorageMacroV1Marshaller v1Marshaller,
StorageMacroV2Marshaller v2Marshaller,
MacroMetadataManager macroMetadataManager,
MacroManager macroManager,
MarshallingRegistry marshallingRegistry) |
Modifier and Type | Method and Description |
---|---|
Streamable |
marshal(MacroDefinition macroDefinition,
ConversionContext conversionContext)
Marshals the supplied
MacroDefinition using either V1 or V2 macro storage format. |
boolean |
wasMigrationPerformed(ConversionContext conversionContext)
Given a
ConversionContext that was previously used to perform a migration, determine if that context
contains information that indicates whether a "migration" was performed. |
public DelegatingStorageMacroMarshaller(StorageMacroV1Marshaller v1Marshaller, StorageMacroV2Marshaller v2Marshaller, MacroMetadataManager macroMetadataManager, MacroManager macroManager)
public DelegatingStorageMacroMarshaller(StorageMacroV1Marshaller v1Marshaller, StorageMacroV2Marshaller v2Marshaller, MacroMetadataManager macroMetadataManager, MacroManager macroManager, MarshallingRegistry marshallingRegistry)
public Streamable marshal(MacroDefinition macroDefinition, ConversionContext conversionContext) throws XhtmlException
MacroDefinition
using either V1 or V2 macro storage format. Will use V2
storage format in preference, but only if it can find metadata for the macro.
If the MacroDefinition
originated in V1 format, but is being marshalled as V2, then a flag will
be set in the ConversionContext
to record that the fact that the macro is being migrated from
one storage format to another. This information is then later retrieved via the
wasMigrationPerformed(com.atlassian.confluence.content.render.xhtml.ConversionContext)
method.
marshal
in interface Marshaller<MacroDefinition>
macroDefinition
- The macro to be migratedconversionContext
- the conversion context in which to store the migration flagStreamable
containing the marshalled macro defintion.XhtmlException
- if an error occurs during marshallingMigrationAware}
public boolean wasMigrationPerformed(ConversionContext conversionContext)
MigrationAware
ConversionContext
that was previously used to perform a migration, determine if that context
contains information that indicates whether a "migration" was performed. What constitutes a migration is
implementation-dependent.wasMigrationPerformed
in interface MigrationAware
conversionContext
- the context used for the migrationConversionContext
contains the flag that indicates that a macro storage
format migration was performed within that context, false otherwise.MigrationAware}
Copyright © 2003–2020 Atlassian. All rights reserved.