Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2008 BEA Systems, Inc. All Rights Reserved
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.content.paging
Interface IPropertySorter

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

    public interface IPropertySorter

extends Comparator, com.bea.content.paging.internal.ITypeSupport, Serializable

Interface which allows custom property sorting, for specified Java property container classes and specified JavaBean properties. JavaBean properties can be any combination of 'standard properties' and 'extended properties' (added by a PropertyProvider).

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

NOTE: custom property 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 (or override existing support for sorting) a specific property, such as String getName(), on a specific Java type, such as com.bea.content.Node. For example, perhaps you want to ignore case when sorting.

Basically, this specifies a custom Comparator implementation defining Comparator.compare( T o1, T o2 ) where T is the property value, NOT the object value, for some combination the following: - one or more Java types (such as Node, VirtualNode, etc) - one or more JavaBean properties on these Java types. (such as Node.getName, etc)

This can be used to override an existing sorting approach for specific properties, and do something special.

At most one property on one type will be sorted on at a time.

For example, one might write an IPropertySorter to override the default sorting of the String 'name' property on com.bea.content.Node, to sort nodes with Node names starting with 'test' at the very end. In this case, the Comparator method would be Comparator.compare( String o1, String o2 )

Field Summary
`static ContextKey` | `PROPERTY_SORTER_KEY` CONTEXT KEYS (optional) specifies an ordered List used for providing custom property sorting capabilities.

Method Summary
`Set<String>` | `getSortableProperties(ContentContext context, Class<?> propertyContainerTypeClass)` For the specified Java type, which JavaBean properties does this property sorter support? a property sorter can support multiple JavaBean properties on a specified Java type.
`void` | `setState(ContentContext context, String propertyName, Locale locale)` called BEFORE the comparator.compare() method is invoked, to configure the sort state

Methods inherited from interface java.util.Comparator
`compare, equals`

Methods inherited from interface com.bea.content.paging.internal.ITypeSupport
`getSupportedTypes`

Field Detail

### PROPERTY_SORTER_KEY

    static final ContextKey PROPERTY_SORTER_KEY

  CONTEXT KEYS (optional) specifies an ordered List used for providing custom property sorting capabilities. The IPropertySorter interface is used to add support for custom property sorting, which overrides the default property sorting approach, if any, for the specified properties.

  Multiple IPropertySorters(s) can apply for a given type, such as Node. A single IPropertySorter can apply for a given property on a type.

Method Detail

### getSortableProperties

    Set<String> getSortableProperties(ContentContext context,
                                      Class<?> propertyContainerTypeClass)
                                      throws RepositoryException

  For the specified Java type, which JavaBean properties does this property sorter support? a property sorter can support multiple JavaBean properties on a specified Java type.

  The property container type class may be any of those returned by ITypeSupport.getSupportedTypes( ContentContext ).

  For example, a single IPropertySorter implementation class might support custom sorting for the 'name' and 'modifiedDate' properties of com.bea.content.Node, and the 'path' property of com.bea.content.ObjectClass.

  At most one of these properties will be sorted upon at any given time.

  Must return a Set, though the Set can be empty. NULL is not a valid return value.

  Throws
    `RepositoryException`

### setState

    void setState(ContentContext context,
                  String propertyName,
                  Locale locale)
                  throws RepositoryException

  called BEFORE the comparator.compare() method is invoked, to configure the sort state

  Throws
    `RepositoryException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 BEA Systems, Inc. All Rights Reserved