org.apache.myfaces.orchestra.dynaForm.metadata
Interface MetaDataWritable

All Superinterfaces:
MetaData
All Known Implementing Classes:
MetaDataImpl

public interface MetaDataWritable
extends MetaData

A writable implementation of the MetaData interface that is initialised by Extractor objects, and then read by other objects that need information about the available properties.

An instance of this class is created and then passed to a list of one or more Extractor objects, together with a source object to be introspected. The extractor instances deduce information about fields of the source object and then add or update MetaField objects held by the MetaDataImpl.

An instance of MetaDataImpl is then typically cast to the read-only MetaData interface type and passed to objects that make use of the gathered metadata, such as dynaform "gui builders".


Method Summary
 MetaField getField(String name)
          get the field by name
 int getFieldCount()
          number of fields
 String[] getFieldNames()
          get all fields names
 MetaFieldWritable getOrCreateField(String name)
          add a new field to the metadata or return one if one already exists for the given name
 Set<String> getRequestedFields()
           
 boolean isParentOfWantedField(String name)
          // we processed this field due to the fact that it was the parent of a requestedField should this field be processed.
 boolean isWantedField(String name)
          Indicate whether the field with the specified name should be used or ignored.
 Iterator<String> iterFieldNames()
          iterate through fields
 void requestField(String name)
          request to add this field if we reach it.
 boolean setLockFields(boolean lockFields)
          Prevent the adding of any new MetaField objects to this instance (but enhancing existing fields is permitted).
 

Method Detail

isWantedField

boolean isWantedField(String name)
Indicate whether the field with the specified name should be used or ignored.

See Also:
setLockFields(boolean)

isParentOfWantedField

boolean isParentOfWantedField(String name)
// we processed this field due to the fact that it was the parent of a requestedField should this field be processed.

Returns:
true if the given name is the parent of one of the requestedFields
See Also:
#processField(String), setLockFields(boolean)

requestField

void requestField(String name)
request to add this field if we reach it. eg. used to trigger traversing the object graph for linked entities

Name may be of form "foo.bar.baz"


getRequestedFields

Set<String> getRequestedFields()

getOrCreateField

MetaFieldWritable getOrCreateField(String name)
add a new field to the metadata or return one if one already exists for the given name


getFieldCount

int getFieldCount()
Description copied from interface: MetaData
number of fields

Specified by:
getFieldCount in interface MetaData

iterFieldNames

Iterator<String> iterFieldNames()
Description copied from interface: MetaData
iterate through fields

Specified by:
iterFieldNames in interface MetaData

getField

MetaField getField(String name)
Description copied from interface: MetaData
get the field by name

Specified by:
getField in interface MetaData

getFieldNames

String[] getFieldNames()
Description copied from interface: MetaData
get all fields names

Specified by:
getFieldNames in interface MetaData

setLockFields

boolean setLockFields(boolean lockFields)
Prevent the adding of any new MetaField objects to this instance (but enhancing existing fields is permitted).

When set to true, any call to isProcessableField will return false for names that are not already known, and getOrCreateField will throw an exception if the field does not exist.



Copyright © 2012 The Apache Software Foundation. All Rights Reserved.