My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Wiki pages
Links

This small library provides a simple domain specific language (DSL) for writing OSGi filters.

Here are some Groovy examples of how to use this simple library to construct LDAP style filters:

import static org.filter4osgi.builder.FilterBuilder.*

def result = and(
  eq('mailboxName', 'welcome'),
  eq('lang', 'en')
)

assert '(&(mailboxName=welcome) (lang=en))' == result.toString()

or a more complex example:

def result = or(
  eq('mailboxName', 'welcome'),
  and(
    eq('lang', 'de'),
    eq('mailboxID', '5')
  ), 
  and(
    eq('lang', 'en_CA'),
    eq('mailboxID', '9')
  )
)

assert '(|(mailboxName=welcome) (&(lang=de) (mailboxID=5)) (&(lang=en_CA) (mailboxID=9)))' == result.toString()

Some of the best documentation can be found in the test case: http://code.google.com/p/filter4osgi/source/browse/trunk/filter4osgiTests/tests/org/filter4osgi/builder/FilterTest.groovy

I will pay you for bug reports: PaidBugReports

Powered by Google Project Hosting