public abstract static class BasicEAnnotationValidator.Assistant
extends java.lang.Object
modeled objects
that are created by createInstance(EClass, EAnnotation)
.
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.Modifier and Type | Field and Description |
---|---|
protected BasicEAnnotationValidator |
eAnnotationValidator
The annotation validator to which this assistant delegates.
|
Constructor and Description |
---|
Assistant(BasicEAnnotationValidator eAnnotationValidator)
Creates an instance that delegates to the give annotation validator.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
convertPropertyValueToLiteral(EObject eObject,
EStructuralFeature eStructuralFeature,
java.lang.Object value) |
EObject |
createInstance(EClass eClass,
EAnnotation eAnnotation)
Creates an initialized instance of the modeled representation for the given annotation.
|
java.util.Map<java.lang.String,EStructuralFeature> |
getApplicableProperties(EObject eObject,
EAnnotation eAnnotation)
Returns the
subset of properties that are applicable for the current state of the modeled annotation instance. |
java.util.Map<java.lang.String,EStructuralFeature> |
getProperties(EModelElement eModelElement)
Returns a map from key to
feature . |
java.util.List<EClass> |
getPropertyClasses(EModelElement eModelElement)
Returns the model classes used to represent annotations for the given model element.
|
java.util.Collection<? extends EAnnotation> |
getValidAnnotations(EAnnotation eAnnotation,
java.util.Collection<? extends EAnnotation> annotations)
Returns the filtered collection of nested annotations that are valid for this annotation.
|
java.util.Collection<? extends EObject> |
getValidContents(EAnnotation eAnnotation,
java.util.Collection<? extends EObject> contents)
Returns the filtered collection of contents that are valid for this annotation.
|
java.util.Collection<?> |
getValidReferences(EAnnotation eAnnotation,
java.util.Collection<?> references)
Returns the filtered collection of references that are valid for this annotation.
|
boolean |
isAnnotationsSupported(EAnnotation eAnnotation)
Returns whether
nested annotations are meaningful for this annotation. |
boolean |
isContentsSupported(EAnnotation eAnnotation)
Returns whether
contents are meaningful for this annotation. |
boolean |
isReferencesSupported(EAnnotation eAnnotation)
Returns whether
references are meaningful for this annotation. |
boolean |
isValidLocation(EAnnotation eAnnotation)
Returns whether this annotation with this annotation validator's
annotation source is valid at its current location . |
protected final BasicEAnnotationValidator eAnnotationValidator
public Assistant(BasicEAnnotationValidator eAnnotationValidator)
public boolean isValidLocation(EAnnotation eAnnotation)
annotation source
is valid at its current location
.
The implementation delegates to BasicEAnnotationValidator.isValidLocation(EAnnotation)
.
An induced user interface can use this to determine if it can/should use this assistant's information for representing modeled annotation information.
eAnnotation
- the annotation in question.public java.util.Map<java.lang.String,EStructuralFeature> getProperties(EModelElement eModelElement)
feature
.
These represents the keys that are considered valid and can be processed by this annotation validator.
The implementation delegates to BasicEAnnotationValidator.getProperties(EModelElement)
.
An induced user interface can use this method to determine which properties to display.
eModelElement
- the model element that is being annotated.getApplicableProperties(EObject, EAnnotation)
public java.util.List<EClass> getPropertyClasses(EModelElement eModelElement)
The implementation delegates to BasicEAnnotationValidator.getPropertyClasses(EModelElement)
.
An induced user interface can use this method to determine which instances to create for display purposes.
eModelElement
- the model element in question.public EObject createInstance(EClass eClass, EAnnotation eAnnotation)
The implementation delegates to BasicEAnnotationValidator.createInstance(EClass, EAnnotation)
.
An induced user interface can use this method to create instances for display purposes.
eClass
- the class to be instantiated.eAnnotation
- the annotation with the information that needs to be represented.public java.lang.String convertPropertyValueToLiteral(EObject eObject, EStructuralFeature eStructuralFeature, java.lang.Object value)
public java.util.Map<java.lang.String,EStructuralFeature> getApplicableProperties(EObject eObject, EAnnotation eAnnotation)
subset of properties
that are applicable for the current state of the modeled annotation instance.
This subset includes only those properties of the annotation's containing
model element
for which BasicEAnnotationValidator.isApplicable(EObject, EStructuralFeature)
returns true
.
An induced user interface should avoid displaying properties that are not applicable for the current state of the modeled annotation instance.
eObject
- the modeled instance in question.eAnnotation
- the corresponding annotation of that modeled instance.public boolean isReferencesSupported(EAnnotation eAnnotation)
references
are meaningful for this annotation.
The implementation delegates to BasicEAnnotationValidator.isReferencesSupported(EAnnotation, EModelElement)
,
passing in the containing
model element.
An induced user interface should avoid providing the ability to specify references when this returns false
.
eAnnotation
- the annotation in question.public java.util.Collection<?> getValidReferences(EAnnotation eAnnotation, java.util.Collection<?> references)
The implementation delegates to BasicEAnnotationValidator.getValidReferences(EAnnotation, EModelElement, Collection)
, passing in the containing 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.
eAnnotation
- the annotation in question.references
- all reachable objects, some subset there of, or none at all.public boolean isContentsSupported(EAnnotation eAnnotation)
contents
are meaningful for this annotation.
The implementation delegates to BasicEAnnotationValidator.isContentsSupported(EAnnotation, EModelElement)
,
passing in the containing
model element and an empty list.
An induced user interface should avoid providing the ability to specify contents when this returns false
.
eAnnotation
- the annotation in question.public java.util.Collection<? extends EObject> getValidContents(EAnnotation eAnnotation, java.util.Collection<? extends EObject> contents)
The implementation delegates to BasicEAnnotationValidator.getValidContents(EAnnotation, EModelElement, Collection)
passing in the containing
model element.
An induced user interface should provide the ability to specify only the contents returned by this method.
eAnnotation
- the annotation in question.contents
- nothing at all, or the potential contents
of the annotation.public boolean isAnnotationsSupported(EAnnotation eAnnotation)
nested annotations
are meaningful for this annotation.
The implementation delegates to BasicEAnnotationValidator.isAnnotationsSupported(EAnnotation, EModelElement)
, passing in the containing model element
.
An induced user interface should avoid providing the ability to specify nested annotations when this returns false
.
eAnnotation
- the annotation in question.public java.util.Collection<? extends EAnnotation> getValidAnnotations(EAnnotation eAnnotation, java.util.Collection<? extends EAnnotation> annotations)
The implementation delegates to BasicEAnnotationValidator.getAllValidAnnotations(EAnnotation, EModelElement, Collection)
passing in the containing
model element.
An induced user interface should provide the ability to specify only the nested annotations returned by this method.
eAnnotation
- the annotation in question.annotations
- nothing at all, or the current or potential nested annotations
of the annotation.Copyright © 2022. Licensed under the Eclipse Public License v2.0. All rights reserved.
Submit a bug or feature