Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.9.0)

E52944-01


oracle.jdeveloper.java.filter
Class PatternMatchNameFilter

java.lang.Object
  extended by oracle.jdeveloper.java.filter.SimpleNameFilter
      extended by oracle.jdeveloper.java.filter.PatternMatchNameFilter

All Implemented Interfaces:
ClassNameFilter, PackageNameFilter

public class PatternMatchNameFilter
extends SimpleNameFilter

The PatternMatchNameFilter handles name matching for both class and package names. It supports pattern matching for question mark (?) and asterisk (*) characters. Use a question mark to match any single character, or an asterisk to match any number of characters.

For class name matching, it also supports camel-case matching.

See Also:
Here are some sample results for various search strings. (Note, the results include interfaces only, no classes and no packages.)

Search Text Sample Result
*wil javax.swing.event.TreeWillExpandListener
wil No matches
WiLi sun.awt.WindowClosingListener
java.awt.event.WindowFocusListener
java.awt.event.WindowListener
java.awt.event.WindowStateListener
w?n sun.awt.WindowClosingListener
sun.awt.WindowClosingSupport
javax.swing.WindowConstants
java.awt.event.WindowFocusListener
java.awt.event.WindowListener
java.awt.peer.WindowPeer
java.awt.event.WindowStateListener
, ClassNameFilter, PackageNameFilter, CamelCaseFilter

Field Summary

 

Fields inherited from class oracle.jdeveloper.java.filter.SimpleNameFilter
_matchCase, _matchName, _matchType, MATCH_PREFIX, MATCH_SUBSTRING, MATCH_SUFFIX, MATCH_WHOLE

 

Constructor Summary
PatternMatchNameFilter()
          Constructs a PatternMatchNameFilter to match names by prefix.
PatternMatchNameFilter(boolean matchSubString)
          Constructs a PatternMatchNameFilter.

 

Method Summary
 boolean acceptClassName(java.lang.String className, java.lang.String packagePrefix)
          Check whether the given class name matches the search criteria.
 boolean acceptPackageName(java.lang.String packageName)
          Check whether the given package name should be accepted by the filter implementation.
 void setMatchName(java.lang.String criteria)
          Sets the text to use as match criteria.
 void setMatchSubstring(boolean matchSubString)
          Sets the match method to use, either matching the prefix, or matching any part of the name.

 

Methods inherited from class oracle.jdeveloper.java.filter.SimpleNameFilter
acceptName, getMatchCase, getMatchName, getMatchType

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

PatternMatchNameFilter

public PatternMatchNameFilter()
Constructs a PatternMatchNameFilter to match names by prefix. By default the match critieria is an empty String.

PatternMatchNameFilter

public PatternMatchNameFilter(boolean matchSubString)
Constructs a PatternMatchNameFilter. By default the match critieria is an empty String.
Parameters:
matchSubstring - if true, a name is accepted if any part of it matches the search text, otherwise, the name must begin with the search text

Method Detail

setMatchName

public void setMatchName(java.lang.String criteria)
Sets the text to use as match criteria.
Specified by:
setMatchName in interface ClassNameFilter
Specified by:
setMatchName in interface PackageNameFilter
Overrides:
setMatchName in class SimpleNameFilter
Parameters:
criteria - the text to match

setMatchSubstring

public void setMatchSubstring(boolean matchSubString)
Sets the match method to use, either matching the prefix, or matching any part of the name.
Parameters:
matchSubstring - if true, a name is accepted if any part of it matches the search text, otherwise, the name must begin with the search text

acceptPackageName

public boolean acceptPackageName(java.lang.String packageName)
Check whether the given package name should be accepted by the filter implementation.
Specified by:
acceptPackageName in interface PackageNameFilter
Overrides:
acceptPackageName in class SimpleNameFilter
Parameters:
packageName - the package name
Returns:
true if the filter accepts the given name, false otherwise

acceptClassName

public boolean acceptClassName(java.lang.String className,
                               java.lang.String packagePrefix)
Check whether the given class name matches the search criteria. If there's a dot (.) in the search text, then match the fully-qualified class name, otherwise, we match all classes.
Specified by:
acceptClassName in interface ClassNameFilter
Overrides:
acceptClassName in class SimpleNameFilter
Parameters:
className - the unqualified class name
packagePrefix - the package prefix
Returns:
true if the filter accepts the given name, false otherwise

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.9.0)

E52944-01


Copyright © 1997, 2015, Oracle. All rights reserved.