Class Generator


  • public class Generator
    extends Object
    A utility used to generate a Wildscribe site.
    Author:
    James R. Perkins
    • Constructor Detail

      • Generator

        public Generator()
    • Method Detail

      • generate

        public static Path generate​(Path modelPath,
                                    Path target)
                             throws IOException
        Generates a site based on the modelPath in the target directory.

        If the modelPath is a directory it must contain a file named version.txt. This file is delimited with : on each line where the first value is the product name, the second value is the version and the third value is the path to the DMR file.

        Example file contents:

         
         WildFly:18.0.0.Final:./WildFly-18.0.0.Final.dmr
         WildFly:17.0.0.Final:WildFly-17.0.0.Final.dmr
         
         

        Parameters:
        modelPath - the path to the model file or a directory with a verions.txt file
        target - the target directory to generate the site in
        Returns:
        the path to the directory the site was generated in
        Throws:
        IOException - if an error occurs generating the site
      • generate

        public static Path generate​(Path modelPath,
                                    Path target,
                                    String displayName,
                                    String displayVersion)
                             throws IOException
        Generates a site based on the modelPath in the target directory.

        If the modelPath is a directory it must contain a file named version.txt. This file is delimited with : on each line where the first value is the product name, the second value is the version and the third value is the path to the DMR file.

        Example file contents:

         
         WildFly:18.0.0.Final:./WildFly-18.0.0.Final.dmr
         WildFly:17.0.0.Final:WildFly-17.0.0.Final.dmr
         
         

        Note the displayName and displayVersion are only used if the modulePath is not a directory. If the module path is a directory the name and version are resolved from the version.txt file.

        Parameters:
        modelPath - the path to the model file or a directory with a verions.txt file
        target - the target directory to generate the site in
        displayName - the name that should be used for the display, or null to resolve the display name
        displayVersion - the version that should be used for the display, or null to resolve the display version
        Returns:
        the path to the directory the site was generated in
        Throws:
        IOException - if an error occurs generating the site
      • generate

        public static Path generate​(Collection<Path> modelPaths,
                                    Path target)
                             throws IOException
        Generates a site based on the modelPaths in the target directory.

        If any of the modelPaths are directories they must contain a file named version.txt. This file is delimited with : on each line where the first value is the product name, the second value is the version and the third value is the path to the DMR file.

        Example file contents:

         
         WildFly:18.0.0.Final:./WildFly-18.0.0.Final.dmr
         WildFly:17.0.0.Final:WildFly-17.0.0.Final.dmr
         
         

        Parameters:
        modelPaths - the paths to process
        target - the target directory to generate the site in
        Returns:
        the path to the directory the site was generated in
        Throws:
        IOException - if an error occurs generating the site
      • generate

        public static Path generate​(Collection<Path> modelPaths,
                                    Path target,
                                    String displayName,
                                    String displayVersion)
                             throws IOException
        Generates a site based on the modelPaths in the target directory.

        If any of the modelPaths are directories they must contain a file named version.txt. This file is delimited with : on each line where the first value is the product name, the second value is the version and the third value is the path to the DMR file.

        Example file contents:

         
         WildFly:18.0.0.Final:./WildFly-18.0.0.Final.dmr
         WildFly:17.0.0.Final:WildFly-17.0.0.Final.dmr
         
         

        Note the displayName and displayVersion are only used if the module path is not a directory. If the module path is a directory the name and version are resolved from the version.txt file.

        Parameters:
        modelPaths - the paths to process
        target - the target directory to generate the site in
        displayName - the name that should be used for the display, or null to resolve the display name
        displayVersion - the version that should be used for the display, or null to resolve the display version
        Returns:
        the path to the directory the site was generated in
        Throws:
        IOException - if an error occurs generating the site