Class ModelProblemUtils


  • public class ModelProblemUtils
    extends java.lang.Object
    Assists in the handling of model problems.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String formatLocation​(ModelProblem problem, java.lang.String projectId)
      Creates a string with all location details for the specified model problem.
      (package private) static java.lang.String toId​(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
      Creates a user-friendly artifact id from the specified coordinates.
      (package private) static java.lang.String toId​(Model model)  
      (package private) static java.lang.String toPath​(Model model)  
      (package private) static java.lang.String toSourceHint​(Model model)
      Creates a user-friendly source hint for the specified model.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ModelProblemUtils

        public ModelProblemUtils()
    • Method Detail

      • toSourceHint

        static java.lang.String toSourceHint​(Model model)
        Creates a user-friendly source hint for the specified model.
        Parameters:
        model - The model to create a source hint for, may be null.
        Returns:
        The user-friendly source hint, never null.
      • toPath

        static java.lang.String toPath​(Model model)
      • toId

        static java.lang.String toId​(Model model)
      • toId

        static java.lang.String toId​(java.lang.String groupId,
                                     java.lang.String artifactId,
                                     java.lang.String version)
        Creates a user-friendly artifact id from the specified coordinates.
        Parameters:
        groupId - The group id, may be null.
        artifactId - The artifact id, may be null.
        version - The version, may be null.
        Returns:
        The user-friendly artifact id, never null.
      • formatLocation

        public static java.lang.String formatLocation​(ModelProblem problem,
                                                      java.lang.String projectId)
        Creates a string with all location details for the specified model problem. If the project identifier is provided, the generated location will omit the model id and source information and only give line/column information for problems originating directly from this POM.
        Parameters:
        problem - The problem whose location should be formatted, must not be null.
        projectId - The <groupId>:<artifactId>:<version> of the corresponding project, may be null to force output of model id and source.
        Returns:
        The formatted problem location or an empty string if unknown, never null.