Class Marker
java.lang.Object
com._1c.g5.v8.dt.validation.marker.Marker
- Direct Known Subclasses:
BmObjectMarker
,PlainEObjectMarker
Abstract representation of markers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The empty feature id constant. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns check id.long
Gets created at.Gets extra info.int
Gets the feature identifier.Returns human-friendly localized marker location (inside the marker's object).abstract String
Gets marker id.Returns the ID of the object this marker belongs to.Gets message.Returns human-friendly localized string representation of the marker object.org.eclipse.core.resources.IProject
Returns project marker belongs to.Gets the context object id that was used during the generation of the marker.Returns the ID of the source object's top object.Returns source type.Returns human-friendly localized string representation of the marker object's subsystems.Returns the ID of the top object this marker belongs to.int
hashCode()
boolean
isCustom()
Returnstrue
, if this is a custom marker, i.e. if there is acheck ID
.void
provideObject
(Consumer<org.eclipse.emf.ecore.EObject> consumer) Provides the object the marker is associated with to the given consumer.<T> T
provideObject
(Function<org.eclipse.emf.ecore.EObject, T> function) Provides the object the marker is associated with to the given function.void
setCheckId
(String checkId) Sets check id.void
setCreatedAt
(long createdAt) Sets created at.void
setExtraInfo
(Map<String, String> extraInfo) Sets extra info.void
setFeatureId
(int featureId) Sets the feature identifier.void
setMessage
(String message) Sets message.void
setProject
(org.eclipse.core.resources.IProject project) Sets the marker's project.void
setSeverity
(MarkerSeverity severity) void
setSourceObjectId
(Object sourceObjectId) Sets the source object identifiervoid
setSourceType
(String sourceType) Sets source type.toString()
-
Field Details
-
EMPTY_FEATURE_ID
public static final int EMPTY_FEATURE_IDThe empty feature id constant.- See Also:
-
-
Constructor Details
-
Marker
public Marker()
-
-
Method Details
-
getCreatedAt
public long getCreatedAt()Gets created at.- Returns:
- the createdAt
-
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
Gets message.- Returns:
- the message
-
getCheckId
Returns check id.- Returns:
- check id, not
null
-
setCheckId
Sets check id.- Parameters:
check
- id, notnull
-
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
Sets extra info.- Parameters:
extraInfo
- the extraInfo to set- See Also:
-
setMessage
Sets message.- Parameters:
message
- the message to set
-
setSourceType
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
- Returns:
- the severity
-
setSeverity
- Parameters:
severity
- the severity to set
-
getMarkerId
Gets marker id. Id should be unique for bm model- Returns:
- marker id, never
null
-
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 samegetMarkerId()
, but with the correct class (String
orLong
, depending on the marker type).
-
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 asgetMarkerObjectId()
.
-
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
Returns the ID of the source object's top object.- Returns:
- the ID of the source object's top object. May be
null
, ifgetSourceObjectId()
isnull
.
-
setSourceObjectId
Sets the source object identifier- Parameters:
sourceObjectId
- The sourceObjectId to set, can benull
-
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()Returnstrue
, if this is a custom marker, i.e. if there is acheck ID
.- Returns:
true
, if this is a custom marker, i.e. if there is acheck ID
.
-
getLocation
Returns human-friendly localized marker location (inside the marker's object).- Returns:
- human-friendly localized marker location string, never
null
.
-
getObjectPresentation
Returns human-friendly localized string representation of the marker object.- Returns:
- human-friendly localized string representation of the marker object, never
null
.
-
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
Provides the object the marker is associated with to the given consumer.- Parameters:
consumer
- object consumer, cannot benull
. The object provided to this consumer is guaranteed to exist only during the execution of the consumer'sConsumer.accept(Object)
method. Callers should NOT store this object for later. Provided object may benull
, if the object is not found/not associated.- Throws:
MarkerException
- ifproject
isnull
, or other error occurs.
-
provideObject
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 benull
. The object provided to this function is guaranteed to exist only during the execution of the function'sFunction.apply(Object)
method. Callers should NOT store this object for later. The provided object may benull
, if the object is not found/not associated.- Throws:
MarkerException
- ifproject
isnull
, or other error occurs.
-
hashCode
public int hashCode() -
equals
-
toString
-