org.apache.myfaces.custom.dynaForm.metadata
Class MetaData

java.lang.Object
  extended by org.apache.myfaces.custom.dynaForm.metadata.MetaData
All Implemented Interfaces:
MetaDataInterface

public class MetaData
extends java.lang.Object
implements MetaDataInterface

Holds all the metadata


Nested Class Summary
static class MetaData.FieldImpl
          Metadata for a field
 
Constructor Summary
MetaData()
           
 
Method Summary
 FieldInterface getField(java.lang.String name)
          get the field by name
 int getFieldCount()
          number of fields
 java.lang.String[] getFieldNames()
          get all fields names
 MetaData.FieldImpl getOrCreateField(java.lang.String name)
          add a new field to the metadata or return one if one already exists for the given name
 java.util.Set<java.lang.String> getRequestedFields()
           
 java.util.Iterator<java.lang.String> iterFieldNames()
          iterate through fields
 boolean processField(java.lang.String name)
          should this field be processed
 boolean processFieldParent(java.lang.String name)
          should this field be processed.
 void requestField(java.lang.String name)
          request to add this field if we reach it.
 boolean setLockFields(boolean lockFields)
          if set to true this avoids any field to be newly created, only already existent fields are to be processed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaData

public MetaData()
Method Detail

processField

public boolean processField(java.lang.String name)
should this field be processed

See Also:
setLockFields(boolean)

processFieldParent

public boolean processFieldParent(java.lang.String name)
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

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


getRequestedFields

public java.util.Set<java.lang.String> getRequestedFields()

getOrCreateField

public MetaData.FieldImpl getOrCreateField(java.lang.String name)
add a new field to the metadata or return one if one already exists for the given name


getFieldCount

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

Specified by:
getFieldCount in interface MetaDataInterface

iterFieldNames

public java.util.Iterator<java.lang.String> iterFieldNames()
Description copied from interface: MetaDataInterface
iterate through fields

Specified by:
iterFieldNames in interface MetaDataInterface

getField

public FieldInterface getField(java.lang.String name)
Description copied from interface: MetaDataInterface
get the field by name

Specified by:
getField in interface MetaDataInterface

getFieldNames

public java.lang.String[] getFieldNames()
Description copied from interface: MetaDataInterface
get all fields names

Specified by:
getFieldNames in interface MetaDataInterface

setLockFields

public boolean setLockFields(boolean lockFields)
if set to true this avoids any field to be newly created, only already existent fields are to be processed



Copyright © 2011. All Rights Reserved.