org.eclipse.emf.ecore.util
Class Diagnostician

java.lang.Object
  extended by org.eclipse.emf.ecore.util.Diagnostician
All Implemented Interfaces:
EValidator, EValidator.SubstitutionLabelProvider

public class Diagnostician
extends java.lang.Object
implements EValidator.SubstitutionLabelProvider, EValidator

A validity checker for basic EObject constraints.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.EValidator
EValidator.Descriptor, EValidator.PatternMatcher, EValidator.Registry, EValidator.SubstitutionLabelProvider
 
Field Summary
protected  EValidator.Registry eValidatorRegistry
           
static Diagnostician INSTANCE
           
 
Fields inherited from interface org.eclipse.emf.ecore.EValidator
MARKER, RELATED_URIS_ATTRIBUTE, URI_ATTRIBUTE
 
Constructor Summary
Diagnostician()
           
Diagnostician(EValidator.Registry eValidatorRegistry)
           
 
Method Summary
 java.util.Map<java.lang.Object,java.lang.Object> createDefaultContext()
           
 BasicDiagnostic createDefaultDiagnostic(EDataType eDataType, java.lang.Object value)
           
 BasicDiagnostic createDefaultDiagnostic(EObject eObject)
           
protected  boolean doValidateContents(EObject eObject, DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
           
 java.lang.String getFeatureLabel(EStructuralFeature eStructuralFeature)
          Returns the label used to identify a feature.
 java.lang.String getObjectLabel(EObject eObject)
          Returns the label to identify an object.
 java.lang.String getValueLabel(EDataType eDataType, java.lang.Object value)
          Returns the label to identify a value of some data type.
 boolean validate(EClass eClass, EObject eObject, DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
           
 Diagnostic validate(EDataType eDataType, java.lang.Object value)
           
 boolean validate(EDataType eDataType, java.lang.Object value, DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
           
 Diagnostic validate(EObject eObject)
           
 boolean validate(EObject eObject, DiagnosticChain diagnostics)
          Validates the object in the given context, optionally producing diagnostics.
 boolean validate(EObject eObject, DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          Validates the object in the given context, optionally producing diagnostics.
 Diagnostic validate(EObject eObject, java.util.Map<?,?> contextEntries)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final Diagnostician INSTANCE

eValidatorRegistry

protected EValidator.Registry eValidatorRegistry
Constructor Detail

Diagnostician

public Diagnostician(EValidator.Registry eValidatorRegistry)

Diagnostician

public Diagnostician()
Method Detail

getObjectLabel

public java.lang.String getObjectLabel(EObject eObject)
Description copied from interface: EValidator.SubstitutionLabelProvider
Returns the label to identify an object.

Specified by:
getObjectLabel in interface EValidator.SubstitutionLabelProvider

getFeatureLabel

public java.lang.String getFeatureLabel(EStructuralFeature eStructuralFeature)
Description copied from interface: EValidator.SubstitutionLabelProvider
Returns the label used to identify a feature.

Specified by:
getFeatureLabel in interface EValidator.SubstitutionLabelProvider

getValueLabel

public java.lang.String getValueLabel(EDataType eDataType,
                                      java.lang.Object value)
Description copied from interface: EValidator.SubstitutionLabelProvider
Returns the label to identify a value of some data type.

Specified by:
getValueLabel in interface EValidator.SubstitutionLabelProvider

createDefaultContext

public java.util.Map<java.lang.Object,java.lang.Object> createDefaultContext()
Since:
2.4

createDefaultDiagnostic

public BasicDiagnostic createDefaultDiagnostic(EObject eObject)
Since:
2.4

createDefaultDiagnostic

public BasicDiagnostic createDefaultDiagnostic(EDataType eDataType,
                                               java.lang.Object value)
Since:
2.4

validate

public Diagnostic validate(EObject eObject)

validate

public Diagnostic validate(EObject eObject,
                           java.util.Map<?,?> contextEntries)
Since:
2.4

validate

public boolean validate(EObject eObject,
                        DiagnosticChain diagnostics)
Validates the object in the given context, optionally producing diagnostics.

Parameters:
eObject - the object to validate.
diagnostics - a place to accumulate diagnostics; if it's null, no diagnostics should be produced.
Returns:
whether the object is valid.

validate

public boolean validate(EObject eObject,
                        DiagnosticChain diagnostics,
                        java.util.Map<java.lang.Object,java.lang.Object> context)
Description copied from interface: EValidator
Validates the object in the given context, optionally producing diagnostics.

Specified by:
validate in interface EValidator
diagnostics - a place to accumulate diagnostics; if it's null, no diagnostics should be produced.
context - a place to cache information, if it's null, no cache is supported.
Returns:
whether the object is valid.

validate

public boolean validate(EClass eClass,
                        EObject eObject,
                        DiagnosticChain diagnostics,
                        java.util.Map<java.lang.Object,java.lang.Object> context)
Specified by:
validate in interface EValidator

doValidateContents

protected boolean doValidateContents(EObject eObject,
                                     DiagnosticChain diagnostics,
                                     java.util.Map<java.lang.Object,java.lang.Object> context)

validate

public Diagnostic validate(EDataType eDataType,
                           java.lang.Object value)

validate

public boolean validate(EDataType eDataType,
                        java.lang.Object value,
                        DiagnosticChain diagnostics,
                        java.util.Map<java.lang.Object,java.lang.Object> context)
Specified by:
validate in interface EValidator

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.