YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.upnp.search.SearchCriteria Class Reference

The free text search of a UPnP server (issue #336), pure Java. More...

Collaboration diagram for de.yaacc.upnp.search.SearchCriteria:
Collaboration graph

Static Public Member Functions

static List< String > words (String freeText)
 
static String normalized (String freeText)
 
static List< String > usableProperties (String capabilities)
 The properties of PROPERTIES that the server can search.
 
static String build (String freeText, List< String > properties)
 
static String buildAnyCase (String freeText, List< String > properties)
 The same, but every word is also looked for in its other spellings (all lower case, all upper case, first letter big): some servers compare case sensitive, and "westen" would not be found in "ImWestenNichtsNeues".
 

Static Public Attributes

static final int MAX_WORDS = 5
 
static final int MAX_WORD_CODE_POINTS = 64
 

Detailed Description

The free text search of a UPnP server (issue #336), pure Java.

What the user types is split into words; every word must be found (and) in at least one of the properties that the server can search (or): (dc:title contains "a" or upnp:artist contains
"a") and (dc:title contains "b" or upnp:artist contains "b")
. The properties come from the server's own list (GetSearchCapabilities); a server that lists none (or does not have the action) cannot be searched. The text is limited (words, characters) and quotes and backslashes are escaped as the ContentDirectory search syntax asks, so that the text can not change the meaning of the criteria.

Member Function Documentation

◆ build()

static String de.yaacc.upnp.search.SearchCriteria.build ( String freeText,
List< String > properties )
static
Parameters
freeTextwhat the user typed
propertiesthe properties to look in, see usableProperties
Returns
the SearchCriteria argument, or null if there are no words or no property

Referenced by de.yaacc.upnp.search.SearchCriteria.build(), de.yaacc.upnp.search.SearchCriteria.buildAnyCase(), and de.yaacc.upnp.UpnpClient.searchSync().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildAnyCase()

static String de.yaacc.upnp.search.SearchCriteria.buildAnyCase ( String freeText,
List< String > properties )
static

The same, but every word is also looked for in its other spellings (all lower case, all upper case, first letter big): some servers compare case sensitive, and "westen" would not be found in "ImWestenNichtsNeues".

Longer, so it is the last thing tried when a search found nothing.

Here is the call graph for this function:

◆ normalized()

static String de.yaacc.upnp.search.SearchCriteria.normalized ( String freeText)
static
Returns
the words of the text joined by one blank: the text as it is searched and shown; empty if there is nothing to search

Referenced by de.yaacc.upnp.UpnpClient.searchSync().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usableProperties()

static List< String > de.yaacc.upnp.search.SearchCriteria.usableProperties ( String capabilities)
static

The properties of PROPERTIES that the server can search.

Parameters
capabilitiesthe answer of GetSearchCapabilities: comma separated property names, * for every one; null or empty for none
Returns
the usable properties in the order of PROPERTIES; empty if the server can search none of them

◆ words()

static List< String > de.yaacc.upnp.search.SearchCriteria.words ( String freeText)
static
Returns
the cleaned words of the text (control characters dropped, at most MAX_WORDS, each cut to MAX_WORD_CODE_POINTS); empty if there are none

Referenced by de.yaacc.upnp.search.SearchCriteria.normalized(), and de.yaacc.upnp.search.SearchCriteria.words().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: