org.eclipse.gmf.runtime.lite.validation
Class ViolationDescriptor

java.lang.Object
  extended by org.eclipse.gmf.runtime.lite.validation.ViolationDescriptor

public class ViolationDescriptor
extends Object

Represents a description of a validation problem.

Author:
bblajer

Constructor Summary
ViolationDescriptor(Severity severity, String message, org.eclipse.emf.common.util.URI uri, Object data)
          Creates a new instance of a violation description with the specified attributes.
 
Method Summary
static ViolationDescriptor create(org.eclipse.gmf.runtime.notation.View view, org.eclipse.emf.common.util.Diagnostic diagnostic)
          Returns an instance of ViolationDescriptor from the given diagnostic or null if diagnostic cannot be represented as a violation descriptor.
static ViolationDescriptor create(org.eclipse.gmf.runtime.notation.View view, org.eclipse.core.runtime.IStatus validationStatus)
          Returns an instance of ViolationDescriptor from the given status or null if the status cannot be represented as a violation descriptor.
 String getMessage()
          Returns the message associated with this violation
 Object getReferent()
          Returns the representation this descriptor was created from.
 Severity getSeverity()
          Returns the severity of this violation
 org.eclipse.emf.common.util.URI getUri()
          Returns the URI of the element associated with this violation
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViolationDescriptor

public ViolationDescriptor(Severity severity,
                           String message,
                           org.eclipse.emf.common.util.URI uri,
                           Object data)
Creates a new instance of a violation description with the specified attributes.

Parameters:
severity -
message -
uri -
Method Detail

getMessage

public String getMessage()
Returns the message associated with this violation


getSeverity

public Severity getSeverity()
Returns the severity of this violation


getUri

public org.eclipse.emf.common.util.URI getUri()
Returns the URI of the element associated with this violation


getReferent

public Object getReferent()
Returns the representation this descriptor was created from.


hashCode

public int hashCode()
Overrides:
hashCode in class Object

create

public static ViolationDescriptor create(org.eclipse.gmf.runtime.notation.View view,
                                         org.eclipse.core.runtime.IStatus validationStatus)
Returns an instance of ViolationDescriptor from the given status or null if the status cannot be represented as a violation descriptor. Children of the status are not taken into account.


create

public static ViolationDescriptor create(org.eclipse.gmf.runtime.notation.View view,
                                         org.eclipse.emf.common.util.Diagnostic diagnostic)
Returns an instance of ViolationDescriptor from the given diagnostic or null if diagnostic cannot be represented as a violation descriptor. Children of the diagnostic are not taken into account.



Copyright © 2012. All Rights Reserved.