Package org.mycore.mets.model
Class MCRMETSGeneratorFactory
java.lang.Object
org.mycore.mets.model.MCRMETSGeneratorFactory
Factory to create mets generator's. By default, this class uses the property 'MCR.Component.MetsMods.Generator' to
determine which generator is chosen. You can use either use
setSelector(MCRMETSGeneratorSelector)
to add
your own selector or use the property 'MCR.Component.MetsMods.Generator.Selector'.- Author:
- Matthias Eichner
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Base interface to select which mets generator should be chosen.static class
The default selector. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MCRMETSGenerator
Returns a generator for the given derivate.static MCRMETSGenerator
Returns a generator for the given derivate.static void
ignoreMetsXML
(boolean ignore) If the mets.xml should be ignored for generating the mets.xml or not.static boolean
Checks if the mets.xml in the derivate is added to the ignorePaths by default.static void
Sets a new selector for the factory.
-
Constructor Details
-
MCRMETSGeneratorFactory
public MCRMETSGeneratorFactory()
-
-
Method Details
-
create
Returns a generator for the given derivate.- Parameters:
derivatePath
- path to the derivate- Returns:
- new created generator
- Throws:
MCRException
- the generator could not be instantiated
-
create
public static MCRMETSGenerator create(MCRPath derivatePath, Set<MCRPath> ignorePaths) throws MCRException Returns a generator for the given derivate.- Parameters:
derivatePath
- path to the derivateignorePaths
- set of paths which should be ignored when generating the mets.xml- Returns:
- new created generator
- Throws:
MCRException
- the generator could not be instantiated
-
ignoreMetsXML
public static void ignoreMetsXML(boolean ignore) If the mets.xml should be ignored for generating the mets.xml or not.- Parameters:
ignore
- if the mets.xml should be added to the ignorePaths by default
-
isMetsXMLIgnored
public static boolean isMetsXMLIgnored()Checks if the mets.xml in the derivate is added to the ignorePaths by default. Ignoring is the default behaviour. If the mets.xml is not ignored, then the old mets.xml in the derivate will appear in the newly generated.- Returns:
- true if the mets.xml is ignored.
-
setSelector
Sets a new selector for the factory.- Parameters:
selector
- the selector which determines which generator is chosen
-