Class MCRMETSGeneratorFactory

java.lang.Object
org.mycore.mets.model.MCRMETSGeneratorFactory

public abstract class MCRMETSGeneratorFactory extends Object
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
  • Constructor Details

    • MCRMETSGeneratorFactory

      public MCRMETSGeneratorFactory()
  • Method Details

    • create

      public static MCRMETSGenerator create(MCRPath derivatePath) throws MCRException
      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 derivate
      ignorePaths - 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

      public static void setSelector(MCRMETSGeneratorFactory.MCRMETSGeneratorSelector selector)
      Sets a new selector for the factory.
      Parameters:
      selector - the selector which determines which generator is chosen