org.kde.koala
public class KURIFilter extends Object implements QtSupport
KURIFilter
.self() and use any of the public member functions to
preform the filtering.
xample
To simply filter a given string:
boolean filtered = KURIFilter.self().filterURI( "kde.org" );You can alternatively use a KURL:
KURL url = "kde.org"; boolean filtered = KURIFilter.self().filterURI( url );If you have a constant string or a constant URL, simply invoke the corresponding function to obtain the filtered string or URL instead of a booleanean flag:
String u = KURIFilter.self().filteredURI( "kde.org" );You can also restrict the filter(s) to be used by supplying the name of the filter(s) to use. By defualt all available filters will be used. To use specific filters, add the names of the filters you want to use to an ArrayList and invoke the appropriate filtering function. The examples below show the use of specific filters. The first one uses a single filter called kshorturifilter while the second example uses multiple filters:
String text = "kde.org"; boolean filtered = KURIFilter.self().filterURI( text, "kshorturifilter" );
ArrayList list; list << "kshorturifilter" << "localdomainfilter"; boolean filtered = KURIFilter.self().filterURI( text, list );KURIFilter also allows richer data exchange through a simple meta-object called
KURIFilterData.
Using this meta-object
you can find out more information about the URL you want to
filter. See KURIFilterData for examples and details.UNKNOWN: Filters a given URL into its proper format whenever possible.
Constructor Summary | |
---|---|
protected | KURIFilter(Class dummy) |
KURIFilter()
A protected constructor.
|
Method Summary | |
---|---|
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
KURL | filteredURI(KURL uri, String[] filters)
Returns the filtered URI.
|
KURL | filteredURI(KURL uri) |
String | filteredURI(String uri, String[] filters)
Return a filtered string representation of a URI.
|
String | filteredURI(String uri) |
boolean | filterURI(KURIFilterData data, String[] filters)
Filters the URI given by the object URIFilterData.
|
boolean | filterURI(KURIFilterData data) |
boolean | filterURI(KURL uri, String[] filters)
Filters the URI given by the URL.
|
boolean | filterURI(KURL uri) |
boolean | filterURI(StringBuffer uri, String[] filters)
Filters a string representing a URI.
|
boolean | filterURI(StringBuffer uri) |
protected void | finalize() Deletes the wrapped C++ instance |
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
protected void | loadPlugins()
Loads all allowed plugins.
|
ArrayList | pluginNames()
Return a list of the names of all loaded plugins. |
static KURIFilter | self()
Returns an instance of KURIFilter. |
UNKNOWN: A protected constructor.
Parameters: uri The URI to filter. filters specify the list of filters to be used.
Returns: the filtered URI or null if it cannot be filtered
UNKNOWN: Returns the filtered URI.
Parameters: uri the URI to filter. filters specify the list of filters to be used.
Returns: the filtered URI or null if it cannot be filtered
UNKNOWN: Return a filtered string representation of a URI.
Parameters: data object that contains the URI to be filtered. filters specify the list of filters to be used.
Returns: a boolean indicating whether the URI has been changed
UNKNOWN: Filters the URI given by the object URIFilterData.
Parameters: uri the URI to filter. filters specify the list of filters to be used.
Returns: a boolean indicating whether the URI has been changed
UNKNOWN: Filters the URI given by the URL.
Parameters: uri The URI to filter. filters specify the list of filters to be used.
Returns: a boolean indicating whether the URI has been changed
UNKNOWN: Filters a string representing a URI.
UNKNOWN: Loads all allowed plugins.
Returns: an ArrayList of plugin names
UNKNOWN: Return a list of the names of all loaded plugins.
UNKNOWN: Returns an instance of KURIFilter.