org.kuali.rice.kew.framework.document.search
Class DocumentSearchResultSetConfiguration.Builder

java.lang.Object
  extended by org.kuali.rice.kew.framework.document.search.DocumentSearchResultSetConfiguration.Builder
All Implemented Interfaces:
Serializable, ModelBuilder, DocumentSearchResultSetConfigurationContract
Enclosing class:
DocumentSearchResultSetConfiguration

public static final class DocumentSearchResultSetConfiguration.Builder
extends Object
implements Serializable, ModelBuilder, DocumentSearchResultSetConfigurationContract

A builder which can be used to construct DocumentSearchResultSetConfiguration instances. Enforces the constraints of the DocumentSearchResultSetConfigurationContract.

See Also:
Serialized Form

Method Summary
 DocumentSearchResultSetConfiguration build()
          Returns an instance of the object being built by this builder based on the current state of the builder.
static DocumentSearchResultSetConfiguration.Builder create()
          Creates new empty builder instance.
static DocumentSearchResultSetConfiguration.Builder create(DocumentSearchResultSetConfigurationContract contract)
          Creates a new builder instance initialized with copies of the properties from the given contract.
 List<RemotableAttributeField.Builder> getAdditionalAttributeFields()
          Gets attribute field definitions for additional attributes that may be displayed in the result set.
 List<String> getCustomFieldNamesToAdd()
          Returns a list of field names of custom fields representing document attributes which should be added to the result set.
 List<StandardResultField> getStandardResultFieldsToRemove()
          Returns a list of the standard (built-in) document search result fields which should not be displayed in the result set.
 boolean isOverrideSearchableAttributes()
          Returns true if the custom field names returned by DocumentSearchResultSetConfigurationContract.getCustomFieldNamesToAdd() should be used to define the order of searchable attributes as well as additional custom additional fields.
 void setAdditionalAttributeFields(List<RemotableAttributeField.Builder> additionalAttributeFields)
           
 void setCustomFieldNamesToAdd(List<String> customFieldNamesToAdd)
           
 void setOverrideSearchableAttributes(boolean overrideSearchableAttributes)
           
 void setStandardResultFieldsToRemove(List<StandardResultField> standardResultFieldsToRemove)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static DocumentSearchResultSetConfiguration.Builder create()
Creates new empty builder instance. The various lists on this builder are initialized to empty lists. The overrideSearchableAttribute boolean property is initialized to "false".

Returns:
a new empty builder instance

create

public static DocumentSearchResultSetConfiguration.Builder create(DocumentSearchResultSetConfigurationContract contract)
Creates a new builder instance initialized with copies of the properties from the given contract.

Parameters:
contract - the contract from which to copy properties
Returns:
a builder instance initialized with properties from the given contract
Throws:
IllegalArgumentException - if the given contract is null

build

public DocumentSearchResultSetConfiguration build()
Description copied from interface: ModelBuilder
Returns an instance of the object being built by this builder based on the current state of the builder. It should be possible to invoke this method more than once on the same builder. It should never return null;

Specified by:
build in interface ModelBuilder
Returns:
an instance of the object being built by this builder, should never return null

isOverrideSearchableAttributes

public boolean isOverrideSearchableAttributes()
Description copied from interface: DocumentSearchResultSetConfigurationContract
Returns true if the custom field names returned by DocumentSearchResultSetConfigurationContract.getCustomFieldNamesToAdd() should be used to define the order of searchable attributes as well as additional custom additional fields. Returns false if any searchable attribute values should be included in the result set according to their existing configuration.

Specified by:
isOverrideSearchableAttributes in interface DocumentSearchResultSetConfigurationContract
Returns:
true if custom field names defined by this object should override any default searchable attribute result field display behavior, flase if searchable attribute fields should still be displayed in the result set according to their own configuration

getCustomFieldNamesToAdd

public List<String> getCustomFieldNamesToAdd()
Description copied from interface: DocumentSearchResultSetConfigurationContract
Returns a list of field names of custom fields representing document attributes which should be added to the result set. This may contains fields that are defined in DocumentSearchResultSetConfigurationContract.getAdditionalAttributeFields() or also fields defined as part of a SearchableAttribute (see isOverrideSearchableAttributes()).

Specified by:
getCustomFieldNamesToAdd in interface DocumentSearchResultSetConfigurationContract
Returns:
a list of field names of custom document attributes which should be added to the result set, can be an empty or null list in which case no fields will be added

getStandardResultFieldsToRemove

public List<StandardResultField> getStandardResultFieldsToRemove()
Description copied from interface: DocumentSearchResultSetConfigurationContract
Returns a list of the standard (built-in) document search result fields which should not be displayed in the result set. The document search implementation should do it's best to honor the request to remove standard fields from the result set, but it is free to ignore such requests if needed. An example of this would be a preference for the implementation of document search that requires certain result set fields to remain (such as the document id and route log which is usually recommended to display).

Specified by:
getStandardResultFieldsToRemove in interface DocumentSearchResultSetConfigurationContract
Returns:
a list of standard result fields to remove from inclusion in the result set, may be an empty or null list if no standard result fields should be removed

getAdditionalAttributeFields

public List<RemotableAttributeField.Builder> getAdditionalAttributeFields()
Description copied from interface: DocumentSearchResultSetConfigurationContract
Gets attribute field definitions for additional attributes that may be displayed in the result set. This simply defines the attribute field definition for each of these fields, their inclusion here does not necessarily mean they will be visible in the result set. This is controlled primarily by DocumentSearchResultSetConfigurationContract.getCustomFieldNamesToAdd().

Specified by:
getAdditionalAttributeFields in interface DocumentSearchResultSetConfigurationContract
Returns:
a list containing additional attribute fields to define for use when constructing the result set, this method can return a null or empty list if there are no additional attribute fields to define

setOverrideSearchableAttributes

public void setOverrideSearchableAttributes(boolean overrideSearchableAttributes)

setCustomFieldNamesToAdd

public void setCustomFieldNamesToAdd(List<String> customFieldNamesToAdd)

setStandardResultFieldsToRemove

public void setStandardResultFieldsToRemove(List<StandardResultField> standardResultFieldsToRemove)

setAdditionalAttributeFields

public void setAdditionalAttributeFields(List<RemotableAttributeField.Builder> additionalAttributeFields)


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.