org.eclipse.emf.validation.marker
Class MarkerUtil

java.lang.Object
  extended byorg.eclipse.emf.validation.marker.MarkerUtil

public final class MarkerUtil
extends java.lang.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 java.lang.String RULE_ATTRIBUTE
           
static java.lang.String VALIDATION_MARKER_TYPE
           
 
Constructor Summary
MarkerUtil()
           
 
Method Summary
static void createMarkers(org.eclipse.core.runtime.IStatus validationStatus)
          Creates markers with default validation marker type for all resources that had validation failures or warnings.
static void createMarkers(org.eclipse.core.runtime.IStatus validationStatus, java.lang.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 java.lang.String VALIDATION_MARKER_TYPE
See Also:
Constant Field Values

RULE_ATTRIBUTE

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

MarkerUtil

public MarkerUtil()
Method Detail

createMarkers

public static void createMarkers(org.eclipse.core.runtime.IStatus validationStatus)
                          throws org.eclipse.core.runtime.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:
org.eclipse.core.runtime.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(org.eclipse.core.runtime.IStatus validationStatus,
                                 java.lang.String markerType,
                                 IMarkerConfigurator configurator)
                          throws org.eclipse.core.runtime.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:
org.eclipse.core.runtime.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

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