|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
B - the bean type for which fields will be generatedC - an extension of the bean type. The generated fields may depend on
fields defined only by the extension, even though extension-only
fields themselves will not be generated.public interface GeneratorMap<B>
A registry of field generators for bean. A registry has a simple life cycle:
buildGeneratorMap(FieldDependencyManager) method.
The registry is used by calling the getInstance(String),
getMemberNames() or the getSequencedFields() methods.
The registry is discarded and garbage collected.
CreationException or ProcessingException,
as appropriate, if a method can not be completed successfully or if it is
called at an inappropriate point in the life cycle.
| Method Summary | |
|---|---|
void |
buildGeneratorMap(FieldDependencyManager<B> fdm)
Initializes an instance. |
FieldGenerator<B,?> |
getInstance(String name)
Returns the specified generator from this map, or null if a generator has not been registered for the specified field name. |
Set<String> |
getMemberNames()
Provides unchecked, read-only access to the (unordered) set of names of the fields maintained by this instance. |
List<String> |
getSequencedFields()
Provides validated, read-only access to the field sequence maintained by this instance. |
boolean |
isMapBuilt()
Checks whether a map has been successfully initialized |
| Method Detail |
|---|
void buildGeneratorMap(FieldDependencyManager<B> fdm)
throws CreationException
getInstance(String),
getMemberNames() or the getSequencedFields() methods.
This method should check to see if a map has already been initialized. If
not, it should try to initialize it and if successful, ensure that the
isMapBuilt() method will return true subsequently. If a map has
already been built, this method should have no effect.
fdm - the DefaultFieldDependencyManager used by this GeneratorMap
CreationException - Subclasses must throw a CreationException if the method is
unable to build a valid generator mapboolean isMapBuilt()
List<String> getSequencedFields()
throws ProcessingException
ProcessingException - if this method is invoked before a map is initialized.buildGeneratorMap(FieldDependencyManager);,
isMapBuilt()
Set<String> getMemberNames()
throws CreationException
buildGeneratorMap(FieldDependencyManager) method. Subclasses
may throw a CreationException if this method is invoked after a map is
initialized.
Clients should not use this method; instead they should access the
generators in this map in a prescribed sequence using the
getSequencedFields() method.
CreationException - if this method is after a map is initialized.buildGeneratorMap(FieldDependencyManager);,
isMapBuilt()
FieldGenerator<B,?> getInstance(String name)
throws CreationException
name - a non-null, non-blank field name
CreationException - if this method is invoked before a map is initialized.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||