org.progeeks.meta.view
Class MetaFormRegistry

java.lang.Object
  extended by org.progeeks.meta.view.MetaFormRegistry

public class MetaFormRegistry
extends java.lang.Object

Provides extended access for looking up meta-forms by flavor from type registries or as annotations. The order of searching tries to take the closest definition into account when possible and goes as follows:

  1. search local registry for an exact flavor match
  2. search parent registry for an exact flavor match
  3. search meta-class annotations for an exact flavor match
  4. perform steps 1-3 on the parent flavor
  5. return the identity form

Version:
$Revision: 1.3 $
Author:
Paul Speed

Constructor Summary
MetaFormRegistry()
          Creates a new root-level meta-form registry that will delegate to the context annotation manager if necessary.
MetaFormRegistry(MetaFormRegistry parent)
          Creates a meta-form registry that will delegate to the specified meta-form registry before returning arbitrary default forms.
 
Method Summary
 void addMetaForm(MetaForm form, MetaFormFlavor flavor)
          Adds a MetaForm that will be registered to its associated MetaClass and the specified flavor.
protected  MetaForm findForm(MetaClassPropertyType type, MetaFormFlavor flavor)
          Performs the meta-form searching by type and flavor.
protected  MetaForm findLocalForm(MetaClassPropertyType type, MetaFormFlavor flavor)
          Searches the local registry for an exact match for the specified type and flavor.
protected  TypeRegistry getFormRegistry(MetaFormFlavor flavor, boolean create)
          Returns the form registry for the specified form flavor, creating one if specified and no current registry exists.
 MetaForm getMetaForm(MetaClass type, MetaFormFlavor flavor)
          Searches for a form matching the specified meta-class and flavor by performing a search in the following order: search local registry for an exact flavor match search parent registry for an exact flavor match search meta-class annotations for an exact flavor match perform steps 1-3 on the parent flavor return the identity form
 MetaForm getMetaForm(PropertyType type, MetaFormFlavor flavor)
          Searches for a form matching the specified type and flavor by performing a search in the following order: search local registry for an exact flavor match search parent registry for an exact flavor match search meta-class annotations for an exact flavor match perform steps 1-3 on the parent flavor return the identity form
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaFormRegistry

public MetaFormRegistry()
Creates a new root-level meta-form registry that will delegate to the context annotation manager if necessary.


MetaFormRegistry

public MetaFormRegistry(MetaFormRegistry parent)
Creates a meta-form registry that will delegate to the specified meta-form registry before returning arbitrary default forms.

Method Detail

getFormRegistry

protected TypeRegistry getFormRegistry(MetaFormFlavor flavor,
                                       boolean create)
Returns the form registry for the specified form flavor, creating one if specified and no current registry exists.


addMetaForm

public void addMetaForm(MetaForm form,
                        MetaFormFlavor flavor)
Adds a MetaForm that will be registered to its associated MetaClass and the specified flavor.


getMetaForm

public MetaForm getMetaForm(MetaClass type,
                            MetaFormFlavor flavor)
Searches for a form matching the specified meta-class and flavor by performing a search in the following order:
  1. search local registry for an exact flavor match
  2. search parent registry for an exact flavor match
  3. search meta-class annotations for an exact flavor match
  4. perform steps 1-3 on the parent flavor
  5. return the identity form


getMetaForm

public MetaForm getMetaForm(PropertyType type,
                            MetaFormFlavor flavor)
Searches for a form matching the specified type and flavor by performing a search in the following order:
  1. search local registry for an exact flavor match
  2. search parent registry for an exact flavor match
  3. search meta-class annotations for an exact flavor match
  4. perform steps 1-3 on the parent flavor
  5. return the identity form

Throws:
java.lang.IllegalArgumentException - if the specified property type is not a MetaClassPropertyType.

findLocalForm

protected MetaForm findLocalForm(MetaClassPropertyType type,
                                 MetaFormFlavor flavor)
Searches the local registry for an exact match for the specified type and flavor.


findForm

protected MetaForm findForm(MetaClassPropertyType type,
                            MetaFormFlavor flavor)
Performs the meta-form searching by type and flavor.



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