Interface IObjectSorter

All Superinterfaces
Comparator, com.bea.content.paging.internal.ITypeSupport, Serializable

public interface IObjectSorter
extends Comparator, com.bea.content.paging.internal.ITypeSupport, Serializable

Interface which allows custom sorting to use the entire object state, for specified Java types. This is in contrast to property sorters, which only have access to individual properties.

An overview of custom sorting and filtering is provided in the package documentation at com.bea.content.paging

NOTE: custom object sorters are designed for small datasets (narrow queries returning a hundred or less objects). They may not scale well for large datasets.

Use this interface when you want to add support for sorting objects of a given type, such as com.bea.content.Node, in their entirety. If you need access to multiple fields when doing sorting, this might be a good choice. For example, you could use an object sorter to sort on multiple properties on a com.bea.content.Node object at once.

Basically, this specifies a custom Comparator implementation defining T o1, T o2 ) where o1 and o2 are the property container object values, NOT property values. This implementation will apply for one or more Java types (such as Node, VirtualNode, etc).

A ObjectSorter could also be written to sort on multiple custom Node ObjectClass (type) properties.

Field Summary
static ContextKey OBJECT_SORTER_KEY
          CONTEXT KEYS (optional) specifies an ordered List used for sorting.
Method Summary
 void setState(ContentContext context, Locale locale)
          called BEFORE the method is invoked, to configure the filter state
Methods inherited from interface java.util.Comparator
compare, equals
Methods inherited from interface com.bea.content.paging.internal.ITypeSupport

Field Detail


static final ContextKey OBJECT_SORTER_KEY
CONTEXT KEYS (optional) specifies an ordered List used for sorting. The IObjectSorter interface is used to add support for entire-object sorting.

A single IObjectSorter can apply for a given type, such as Node. The first IObjectSorter in the list which applies for the specified type is the one used.

Method Detail


void setState(ContentContext context,
              Locale locale)
              throws RepositoryException
called BEFORE the method is invoked, to configure the filter state


Copyright © 2011, Oracle. All rights reserved.