Class BasicAnnotationValidator.Assistant
- Enclosing class:
- BasicAnnotationValidator
modeled objects that are created by createInstance(EClass, Annotation).
This implementation delegates to the annotation validator which in turn provides an accessor for its to corresponding assistant.
This class generally does not need to be specialized nor instantiated because every annotation validator provides an assistant.
This class therefore is abstract though none of its methods are abstract.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BasicAnnotationValidatorThe annotation validator to which this assistant delegates. -
Constructor Summary
ConstructorsConstructorDescriptionAssistant(BasicAnnotationValidator annotationValidator) Creates an instance that delegates to the give annotation validator. -
Method Summary
Modifier and TypeMethodDescriptionconvertPropertyValueToLiteral(EObject eObject, EStructuralFeature eStructuralFeature, Object value) createInstance(EClass eClass, Annotation annotation) Creates an initialized instance of the modeled representation for the given annotation.getApplicableProperties(EObject eObject, Annotation annotation) Returns thesubset of propertiesthat are applicable for the current state of the modeled annotation instance.getProperties(ModelElement modelElement) Returns a map from key tofeature.getPropertyClasses(ModelElement modelElement) Returns the model classes used to represent annotations for the given model element.Collection<? extends Annotation>getValidAnnotations(Annotation annotation, Collection<? extends Annotation> annotations) Returns the filtered collection of nested annotations that are valid for this annotation.Collection<? extends EObject>getValidContents(Annotation annotation, Collection<? extends EObject> contents) Returns the filtered collection of contents that are valid for this annotation.Collection<?>getValidReferences(Annotation annotation, Collection<?> references) Returns the filtered collection of references that are valid for this annotation.booleanisAnnotationsSupported(Annotation annotation) Returns whethernested annotationsare meaningful for this annotation.booleanisContentsSupported(Annotation annotation) Returns whethercontentsare meaningful for this annotation.booleanisReferencesSupported(Annotation annotation) Returns whetherreferencesare meaningful for this annotation.booleanisValidLocation(Annotation annotation) Returns whether this annotation with this annotation validator'sannotation sourceis valid at itscurrent location.
-
Field Details
-
annotationValidator
The annotation validator to which this assistant delegates.
-
-
Constructor Details
-
Assistant
Creates an instance that delegates to the give annotation validator.
-
-
Method Details
-
isValidLocation
Returns whether this annotation with this annotation validator'sannotation sourceis valid at itscurrent location.The implementation delegates to
BasicAnnotationValidator.isValidLocation(Annotation). An induced user interface can use this to determine if it can/should use this assistant's information for representing modeled annotation information.- Parameters:
annotation- the annotation in question.- Returns:
- whether this annotation with this annotation validator's annotation source is valid at its current location.
-
getProperties
Returns a map from key tofeature. These represents the keys that are considered valid and can be processed by this annotation validator.The implementation delegates to
BasicAnnotationValidator.getProperties(ModelElement). An induced user interface can use this method to determine which properties to display.- Parameters:
modelElement- the model element that is being annotated.- Returns:
- a map from key to feature.
- See Also:
-
getPropertyClasses
Returns the model classes used to represent annotations for the given model element.The implementation delegates to
BasicAnnotationValidator.getPropertyClasses(ModelElement). An induced user interface can use this method to determine which instances to create for display purposes.- Parameters:
modelElement- the model element in question.- Returns:
- the model classes used to represent annotations for the given model element.
-
createInstance
Creates an initialized instance of the modeled representation for the given annotation.The implementation delegates to
BasicAnnotationValidator.createInstance(EClass, Annotation). An induced user interface can use this method to create instances for display purposes.- Parameters:
eClass- the class to be instantiated.annotation- the annotation with the information that needs to be represented.- Returns:
- creates an initialized instance of the modeled representation for the given annotation.
-
convertPropertyValueToLiteral
public String convertPropertyValueToLiteral(EObject eObject, EStructuralFeature eStructuralFeature, Object value) -
getApplicableProperties
public Map<String,EStructuralFeature> getApplicableProperties(EObject eObject, Annotation annotation) Returns thesubset of propertiesthat are applicable for the current state of the modeled annotation instance.This subset includes only those properties of the annotation's
containingmodel element for whichBasicAnnotationValidator.isApplicable(EObject, EStructuralFeature)returnstrue. An induced user interface should avoid displaying properties that are not applicable for the current state of the modeled annotation instance.- Parameters:
eObject- the modeled instance in question.annotation- the corresponding annotation of that modeled instance.- Returns:
- the subset of properties that are applicable for the current state of the modeled annotation instance.
-
isReferencesSupported
Returns whetherreferencesare meaningful for this annotation.The implementation delegates to
BasicAnnotationValidator.isReferencesSupported(Annotation, ModelElement), passing in thecontainingmodel element. An induced user interface should avoid providing the ability to specify references when this returnsfalse.- Parameters:
annotation- the annotation in question.- Returns:
- whether references are meaningful for this annotation.
-
getValidReferences
Returns the filtered collection of references that are valid for this annotation.The implementation delegates to
BasicAnnotationValidator.getValidReferences(Annotation, ModelElement, Collection), passing in thecontaining model element. An induced user interface should provide the ability to specify only the references returned by this method. The references argument may contain all reachable objects, some subset there of, or none at all; an implementation may choose to filter from this collection or to provide its own result, including objects not in this collection.- Parameters:
annotation- the annotation in question.references- all reachable objects, some subset there of, or none at all.- Returns:
- the objects that are valid as references for this annotation.
-
isContentsSupported
Returns whethercontentsare meaningful for this annotation.The implementation delegates to
BasicAnnotationValidator.isContentsSupported(Annotation, ModelElement), passing in thecontainingmodel element and an empty list. An induced user interface should avoid providing the ability to specify contents when this returnsfalse.- Parameters:
annotation- the annotation in question.- Returns:
- whether contents are meaningful for this annotation.
-
getValidContents
public Collection<? extends EObject> getValidContents(Annotation annotation, Collection<? extends EObject> contents) Returns the filtered collection of contents that are valid for this annotation.The implementation delegates to
BasicAnnotationValidator.getValidContents(Annotation, ModelElement, Collection)passing in thecontainingmodel element. An induced user interface should provide the ability to specify only the contents returned by this method.- Parameters:
annotation- the annotation in question.contents- nothing at all, or thepotential contentsof the annotation.- Returns:
- the objects that are valid as contents for this annotation.
-
isAnnotationsSupported
Returns whethernested annotationsare meaningful for this annotation.The implementation delegates to
BasicAnnotationValidator.isAnnotationsSupported(Annotation, ModelElement), passing in thecontaining model element. An induced user interface should avoid providing the ability to specify nested annotations when this returnsfalse.- Parameters:
annotation- the annotation in question.- Returns:
- whether annotations are meaningful for this annotation.
-
getValidAnnotations
public Collection<? extends Annotation> getValidAnnotations(Annotation annotation, Collection<? extends Annotation> annotations) Returns the filtered collection of nested annotations that are valid for this annotation.The implementation delegates to
BasicAnnotationValidator.getAllValidAnnotations(Annotation, ModelElement, Collection)passing in thecontainingmodel element. An induced user interface should provide the ability to specify only the nested annotations returned by this method.- Parameters:
annotation- the annotation in question.annotations- nothing at all, or thecurrent or potential nested annotationsof the annotation.- Returns:
- the annotations that are valid as nested annotations for this annotation.
-