Interface AMarker

  • All Superinterfaces:
    AAbstraction
    All Known Implementing Classes:
    EclipseMarker, PlainJavaMarker

    public interface AMarker
    extends AAbstraction
    A marker represents information about a resource, where they can be added, queried and removed.

    Every marker has a unique ID and a type that is used to handle markers of the same type on different resources as well as optionally some attributes, each identified by a name and depending on the type.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void delete()
      Deletes this marker from its associated resource.
      java.lang.Object getAttribute​(java.lang.String attributeName)
      Returns the value of the given attribute.
      boolean getAttribute​(java.lang.String attributeName, boolean defaultValue)
      Returns the value of the given attribute of type boolean.
      int getAttribute​(java.lang.String attributeName, int defaultValue)
      Returns the value of the given attribute of type int.
      java.lang.String getAttribute​(java.lang.String attributeName, java.lang.String defaultValue)
      Returns the value of the given attribute of type String.
      long getId()
      Returns this marker's unique ID.
      java.lang.String getType()
      Returns this marker's type.
      boolean isError()
      Convenience method that returns whether this marker has a 'severity' attribute marking it as an 'error'.
      void setAttribute​(java.lang.String attributeName, java.lang.Object value)
      Sets the value of the given attribute.
      void setAttributes​(java.lang.String[] attributeNames, java.lang.Object[] values)
      Sets the values of the given attributes.
    • Method Detail

      • getId

        long getId()
        Returns this marker's unique ID.
      • getType

        java.lang.String getType()
        Returns this marker's type.
      • isError

        boolean isError()
        Convenience method that returns whether this marker has a 'severity' attribute marking it as an 'error'.
      • getAttribute

        @CheckForNull
        java.lang.Object getAttribute​(java.lang.String attributeName)
        Returns the value of the given attribute. Attributes may be strings, integers or booleans. When an attribute is not set null is returned.
        Parameters:
        attributeName - an attribute's name
        Returns:
        the value associated with the given attribute
      • getAttribute

        java.lang.String getAttribute​(java.lang.String attributeName,
                                      java.lang.String defaultValue)
        Returns the value of the given attribute of type String. When the attribute is not set the given default value is returned.
        Parameters:
        attributeName - a String attribute's name
        Returns:
        the value associated with the given attribute or the default value
      • getAttribute

        boolean getAttribute​(java.lang.String attributeName,
                             boolean defaultValue)
        Returns the value of the given attribute of type boolean. When the attribute is not set the given default value is returned.
        Parameters:
        attributeName - a boolean attribute's name
        Returns:
        the value associated with the given attribute or the default value
      • getAttribute

        int getAttribute​(java.lang.String attributeName,
                         int defaultValue)
        Returns the value of the given attribute of type int. When the attribute is not set the given default value is returned.
        Parameters:
        attributeName - an integer attribute's name
        Returns:
        the value associated with the given attribute or the default value
      • setAttribute

        void setAttribute​(java.lang.String attributeName,
                          @CheckForNull
                          java.lang.Object value)
        Sets the value of the given attribute. Attributes may be strings, integers or booleans. An attribute may be removed by setting its value to null.
        Parameters:
        attributeName - an attribute's name
        value - the value to be associated with the given attribute
      • setAttributes

        void setAttributes​(java.lang.String[] attributeNames,
                           java.lang.Object[] values)
        Sets the values of the given attributes. Attributes may be strings, integers or booleans. An attribute may be removed by setting its value to null.
        Parameters:
        attributeNames - an array of attribute's name
        values - the values to be associated with the given attribute, must be of the same length as the array of attribute names
      • delete

        void delete()
        Deletes this marker from its associated resource.