Class ProblemType


  • public class ProblemType
    extends java.lang.Object
    Version:
    1.0, 14.03.2011
    Author:
    ...
    • Constructor Summary

      Constructors 
      Constructor Description
      ProblemType​(java.lang.String name, java.lang.String group, java.lang.String description, java.lang.String message)
      name, group and description describe the problem and are used in preferences for selection.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ProblemType create​(java.lang.String prefix, java.lang.String name)
      Creates a new problem type.
      boolean equals​(java.lang.Object obj)
      An inspector creating this ProblemType.
      java.lang.String getDescription()
      Returns a localized, human-readable description of the type or null
      java.lang.String getGroup()
      Returns an identifier for a group of ProblemTypes this ProblemType belongs to or null.
      java.lang.String getMessage()
      Returns the message for this type or null (if the message depends on more than just the type.
      java.lang.String getName()
      Returns a localized, human-readable name of this problem.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ProblemType

        public ProblemType​(java.lang.String name,
                           java.lang.String group,
                           java.lang.String description,
                           java.lang.String message)
        name, group and description describe the problem and are used in preferences for selection. message is displayed to the user. If the message depends on the problem (not just on the type) it should be null here. A name must start with a letter and contain only letters, numbers, '-', '_', and ' '.
        Parameters:
        name - The (localized) name of the ProblemType.
        group - The (localized) group this problem belongs to or null
        description - The localized description of the problem or null
        message - The message to display or null
        Throws:
        java.lang.NullPointerException - if name == null
        java.lang.IllegalArgumentException - if name contains illegal characters or does not start with a letter
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns a localized, human-readable name of this problem.
      • getGroup

        public java.lang.String getGroup()
        Returns an identifier for a group of ProblemTypes this ProblemType belongs to or null.
      • getDescription

        public java.lang.String getDescription()
        Returns a localized, human-readable description of the type or null
      • getMessage

        public java.lang.String getMessage()
        Returns the message for this type or null (if the message depends on more than just the type.
      • equals

        public boolean equals​(java.lang.Object obj)
        An inspector creating this ProblemType.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • create

        public static ProblemType create​(java.lang.String prefix,
                                         java.lang.String name)
        Creates a new problem type. Loads message, name, description, and group from the Resources with the keys "prefix.name.xxxx". Example usage: ProblemType.create("component", "problemname").
        Parameters:
        prefix - first part of the resource keys
        name - second part of the resource keys
        Returns:
        A new problem type
        Throws:
        java.lang.IllegalArgumentException - If the type name cannot be found in the Resources, or if it contains illegal characters or does not start with a letter
        See Also:
        Resources.get(String)