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 TypeFieldDescription
      static java.lang.StringCHILD_PROP_ERROR_PREFIX
      The prefix for child property error.
      static intERROR
      The error level: ERROR (=2).
      static intINFO
      The error level: INFO (=0).
      static java.lang.StringVERIFY_ERROR_CHILD_PREFIX
      The verification prefix for child errors.
      static intWARNING
      The error level: WARNING (=1).
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and TypeMethodDescription
      IPropErrorItemclone()
      Clones the error item.
      booleanequals​(java.lang.Object o)
      Checks if two error items are equal.
      default java.lang.StringgetChildPropName()
      Gets the name of the child property that is "missing".
      java.lang.StringgetID()
      Gets the ID of this error.
      intgetIndex()
      Gets the index for a multi-property.
      java.lang.StringgetLocation()
      Gets the location of an error, for user info only.
      java.lang.StringgetLocationOrName()
      Gets the location or property name of an error, for user info only.
      java.lang.StringgetMessage()
      Gets the error message.
      java.lang.String[]getQuickFixes()
      Gets the quick-fix ID's.
      intgetSeverity()
      Gets the severity.
      java.lang.StringgetText​(boolean includeID)
      Gets a textual error description as "LEVEL[{\t}id]{\t}text" (where {\t} is the tab character).
      default booleanisChildPropError()
      Returns the flag indicating this error should be put in a child property with the name returned by getChildPropName().
      voidload​(org.w3c.dom.Element element)
      Initializes the error from XML.
      voidsave​(org.w3c.dom.Element element)
      Saves the item to XML.
      voidsetIndex​(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.
      • 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.