Interface IPropErrorItem

  • All Superinterfaces:
    java.lang.Cloneable
    All Known Implementing Classes:
    PropErrorItem, PropErrorItemValue

    public interface IPropErrorItem
    extends java.lang.Cloneable
    The generic property item error. A property can have several difference errors for each property, each one with a unique ID. One or more quick-fixes may be available, in which case there are Quick-fix IDs.
    Author:
    Christopher Mindus
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CHILD_PROP_ERROR_PREFIX
      The prefix for child property error.
      static int ERROR
      The error level: ERROR (=2).
      static int INFO
      The error level: INFO (=0).
      static java.lang.String VERIFY_ERROR_CHILD_PREFIX
      The verification prefix for child errors.
      static int WARNING
      The error level: WARNING (=1).
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      IPropErrorItem clone()
      Clones the error item.
      boolean equals​(java.lang.Object o)
      Checks if two error items are equal.
      default java.lang.String getChildPropName()
      Gets the name of the child property that is "missing".
      java.lang.String getID()
      Gets the ID of this error.
      int getIndex()
      Gets the index for a multi-property.
      java.lang.String getLocation()
      Gets the location of an error, for user info only.
      java.lang.String getLocationOrName()
      Gets the location or property name of an error, for user info only.
      java.lang.String getMessage()
      Gets the error message.
      java.lang.String[] getQuickFixes()
      Gets the quick-fix ID's.
      int getSeverity()
      Gets the severity.
      java.lang.String getText​(boolean includeID)
      Gets a textual error description as "LEVEL[{\t}id]{\t}text" (where {\t} is the tab character).
      default boolean isChildPropError()
      Returns the flag indicating this error should be put in a child property with the name returned by getChildPropName().
      void load​(org.w3c.dom.Element element)
      Initializes the error from XML.
      void save​(org.w3c.dom.Element element)
      Saves the item to XML.
      void setIndex​(int index)
      Sets the index for a multi-property.
    • Field Detail

      • CHILD_PROP_ERROR_PREFIX

        static final java.lang.String CHILD_PROP_ERROR_PREFIX
        The prefix for child property error.
        See Also:
        Constant Field Values
      • VERIFY_ERROR_CHILD_PREFIX

        static final java.lang.String VERIFY_ERROR_CHILD_PREFIX
        The verification prefix for child errors.
        See Also:
        Constant Field Values
    • Method Detail

      • setIndex

        void setIndex​(int index)
        Sets the index for a multi-property.
        Parameters:
        index - 0 for main part, otherwise one-based index for errored property value.
      • getSeverity

        int getSeverity()
        Gets the severity.
        Returns:
        INFO, WARNING or ERROR.
      • getID

        java.lang.String getID()
        Gets the ID of this error.
      • getMessage

        java.lang.String getMessage()
        Gets the error message.
        Returns:
        The error message.
      • getLocation

        java.lang.String getLocation()
        Gets the location of an error, for user info only.
        Returns:
        The location, or null for none.
      • getLocationOrName

        java.lang.String getLocationOrName()
        Gets the location or property name of an error, for user info only.
        Returns:
        The location, or the property name if none is defined, never null.
      • getText

        java.lang.String getText​(boolean includeID)
        Gets a textual error description as "LEVEL[{\t}id]{\t}text" (where {\t} is the tab character).
        Parameters:
        includeID - Flag to include ID or not.
      • getIndex

        int getIndex()
        Gets the index for a multi-property.
        Returns:
        -1 for none, 0 for main part, otherwise one-based index for errored property value.
      • getQuickFixes

        java.lang.String[] getQuickFixes()
        Gets the quick-fix ID's.
        Returns:
        The list of quick-fix ID's or null for none.
      • clone

        IPropErrorItem clone()
        Clones the error item.
        Returns:
        A clone.
      • equals

        boolean equals​(java.lang.Object o)
        Checks if two error items are equal.
        Overrides:
        equals in class java.lang.Object
      • load

        void load​(org.w3c.dom.Element element)
           throws java.lang.Exception
        Initializes the error from XML.
        Parameters:
        element - The errorItem element.
        Throws:
        java.lang.Exception - For errors in XML.
      • save

        void save​(org.w3c.dom.Element element)
        Saves the item to XML.
        Parameters:
        element - The errorItem element to save the data to.
      • isChildPropError

        default boolean isChildPropError()
        Returns the flag indicating this error should be put in a child property with the name returned by getChildPropName().
      • getChildPropName

        default java.lang.String getChildPropName()
        Gets the name of the child property that is "missing".
        Returns:
        The name of the child property, or null if not a child property error, i.e. isChildPropError() returns false.