org.araneaframework.backend.list.helper.fields
Class StandardFields

java.lang.Object
  extended byorg.araneaframework.backend.list.helper.fields.StandardFields
All Implemented Interfaces:
Fields

public class StandardFields
extends Object
implements Fields

List of fields standard implementation.

All the fields are presented both in the SELECT and in the ResultSet.

Fields can be added/removed either:

For each add/remove call a prefixcan be set. Prefix should refer to a composite field in a Bean (containing another Bean).

Example use:

 ListSqlHelper helper = ...
 StandardFields sf = helper.getStandardFields();
 sf.addField("name");				// add "name"
 sf.addField("birthdate");				// add "birthdate"
 sf.addField("address", "town");			// add "address.town"
 sf.addField("address", "zip");			// add "address.zip"
 sf.addField("org", Organization.class);		// add all fields of Organization.class as sub-fields
 Modifier.addListFields(sf.subFields("modifier"));	// let Mofifier.class add it's common fields
 

Since:
1.1
Author:
Rein Raudjärv
See Also:
Fields, ListSqlHelper.getStandardFields()

Constructor Summary
StandardFields()
          Create an instance of StandardFields using an empty set of fields.
StandardFields(Collection fields)
          Create an instance of StandardFields using the specified set of fields..
StandardFields(ListStructure structure)
          Create an instance of StandardFields using the set of fields defined by the ListStructure.
StandardFields(StandardFields parent, String globalPrefix)
          Create an instance of StandardFields extending the set of fields of another StandardFields instance and using the globalPrefix to all the fields added.
 
Method Summary
 StandardFields addField(String field)
           
 StandardFields addField(String prefix, String field)
           
 StandardFields addFields(Class beanClass)
           
 StandardFields addFields(Collection fields)
           
 StandardFields addFields(ListStructure structure)
           
 StandardFields addFields(String[] fields)
           
 StandardFields addFields(String prefix, Class beanClass)
           
 StandardFields addFields(String prefix, Collection fields)
           
 StandardFields addFields(String prefix, String[] fields)
           
 Collection getNames()
          Return the list of fields used in SELECT.
 Collection getResultSetNames()
          Return the list of fields read from the ResultSet.
 StandardFields removeField(String field)
           
 StandardFields removeField(String prefix, String field)
           
 StandardFields removeFields(Class beanClass)
           
 StandardFields removeFields(Collection fields)
           
 StandardFields removeFields(String[] fields)
           
 StandardFields removeFields(String prefix, Class beanClass)
           
 StandardFields removeFields(String prefix, Collection fields)
           
 StandardFields removeFields(String prefix, String[] fields)
           
 StandardFields subFields(String globalPrefix)
          Create an instance of StandardFields extending the set of fields of another StandardFields instance and using the globalPrefix to all the fields added.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardFields

public StandardFields()
Create an instance of StandardFields using an empty set of fields.


StandardFields

public StandardFields(StandardFields parent,
                      String globalPrefix)
Create an instance of StandardFields extending the set of fields of another StandardFields instance and using the globalPrefix to all the fields added.


StandardFields

public StandardFields(Collection fields)
Create an instance of StandardFields using the specified set of fields..


StandardFields

public StandardFields(ListStructure structure)
Create an instance of StandardFields using the set of fields defined by the ListStructure.

Method Detail

subFields

public StandardFields subFields(String globalPrefix)
Create an instance of StandardFields extending the set of fields of another StandardFields instance and using the globalPrefix to all the fields added.


addField

public StandardFields addField(String prefix,
                               String field)

removeField

public StandardFields removeField(String prefix,
                                  String field)

addFields

public StandardFields addFields(String prefix,
                                Collection fields)

removeFields

public StandardFields removeFields(String prefix,
                                   Collection fields)

addFields

public StandardFields addFields(String prefix,
                                String[] fields)

removeFields

public StandardFields removeFields(String prefix,
                                   String[] fields)

addField

public StandardFields addField(String field)

removeField

public StandardFields removeField(String field)

addFields

public StandardFields addFields(ListStructure structure)

addFields

public StandardFields addFields(Collection fields)

removeFields

public StandardFields removeFields(Collection fields)

addFields

public StandardFields addFields(String[] fields)

removeFields

public StandardFields removeFields(String[] fields)

addFields

public StandardFields addFields(Class beanClass)

removeFields

public StandardFields removeFields(Class beanClass)

addFields

public StandardFields addFields(String prefix,
                                Class beanClass)

removeFields

public StandardFields removeFields(String prefix,
                                   Class beanClass)

getNames

public Collection getNames()
Description copied from interface: Fields
Return the list of fields used in SELECT.

Specified by:
getNames in interface Fields
Returns:
List<String> the names of the fields used in SELECT.

getResultSetNames

public Collection getResultSetNames()
Description copied from interface: Fields
Return the list of fields read from the ResultSet.

Specified by:
getResultSetNames in interface Fields
Returns:
List<String> the names of the fields read from the ResultSet.