Class PropMarker

java.lang.Object
com.iizigo.prop.PropMarker
All Implemented Interfaces:
Runnable

public class PropMarker extends Object implements Runnable
The property marker is a class that holds error/warning/information about a property that is stored in a file.
Author:
Christopher Mindus
  • Field Details

    • MARKER_ID_PROPERTY

      public static final String MARKER_ID_PROPERTY
      The Property problem marker ID.
      See Also:
    • MARKER_ATTRIBUTE_PROPERTY_REFERENCE

      public static final String MARKER_ATTRIBUTE_PROPERTY_REFERENCE
      Attribute in Property problem marker for Property Reference.
      See Also:
    • MARKER_ATTRIBUTE_CHILD_NAME

      public static final String MARKER_ATTRIBUTE_CHILD_NAME
      Attribute in Property problem marker for Property Reference to a child name.
      See Also:
    • MARKER_ATTRIBUTE_PROPERTY_INDEX

      public static final String MARKER_ATTRIBUTE_PROPERTY_INDEX
      Attribute in Property problem marker for Property Reference with an indexed multi-property, assigns an Integer value (equal or greater than zero), otherwise not set.
      See Also:
    • markerID

      public final String markerID
      The Eclipse-registered marker ID.
    • severity

      public final int severity
      Marker severity: IMarker.SEVERITY_ERROR=2, IMarker.SEVERITY_WARNING=1 or IMarker.SEVERITY_INFO=0.
    • message

      public final String message
      The message.
    • location

      public final String location
      The location.
    • reference

      public final String reference
      Property reference of the error, null when not a property error.
    • index

      public final int index
      Index for property reference error, -1 when not set.
    • start

      public final int start
      The character start position of the marker, -1 when not position based.
    • length

      public final int length
      The character length of the marker, -1 when not position based.
    • quickFixIDs

      public final String[] quickFixIDs
      Array of registered quick-fixes for the problem (all must be registered in QuickFixer), never null.
    • childError

      public final String childError
      The name of child property in error.
  • Constructor Details

    • PropMarker

      public PropMarker(String markerID, boolean isError, String message, String location, String... quickFixIDs)
      Creates a new property marker for a property, typically used for general errors.
      Parameters:
      markerID - The Eclipse-registered marker ID.
      isError - Flag for error, false = warning.
      message - The message.
      location - The location.
      quickFixIDs - List of registered quick-fixes for the problem (all must be registered in QuickFixer)-
    • PropMarker

      public PropMarker(String markerID, boolean isError, String message, int start, int length, String... quickFixIDs)
      Creates a new property marker for a property, specialized to text file position, e.g for Java source file.
      Parameters:
      markerID - The Eclipse-registered marker ID.
      isError - Flag for error, false = warning.
      message - The message.
      start - The (character) start location in the file.
      length - The length of the marker.
      quickFixIDs - List of registered quick-fixes for the problem (all must be registered in QuickFixer)-
    • PropMarker

      public PropMarker(PropErrorItemOrigin errorItemOrigin)
      Creates a new property marker for a property error item.
      Parameters:
      errorItemOrigin - The error item including origin.
  • Method Details

    • getProperty

      public static GProp<?> getProperty(IMarker marker)
      Gets the property from the reference in the marker.
    • registerMarker

      public static void registerMarker(String markerID, boolean isPersistent)
      Registers a marker for a plug-in.
    • deleteMarkers

      public static void deleteMarkers(IResource resource, String markerID) throws CoreException
      Removes all markers of the IIZI Module type and any file errors associated with an attached property.
      Parameters:
      resource - The resource.
      markerID - The marker ID to remove or null for all.
      Throws:
      CoreException - If a marker cannot be deleted.
    • deleteAllMarkers

      public static void deleteAllMarkers(IResource resource)
      Removes all markers for a resource directly or in a job if it fails.
      Parameters:
      resource - The resource.
    • deleteAllMarkers

      public static void deleteAllMarkers(IResource resource, String type, boolean includeSubtypes, int depth, Runnable completed)
      Removes all markers for a resource directly or in a job if it fails.
      Parameters:
      resource - The resource.
      type - The type of marker to consider, or null to indicate all types.
      includeSubtypes - Whether or not to consider sub-types of the given type.
      depth - How far to recurse (see IResource.DEPTH_*).
      completed - A runnable that is called when it completes, null for none.
    • createMarker

      public boolean createMarker(IResource resource)
      Creates the marker.
      Returns:
      false if the marker cannot be created due to resource inaccessibility, true otherwise.
    • run

      public void run()
      Performs the adding of the marker in a job.
      Specified by:
      run in interface Runnable
    • dispose

      public void dispose(IResource resource)
      Disposes of a marker.
      Parameters:
      resource - The resource, or null for no marker removal on the resource.
    • toString

      public String toString()
      The string representation.
      Overrides:
      toString in class Object