com.wewebu.ow.server.plug.owrecord.filter
Class OwFilterHelper

java.lang.Object
  extended by com.wewebu.ow.server.plug.owrecord.filter.OwFilterHelper

public class OwFilterHelper
extends Object

Helper class for filter handling. This class execute the filtering and instantiation of filter classes.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com

Since:
3.2.0.0

Constructor Summary
OwFilterHelper()
           
 
Method Summary
 com.wewebu.ow.server.field.filter.OwComparator<?> createComparator(Class<?> clazz)
          Method to instantiate a comparator for a given class.
 List filterCollection(com.wewebu.ow.server.field.OwSearchCriteria filter, List collection)
          Call start a filter process on the given collection using the provided filter.
protected  boolean fitFilter(com.wewebu.ow.server.field.OwSearchCriteria filter, com.wewebu.ow.server.ecm.OwObject obj)
          Check if the object matches the given filter.
protected  boolean fitFilter(com.wewebu.ow.server.field.OwSearchCriteria filter, com.wewebu.ow.server.ecm.OwProperty prop)
          Check the property against a defined filter.
protected  com.wewebu.ow.server.field.filter.OwComparator getComparator(String javaClassName)
          Retrieve and cache a OwComparator for a given class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwFilterHelper

public OwFilterHelper()
Method Detail

filterCollection

public List filterCollection(com.wewebu.ow.server.field.OwSearchCriteria filter,
                             List collection)
                      throws ClassNotFoundException
Call start a filter process on the given collection using the provided filter.

A OwFilterRuntimeException can occur if the property, property value or property java type retrieval fails.

Parameters:
filter - OwSearchCriteria to use
collection - List of OwObject's
Returns:
List of OwObjects matching the given filter
Throws:
ClassNotFoundException - if could not retrieve java type information of property value

fitFilter

protected boolean fitFilter(com.wewebu.ow.server.field.OwSearchCriteria filter,
                            com.wewebu.ow.server.ecm.OwObject obj)
                     throws ClassNotFoundException
Check if the object matches the given filter.

A OwFilterRuntimeException can occur if the request for property, property value or property java type fails.

Parameters:
filter - OwSearchCriteria which objects must match
obj - OwObject to verify against filter
Returns:
true only if object is match the filter
Throws:
ClassNotFoundException - if could not retrieve java type information of property value

fitFilter

protected boolean fitFilter(com.wewebu.ow.server.field.OwSearchCriteria filter,
                            com.wewebu.ow.server.ecm.OwProperty prop)
                     throws ClassNotFoundException
Check the property against a defined filter.

A OwFilterRuntimeException can occur if the retrieval of property value or property java type fails.

Parameters:
filter - OwSearchCriteria representing a filter
prop - OwProperty whose value should be verified
Returns:
boolean true only if
Throws:
ClassNotFoundException

getComparator

protected com.wewebu.ow.server.field.filter.OwComparator getComparator(String javaClassName)
                                                                throws ClassNotFoundException
Retrieve and cache a OwComparator for a given class name.

Parameters:
javaClassName - String full qualified java class name
Returns:
OwComparator to be used for given class
Throws:
ClassNotFoundException

createComparator

public com.wewebu.ow.server.field.filter.OwComparator<?> createComparator(Class<?> clazz)
Method to instantiate a comparator for a given class.

Parameters:
clazz - Class which should be handled by the OwComparator instance
Returns:
OwComparator which can handle the given class.


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.