Class ConsolidatedDocument
java.lang.Object
ch.tocco.nice2.dbrefactoring.impl.xml.ConsolidatedDocument
Consolidates the changelog files from other modules to one big changelog file.
It creates a new xml document containing all changelogs from modules in correct order.
Usage:
ConsolidatedDocument doc = new ConsolidatedDocument(); doc.appendModuleChangelog(resource1.toURL(), module1); doc.appendModuleChangelog(resource2.toURL(), module2); ... //after all changelogs have been added, the new document is available doc.getChangelog().writeXml(new PrintWriter(System.out));While it preserves the order of the calls to
appendModuleChangelog(MetaChangelog, AppModule, ChangelogType, Nice2Version, boolean, boolean)
, changesets
are grouped by version of nice2. At first all changesets of the lowest nice2 version
are added for all modules, then all changesets for the next higher version are added,
etc.-
Constructor Summary
ConstructorDescriptionConsolidatedDocument
(PostProcessor postProcessor, ModuleManager moduleManager) Creates a new document with an empty root node ready for inserting changelog documents from other modules. -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendModuleChangelog
(ChangelogServiceImpl.MetaChangelog meta, AppModule module, ChangelogType type, @Nullable Nice2Version version, boolean applyFinalizer, boolean ignoreErrors) Immediately adds the contents of the document located at the specified url to this document.
-
Constructor Details
-
ConsolidatedDocument
Creates a new document with an empty root node ready for inserting changelog documents from other modules.- Parameters:
postProcessor
- processor to modify incoming changelogs
-
-
Method Details
-
getChangelog
-
getAffectedVersions
-
appendModuleChangelog
public void appendModuleChangelog(ChangelogServiceImpl.MetaChangelog meta, AppModule module, ChangelogType type, @Nullable @Nullable Nice2Version version, boolean applyFinalizer, boolean ignoreErrors) Immediately adds the contents of the document located at the specified url to this document. All changesets belowversion
are discarded (ifversion
is notnull
).- Parameters:
module
- the module which is contributing the changelogtype
- the changelog type for controlling post-processingversion
- the version from which on the changesets are added. Only changeset with a higher or equal version to this are considered
-