org.progeeks.meta.view
Class MetaFormAnnotationMap

java.lang.Object
  extended by org.progeeks.meta.annotate.DefaultAnnotationMap
      extended by org.progeeks.meta.view.MetaFormAnnotationMap
All Implemented Interfaces:
AnnotationMap

public class MetaFormAnnotationMap
extends DefaultAnnotationMap

Specialized AnnotationMap the does internal management of the MetaForms to provide cleaner access to the information. For example, meta-form flavors associated with a property will automatically be factored into the class-level MetaForm when possible. Also, queries about a properties meta-form annotations will be backed by the real class-level MetaForm even if the form wasn't actually created that way. To get this implementation in place, I've temporarily assumed all MetaForms are DefaultMetaForm. We'll refactor as necessary to support different implementations later.

Version:
$Revision: 1.3 $
Author:
Paul Speed

Constructor Summary
MetaFormAnnotationMap()
           
 
Method Summary
 java.lang.Object getAnnotation(java.lang.Object key)
          Returns the annotation associated with the specified key.
 boolean isKeySupported(java.lang.Object key)
          Returns true if the specified key matches the MetaForm key scheme.
 void setAnnotation(java.lang.Object key, java.lang.Object annotation)
          Sets the annotation object associated with the specified key.
protected  void setMetaClassForm(CompositeKey key, MetaForm form)
           
protected  void setPropertyFlavor(PropertyKey key, MetaFormFlavor flavor)
           
 
Methods inherited from class org.progeeks.meta.annotate.DefaultAnnotationMap
getAnnotationManager, isMutable, setAnnotationManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaFormAnnotationMap

public MetaFormAnnotationMap()
Method Detail

getAnnotation

public java.lang.Object getAnnotation(java.lang.Object key)
Returns the annotation associated with the specified key. Specific implementations may use delegation to parent annotation maps to resolve these references.

Specified by:
getAnnotation in interface AnnotationMap
Overrides:
getAnnotation in class DefaultAnnotationMap

setAnnotation

public void setAnnotation(java.lang.Object key,
                          java.lang.Object annotation)
                   throws ImmutableAnnotationMapException,
                          UnsupportedKeyException
Sets the annotation object associated with the specified key.

Specified by:
setAnnotation in interface AnnotationMap
Overrides:
setAnnotation in class DefaultAnnotationMap
Throws:
ImmutableAnnotationMapException - when the underlying implementation does not support adding or updating annotations. This can be the case for algorithmic annotations or for any annotations that cannot be changed at runtime.
UnsupportedKeyException

setMetaClassForm

protected void setMetaClassForm(CompositeKey key,
                                MetaForm form)

setPropertyFlavor

protected void setPropertyFlavor(PropertyKey key,
                                 MetaFormFlavor flavor)

isKeySupported

public boolean isKeySupported(java.lang.Object key)
Returns true if the specified key matches the MetaForm key scheme.

Specified by:
isKeySupported in interface AnnotationMap
Overrides:
isKeySupported in class DefaultAnnotationMap


Copyright © 2002-2003 Paul Speed. All Rights Reserved.