Class Marker

java.lang.Object
com._1c.g5.v8.dt.validation.marker.Marker
Direct Known Subclasses:
BmObjectMarker, PlainEObjectMarker

public abstract class Marker extends Object
Abstract representation of markers.
  • Field Details

    • EMPTY_FEATURE_ID

      public static final int EMPTY_FEATURE_ID
      The empty feature id constant.
      See Also:
  • Constructor Details

    • Marker

      public Marker()
  • Method Details

    • getCreatedAt

      public long getCreatedAt()
      Gets created at.
      Returns:
      the createdAt
    • getExtraInfo

      public IExtraInfoMap getExtraInfo()
      Gets extra info.

      Please note that some values are stored in the compressed format, so use or Map#getOrDefault(Object, Object) to access decompressed values.

      Direct access to map entries may give you compressed values so use with caution.

      Returns:
      the extraInfo, never null.
    • getMessage

      public String getMessage()
      Gets message.
      Returns:
      the message
    • getCheckId

      public String getCheckId()
      Returns check id.
      Returns:
      check id, not null
    • setCheckId

      public void setCheckId(String checkId)
      Sets check id.
      Parameters:
      check - id, not null
    • getSourceType

      public String getSourceType()
      Returns source type.
      Returns:
      the source type, not null.
    • setCreatedAt

      public void setCreatedAt(long createdAt)
      Sets created at.
      Parameters:
      createdAt - the createdAt to set
    • setExtraInfo

      public void setExtraInfo(Map<String,String> extraInfo)
      Sets extra info.
      Parameters:
      extraInfo - the extraInfo to set
      See Also:
    • setMessage

      public void setMessage(String message)
      Sets message.
      Parameters:
      message - the message to set
    • setSourceType

      public void setSourceType(String sourceType)
      Sets source type.
      Parameters:
      sourceType - the source type to set
    • getFeatureId

      public int getFeatureId()
      Gets the feature identifier.
      Returns:
      the feature identifier.
    • setFeatureId

      public void setFeatureId(int featureId)
      Sets the feature identifier.
      Parameters:
      featureId - the feature identifier to set.
    • getSeverity

      public MarkerSeverity getSeverity()
      Returns:
      the severity
    • setSeverity

      public void setSeverity(MarkerSeverity severity)
      Parameters:
      severity - the severity to set
    • getMarkerId

      public abstract String getMarkerId()
      Gets marker id. Id should be unique for bm model
      Returns:
      marker id, never null
    • getMarkerObjectId

      public Object getMarkerObjectId()
      Returns the ID of the object this marker belongs to.
      Returns:
      the ID of the object this marker belongs to. Never null. Generally, it's the same getMarkerId(), but with the correct class (String or Long, depending on the marker type).
    • getTopObjectId

      public Object getTopObjectId()
      Returns the ID of the top object this marker belongs to.
      Returns:
      the ID of the top object this marker belongs to. Never null. If the object of this marker is a top object, returns the same values as getMarkerObjectId().
    • getSourceObjectId

      public Object getSourceObjectId()
      Gets the context object id that was used during the generation of the marker. This identifier is used to clear all markers related to the source object during the next validation ( each validation performs full replacement of check-related markers for a particular source)
      Returns:
      the sourceObjectId The identifier of the source object, can be null
    • getSourceObjectTopObjectId

      public Object getSourceObjectTopObjectId()
      Returns the ID of the source object's top object.
      Returns:
      the ID of the source object's top object. May be null, if getSourceObjectId() is null.
    • setSourceObjectId

      public void setSourceObjectId(Object sourceObjectId)
      Sets the source object identifier
      Parameters:
      sourceObjectId - The sourceObjectId to set, can be null
    • getProject

      public org.eclipse.core.resources.IProject getProject()
      Returns project marker belongs to.
      Returns:
      the project project. May be null, if this information is not available.
    • setProject

      public void setProject(org.eclipse.core.resources.IProject project)
      Sets the marker's project.
      Parameters:
      project - marker's project.
    • isCustom

      public boolean isCustom()
      Returns true, if this is a custom marker, i.e. if there is a check ID.
      Returns:
      true, if this is a custom marker, i.e. if there is a check ID.
    • getLocation

      public String getLocation()
      Returns human-friendly localized marker location (inside the marker's object).
      Returns:
      human-friendly localized marker location string, never null.
    • getObjectPresentation

      public String getObjectPresentation()
      Returns human-friendly localized string representation of the marker object.
      Returns:
      human-friendly localized string representation of the marker object, never null.
    • getSubsystemsPresentation

      public List<String> getSubsystemsPresentation()
      Returns human-friendly localized string representation of the marker object's subsystems.
      Returns:
      human-friendly localized string representation of the marker object's subsystems, never null.
    • provideObject

      public void provideObject(Consumer<org.eclipse.emf.ecore.EObject> consumer)
      Provides the object the marker is associated with to the given consumer.
      Parameters:
      consumer - object consumer, cannot be null. The object provided to this consumer is guaranteed to exist only during the execution of the consumer's Consumer.accept(Object) method. Callers should NOT store this object for later. Provided object may be null, if the object is not found/not associated.
      Throws:
      MarkerException - if project is null, or other error occurs.
    • provideObject

      public <T> T provideObject(Function<org.eclipse.emf.ecore.EObject,T> function)
      Provides the object the marker is associated with to the given function.
      Parameters:
      function - function to consume an object and return some processed value, cannot be null. The object provided to this function is guaranteed to exist only during the execution of the function's Function.apply(Object) method. Callers should NOT store this object for later. The provided object may be null, if the object is not found/not associated.
      Throws:
      MarkerException - if project is null, or other error occurs.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object