org.eclipse.emf.ecore.util
Class Diagnostician

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

public class Diagnostician
extends Object
implements EValidator.SubstitutionLabelProvider, EValidator

A validity checker for basic EObject constraints.


Nested Class Summary
 
Nested classes inherited from class 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, URI_ATTRIBUTE
 
Constructor Summary
Diagnostician()
           
Diagnostician(EValidator.Registry eValidatorRegistry)
           
 
Method Summary
protected  boolean doValidateContents(EObject eObject, DiagnosticChain diagnostics, Map context)
           
 String getFeatureLabel(EStructuralFeature eStructuralFeature)
          Returns the label used to identify a feature.
 String getObjectLabel(EObject eObject)
          Returns the label to identify an object.
 String getValueLabel(EDataType eDataType, Object value)
          Returns the label to identify a value of some data type.
 boolean validate(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map context)
           
 Diagnostic validate(EDataType eDataType, Object value)
           
 boolean validate(EDataType eDataType, Object value, DiagnosticChain diagnostics, Map 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, Map context)
          Validates the object in the given context, optionally producing diagnostics.
 
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 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 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 String getValueLabel(EDataType eDataType,
                            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

validate

public Diagnostic validate(EObject eObject)

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,
                        Map context)
Description copied from interface: EValidator
Validates the object in the given context, optionally producing diagnostics.

Specified by:
validate in interface EValidator
Parameters:
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,
                        Map context)
Specified by:
validate in interface EValidator

doValidateContents

protected boolean doValidateContents(EObject eObject,
                                     DiagnosticChain diagnostics,
                                     Map context)

validate

public Diagnostic validate(EDataType eDataType,
                           Object value)

validate

public boolean validate(EDataType eDataType,
                        Object value,
                        DiagnosticChain diagnostics,
                        Map context)
Specified by:
validate in interface EValidator

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