Package org.eclipse.emf.cdo.etypes.util

# Klasse BasicAnnotationValidator.Assistant

java.lang.Object
org.eclipse.emf.cdo.etypes.util.BasicAnnotationValidator.Assistant

Umschließende Klasse:
  `BasicAnnotationValidator`

public abstract static class BasicAnnotationValidator.Assistant extends Object
An assistant that is useful for inducing a user interface that represents the annotation information in a more structured way using `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.

## Feldübersicht

Felder
Modifizierer und Typ
Feld
Beschreibung
`protected final BasicAnnotationValidator`
`annotationValidator`
The annotation validator to which this assistant delegates.

## Konstruktorübersicht

Konstruktoren
Konstruktor
Beschreibung
`Assistant(BasicAnnotationValidator annotationValidator)`
Creates an instance that delegates to the give annotation validator.

## Methodenübersicht

Modifizierer und Typ
Methode
Beschreibung
`String`
`convertPropertyValueToLiteral(EObject eObject, EStructuralFeature eStructuralFeature, Object value)`
`EObject`
`createInstance(EClass eClass, Annotation annotation)`
Creates an initialized instance of the modeled representation for the given annotation.
`Map<String,EStructuralFeature>`
`getApplicableProperties(EObject eObject, Annotation annotation)`
Returns the `subset of properties` that are applicable for the current state of the modeled annotation instance.
`Map<String,EStructuralFeature>`
`getProperties(ModelElement modelElement)`
Returns a map from key to `feature`.
`List<EClass>`
`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.
`boolean`
`isAnnotationsSupported(Annotation annotation)`
Returns whether `nested annotations` are meaningful for this annotation.
`boolean`
`isContentsSupported(Annotation annotation)`
Returns whether `contents` are meaningful for this annotation.
`boolean`
`isReferencesSupported(Annotation annotation)`
Returns whether `references` are meaningful for this annotation.
`boolean`
`isValidLocation(Annotation annotation)`
Returns whether this annotation with this annotation validator's `annotation source` is valid at its `current location`.

### Von Klasse geerbte Methoden java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Felddetails

### annotationValidator

protected final BasicAnnotationValidator annotationValidator
The annotation validator to which this assistant delegates.

## Konstruktordetails

### Assistant

public Assistant(BasicAnnotationValidator annotationValidator)
Creates an instance that delegates to the give annotation validator.

## Methodendetails

### isValidLocation

public boolean isValidLocation(Annotation annotation)
Returns whether this annotation with this annotation validator's `annotation source` is valid at its `current 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.

Parameter:
  `annotation` - the annotation in question.
Gibt zurück:
  whether this annotation with this annotation validator's annotation source is valid at its current location.

### getProperties

public Map<String,EStructuralFeature> getProperties(ModelElement modelElement)
Returns a map from key to `feature`. 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.

Parameter:
  `modelElement` - the model element that is being annotated.
Gibt zurück:
  a map from key to feature.
Siehe auch:
  - `getApplicableProperties(EObject, Annotation)`

### getPropertyClasses

public List<EClass> getPropertyClasses(ModelElement modelElement)
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.

Parameter:
  `modelElement` - the model element in question.
Gibt zurück:
  the model classes used to represent annotations for the given model element.

### createInstance

public EObject createInstance(EClass eClass, Annotation annotation)
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.

Parameter:
  `eClass` - the class to be instantiated.
  `annotation` - the annotation with the information that needs to be represented.
Gibt zurück:
  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 the `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 `BasicAnnotationValidator.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.

Parameter:
  `eObject` - the modeled instance in question.
  `annotation` - the corresponding annotation of that modeled instance.
Gibt zurück:
  the subset of properties that are applicable for the current state of the modeled annotation instance.

### isReferencesSupported

public boolean isReferencesSupported(Annotation annotation)
Returns whether `references` are meaningful for this annotation.

The implementation delegates to `BasicAnnotationValidator.isReferencesSupported(Annotation, ModelElement)`, passing in the `containing` model element. An induced user interface should avoid providing the ability to specify references when this returns `false`.

Parameter:
  `annotation` - the annotation in question.
Gibt zurück:
  whether references are meaningful for this annotation.

### getValidReferences

public Collection<?> getValidReferences(Annotation annotation, Collection<?> references)
Returns the filtered collection of references that are valid for this annotation.

The implementation delegates to `BasicAnnotationValidator.getValidReferences(Annotation, ModelElement, 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.

Parameter:
  `annotation` - the annotation in question.
  `references` - all reachable objects, some subset there of, or none at all.
Gibt zurück:
  the objects that are valid as references for this annotation.

### isContentsSupported

public boolean isContentsSupported(Annotation annotation)
Returns whether `contents` are meaningful for this annotation.

The implementation delegates to `BasicAnnotationValidator.isContentsSupported(Annotation, ModelElement)`, 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`.

Parameter:
  `annotation` - the annotation in question.
Gibt zurück:
  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 the `containing` model element. An induced user interface should provide the ability to specify only the contents returned by this method.

Parameter:
  `annotation` - the annotation in question.
  `contents` - nothing at all, or the `potential contents` of the annotation.
Gibt zurück:
  the objects that are valid as contents for this annotation.

### isAnnotationsSupported

public boolean isAnnotationsSupported(Annotation annotation)
Returns whether `nested annotations` are meaningful for this annotation.

The implementation delegates to `BasicAnnotationValidator.isAnnotationsSupported(Annotation, ModelElement)`, passing in the `containing model element`. An induced user interface should avoid providing the ability to specify nested annotations when this returns `false`.

Parameter:
  `annotation` - the annotation in question.
Gibt zurück:
  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 the `containing` model element. An induced user interface should provide the ability to specify only the nested annotations returned by this method.

Parameter:
  `annotation` - the annotation in question.
  `annotations` - nothing at all, or the `current or potential nested annotations` of the annotation.
Gibt zurück:
  the annotations that are valid as nested annotations for this annotation.