public final class EcoreAnnotationValidator extends BasicEAnnotationValidator
Ecore annotations.BasicEAnnotationValidator.Assistant, BasicEAnnotationValidator.ValidationContextEAnnotationValidator.Descriptor, EAnnotationValidator.Registry| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DIAGNOSTIC_SOURCE |
static EcoreAnnotationValidator |
INSTANCE |
annotationName, annotationSource, assistant, diagnosticSource, IGNORED_ANNOTATIONS, IGNORED_CONTENTS, IGNORED_ENTRY, IGNORED_REFERENCES, INVALID_ANNOTATION, INVALID_CONTENT, INVALID_DETAIL_VALUE, INVALID_DUPLICATE, INVALID_LOCATION, INVALID_REFERENCE, INVALID_REFERENCE_LITERAL, INVALID_VALUE_LITERAL, MISSING_ENTRY, MISSING_REQUIRED_ENTRY_VALUE, TOO_FEW_VALUES, TOO_MANY_VALUES| Constructor and Description |
|---|
EcoreAnnotationValidator() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.List<EClass> |
getPropertyClasses(EModelElement eModelElement)
Returns the model classes used to represent annotations for the given model element.
|
protected ResourceLocator |
getResourceLocator()
Returns the resource locator for fetching implementation-specific messages.
|
protected boolean |
isValidLocation(EAnnotation eAnnotation,
EModelElement eModelElement)
Returns whether this annotation
contained by this model element is valid at this location. |
protected boolean |
validateAttributeDetailValueLiteral(EAnnotation eAnnotation,
EModelElement eModelElement,
java.util.Map.Entry<java.lang.String,java.lang.String> entry,
EAttribute attribute,
java.lang.String literalValue,
java.util.List<java.lang.Object> dataValues,
DiagnosticChain diagnostics,
java.util.Map<java.lang.Object,java.lang.Object> context)
Returns whether the given literal value is valid with respect to this detail entry's corresponding attribute's
data type. |
convertPropertyAttributeValueToLiteralItem, convertPropertyReferenceValueToLiteralItem, convertPropertyValueToLiteral, convertPropertyValueToLiteralItem, createAssistant, createDiagnostic, createInstance, createValueDiagnostic, getAllValidAnnotations, getAnnotationSource, getAssistant, getEcoreResourceLocator, getProperties, getRootEValidator, getString, getValidAnnotations, getValidContents, getValidLocationDescription, getValidReferences, initialize, isAnnotationsSupported, isApplicable, isContentsSupported, isDuplicateValid, isIncludedProperty, isReferencesSupported, isValidLocation, join, loadEPackage, reportDuplicate, reportIgnoredAnnotations, reportIgnoredContents, reportIgnoredEntry, reportIgnoredReferences, reportInvalidAnnotation, reportInvalidContent, reportInvalidLocation, reportInvalidReference, reportInvalidReferenceLiteral, reportInvalidValueLiteral, reportMissingEntry, reportMissingRequiredEntryValue, reportTooFewValues, reportTooManyValues, split, validate, validateAnnotations, validateAttributeDetailLiteralValue, validateContents, validateDetail, validateDetails, validateFeatureDetail, validateFeatureDetailValue, validateReferenceDetailLiteralValue, validateReferenceDetailValueLiteral, validateReferencespublic static final EcoreAnnotationValidator INSTANCE
public static final java.lang.String DIAGNOSTIC_SOURCE
protected ResourceLocator getResourceLocator()
BasicEAnnotationValidatorgetResourceLocator in class BasicEAnnotationValidatorprotected boolean isValidLocation(EAnnotation eAnnotation, EModelElement eModelElement)
BasicEAnnotationValidatorcontained by this model element is valid at this location.
This implementation returns false if the element is not a named element.
It's typically the case that annotations on annotations aren't meaningful and valid.
isValidLocation in class BasicEAnnotationValidatoreAnnotation - the annotation in question.eModelElement - the annotation's containing model element.BasicEAnnotationValidator.isValidLocation(EAnnotation),
BasicEAnnotationValidator.validate(EAnnotation, DiagnosticChain, Map)protected java.util.List<EClass> getPropertyClasses(EModelElement eModelElement)
BasicEAnnotationValidator
Typically an annotation validator implementation will return a single class.
An induced user interface will generally require the ability to create instances of the classes returned by this method.
The annotation validator implementation itself does not require that ability.
getPropertyClasses in class BasicEAnnotationValidatoreModelElement - the model element in question.protected boolean validateAttributeDetailValueLiteral(EAnnotation eAnnotation, EModelElement eModelElement, java.util.Map.Entry<java.lang.String,java.lang.String> entry, EAttribute attribute, java.lang.String literalValue, java.util.List<java.lang.Object> dataValues, DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
BasicEAnnotationValidatordata type.
As a side-effect, if the literal value can be converted to an instance value, the corresponding instance value is added to the list of data values.
This implementation first tries to convert the literal value to an instance value of the data type.
If that fails, it creates a diagnostic that includes the exception message.
Otherwise, it adds the instance value to the list of values
and validates the instance value.
validateAttributeDetailValueLiteral in class BasicEAnnotationValidatoreAnnotation - the annotation in question.eModelElement - the annotation's containing model element.entry - the annotation detail in question.attribute - feature the attribute property associated with entry.literalValue - the literal value of the data type.dataValues - the list in which to accumulate a valid instance value.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.Copyright © 2018. Licensed under the Eclipse Public License v1.0. All rights reserved.
Submit a bug or feature