org.eclipse.emf.validation.marker
Class MarkerUtil

java.lang.Object
  extended by org.eclipse.emf.validation.marker.MarkerUtil

public final class MarkerUtil
extends Object

This class provides utility methods that aid in the creation of IResource markers (IMarker). Markers created by this utility will have the ValidationMarkerResolution registered as a resolution that simply disables the constraint unless they are using a marker subtype. In that case they will have to explicitly register the ValidationMarkerResolution against their marker type.


Field Summary
static String RULE_ATTRIBUTE
           
static String VALIDATION_MARKER_TYPE
           
 
Constructor Summary
MarkerUtil()
           
 
Method Summary
static void createMarkers(IStatus validationStatus)
          Creates markers with default validation marker type for all resources that had validation failures or warnings.
static void createMarkers(IStatus validationStatus, int severityMask)
          Creates markers with default validation marker type for all resources that had validation failures or warnings.
static void createMarkers(IStatus validationStatus, int severityMask, String markerType, IMarkerConfigurator configurator)
          Creates markers with the provided marker type for all resources that had validation failures or warnings.
static void createMarkers(IStatus validationStatus, String markerType, IMarkerConfigurator configurator)
          Creates markers with the provided marker type for all resources that had validation failures or warnings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATION_MARKER_TYPE

public static final String VALIDATION_MARKER_TYPE
See Also:
Constant Field Values

RULE_ATTRIBUTE

public static final String RULE_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

MarkerUtil

public MarkerUtil()
Method Detail

createMarkers

public static void createMarkers(IStatus validationStatus)
                          throws CoreException
Creates markers with default validation marker type for all resources that had validation failures or warnings. The status provided is the status returned by one of the IValidator.validate(Object) methods.

Parameters:
validationStatus - A status object returned by a validator's validate method.
Throws:
CoreException - A core exception is thrown if there were any problems interacting with the workspace to attach/delete markers on resources.

createMarkers

public static void createMarkers(IStatus validationStatus,
                                 int severityMask)
                          throws CoreException
Creates markers with default validation marker type for all resources that had validation failures or warnings. The status provided is the status returned by one of the IValidator.validate(Object) methods.

Parameters:
validationStatus - A status object returned by a validator's validate method.
severityMask - mask selecting which severities to create markers for
Throws:
CoreException - A core exception is thrown if there were any problems interacting with the workspace to attach/delete markers on resources.
Since:
1.2

createMarkers

public static void createMarkers(IStatus validationStatus,
                                 String markerType,
                                 IMarkerConfigurator configurator)
                          throws CoreException
Creates markers with the provided marker type for all resources that had validation failures or warnings. An options marker configurator is provided in order to populate the marker with additional information.

Parameters:
validationStatus - A status object returned by a validator's validate method.
markerType - A marker type that is a subtype of the validationProblem marker type.
configurator - An optional configurator to populate marker subtype specific attributes.
Throws:
CoreException - A core exception is thrown if there were any problems interacting with the workspace to attach/delete markers on resources.
See Also:
IValidator.validate(Object), IValidator.validate(java.util.Collection), IMarkerConfigurator

createMarkers

public static void createMarkers(IStatus validationStatus,
                                 int severityMask,
                                 String markerType,
                                 IMarkerConfigurator configurator)
                          throws CoreException
Creates markers with the provided marker type for all resources that had validation failures or warnings. An options marker configurator is provided in order to populate the marker with additional information.

Parameters:
validationStatus - A status object returned by a validator's validate method.
severityMask - mask selecting which severities to create markers for
markerType - A marker type that is a subtype of the validationProblem marker type.
configurator - An optional configurator to populate marker subtype specific attributes.
Throws:
CoreException - A core exception is thrown if there were any problems interacting with the workspace to attach/delete markers on resources.
Since:
1.2
See Also:
IValidator.validate(Object), IValidator.validate(java.util.Collection), IMarkerConfigurator

Copyright 2002, 2007 IBM Corporation and others.
All Rights Reserved.