public class BaseValidator extends EObjectValidator
BasePackage
EObjectValidator.DynamicEClassValidator, EObjectValidator.DynamicEDataTypeValidator
EValidator.Descriptor, EValidator.PatternMatcher, EValidator.Registry, EValidator.SubstitutionLabelProvider, EValidator.ValidationDelegate
Modifier and Type | Field and Description |
---|---|
protected static int |
DIAGNOSTIC_CODE_COUNT
A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class.
|
static String |
DIAGNOSTIC_SOURCE
|
static BaseValidator |
INSTANCE
The cached model package
|
static int |
WELL_FORMED_SOURCE_URI |
DATA_VALUE__FRACTION_DIGITS_IN_RANGE, DATA_VALUE__LENGTH_IN_RANGE, DATA_VALUE__MATCHES_PATTERN, DATA_VALUE__TOTAL_DIGITS_IN_RANGE, DATA_VALUE__TYPE_CORRECT, DATA_VALUE__VALUE_IN_ENUMERATION, DATA_VALUE__VALUE_IN_RANGE, EOBJECT__EVERY_BIDIRECTIONAL_REFERENCE_IS_PAIRED, EOBJECT__EVERY_DATA_VALUE_CONFORMS, EOBJECT__EVERY_KEY_UNIQUE, EOBJECT__EVERY_MAP_ENTRY_UNIQUE, EOBJECT__EVERY_MULTIPCITY_CONFORMS, EOBJECT__EVERY_PROXY_RESOLVES, EOBJECT__EVERY_REFERENCE_IS_CONTAINED, EOBJECT__NO_CIRCULAR_CONTAINMENT, EOBJECT__UNIQUE_ID, ROOT_OBJECT
MARKER, RELATED_URIS_ATTRIBUTE, URI_ATTRIBUTE
Constructor and Description |
---|
BaseValidator()
Creates an instance of the switch.
|
Modifier and Type | Method and Description |
---|---|
protected EPackage |
getEPackage()
Returns the package of this validator switch.
|
ResourceLocator |
getResourceLocator()
Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
|
protected static boolean |
isWellFormedURI(String uri)
A well formed URI string must have a non-zero length,
and must encode any special characters such as the space character.
|
protected boolean |
validate(int classifierID,
Object value,
DiagnosticChain diagnostics,
Map<Object,Object> context)
Calls
validateXXX for the corresponding classifier of the model. |
boolean |
validateAnnotation_WellFormedSourceURI(Annotation annotation,
DiagnosticChain diagnostics,
Map<Object,Object> context)
Validates the WellFormedSourceURI constraint of 'Annotation'.
|
boolean |
validateAnnotation(Annotation annotation,
DiagnosticChain diagnostics,
Map<Object,Object> context) |
boolean |
validateException(Exception exception,
DiagnosticChain diagnostics,
Map<Object,Object> context) |
boolean |
validateModelElement(ModelElement modelElement,
DiagnosticChain diagnostics,
Map<Object,Object> context) |
boolean |
validateStringToStringMapEntry(Map.Entry<?,?> stringToStringMapEntry,
DiagnosticChain diagnostics,
Map<Object,Object> context) |
boolean |
validateText(String text,
DiagnosticChain diagnostics,
Map<Object,Object> context) |
boolean |
validateURI(URI uri,
DiagnosticChain diagnostics,
Map<Object,Object> context) |
createBadDataValueDiagnostic, createDiagnostic, getEcoreResourceLocator, getEcoreString, getFeatureLabel, getObjectLabel, getRootEValidator, getString, getValidationDelegateRegistry, getValueLabel, isEcoreString, reportConstraintDelegateException, reportConstraintDelegateException, reportConstraintDelegateNotFound, reportConstraintDelegateNotFound, reportConstraintDelegateViolation, reportConstraintDelegateViolation, reportDataValuePatternViolation, reportDataValueTypeViolation, reportEnumerationViolation, reportFractionDigitsViolation, reportInvariantDelegateException, reportInvariantDelegateNotFound, reportInvariantDelegateViolation, reportMaxLengthViolation, reportMaxViolation, reportMinLengthViolation, reportMinViolation, reportTotalDigitsViolation, validate_BidirectionalReferenceIsPaired, validate_DataValueConforms, validate_EveryBidirectionalReferenceIsPaired, validate_EveryDataValueConforms, validate_EveryDefaultConstraint, validate_EveryKeyUnique, validate_EveryMapEntryUnique, validate_EveryMultiplicityConforms, validate_EveryProxyResolves, validate_EveryReferenceIsContained, validate_KeyUnique, validate_MapEntryUnique, validate_MultiplicityConforms, validate_NoCircularContainment, validate_UniqueID, validate, validate, validate, validate, validate, validate, validatePattern, wrapEnumerationValues
public static final BaseValidator INSTANCE
public static final String DIAGNOSTIC_SOURCE
Diagnostic.getSource()
,
Diagnostic.getCode()
,
Constant Field Valuespublic static final int WELL_FORMED_SOURCE_URI
protected static final int DIAGNOSTIC_CODE_COUNT
public BaseValidator()
protected EPackage getEPackage()
getEPackage
in class EObjectValidator
protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map<Object,Object> context)
validateXXX
for the corresponding classifier of the model.
validate
in class EObjectValidator
public boolean validateModelElement(ModelElement modelElement, DiagnosticChain diagnostics, Map<Object,Object> context)
public boolean validateAnnotation(Annotation annotation, DiagnosticChain diagnostics, Map<Object,Object> context)
public boolean validateAnnotation_WellFormedSourceURI(Annotation annotation, DiagnosticChain diagnostics, Map<Object,Object> context)
protected static boolean isWellFormedURI(String uri)
URI
,
ignoring the properly encoded characters,
and converting that to a string
,
must yield this URI string itself.uri
- the URI string in question.public boolean validateStringToStringMapEntry(Map.Entry<?,?> stringToStringMapEntry, DiagnosticChain diagnostics, Map<Object,Object> context)
public boolean validateURI(URI uri, DiagnosticChain diagnostics, Map<Object,Object> context)
public boolean validateException(Exception exception, DiagnosticChain diagnostics, Map<Object,Object> context)
public boolean validateText(String text, DiagnosticChain diagnostics, Map<Object,Object> context)
public ResourceLocator getResourceLocator()
getResourceLocator
in class EObjectValidator
Copyright (c) 2014 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v20.html