Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.jdeveloper.java.filter
Class SimpleNameFilter

java.lang.Object
  extended by oracle.jdeveloper.java.filter.SimpleNameFilter
All Implemented Interfaces:
ClassNameFilter, PackageNameFilter
Direct Known Subclasses:
PatternMatchNameFilter

public class SimpleNameFilter
extends java.lang.Object
implements ClassNameFilter, PackageNameFilter

The SimpleClassNameFilter is a basic implementation of the ClassNameFilter and PackageNameFilter interface. It supports class name (ClassNameFilter) or package prefix (PackageNameFilter) by whole name, prefix, suffix, or substring matches.

Note that when used as a ClassNameFilter, the packagePrefix is ignored in acceptClassName().

See Also:
ClassNameFilter, PackageNameFilter

Field Summary
protected  boolean _matchCase
          Whether we are matching case (case-sensitive).
protected  java.lang.String _matchName
          The name that we are using for the match.
protected  int _matchType
          The requested match type of behavior, i.e., MATCH_WHOLE.
static int MATCH_PREFIX
          Constant indicating that the name should be used for a prefix match.
static int MATCH_SUBSTRING
          Constant indicating that the name should be used for a substring match.
static int MATCH_SUFFIX
          Constant indicating that the name should be used for a suffix match.
static int MATCH_WHOLE
          Constant indicating that the whole name should be matched
 
Constructor Summary
SimpleNameFilter(java.lang.String matchName, boolean matchCase, int matchType)
          Construct a filter based on the given name, case, and type information.
 
Method Summary
 boolean acceptClassName(java.lang.String className, java.lang.String packagePrefix)
          Check whether the given class name should be accepted by the filter implementation.
 boolean acceptName(java.lang.String testName)
          Check whether the given name (class or package name) should be accepted by the filter implementation.
 boolean acceptPackageName(java.lang.String packageName)
          Check whether the given package name should be accepted by the filter implementation.
 boolean getMatchCase()
          Fetch whether we are suppose to match case for the search.
 java.lang.String getMatchName()
          Fetch the name we are using for the match.
 int getMatchType()
          Fetch the match type requested.
 void setMatchName(java.lang.String matchName)
          Sets the text to use to determine whether a name is accepted by the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MATCH_WHOLE

public static final int MATCH_WHOLE
Constant indicating that the whole name should be matched

See Also:
Constant Field Values

MATCH_PREFIX

public static final int MATCH_PREFIX
Constant indicating that the name should be used for a prefix match.

See Also:
Constant Field Values

MATCH_SUBSTRING

public static final int MATCH_SUBSTRING
Constant indicating that the name should be used for a substring match.

See Also:
Constant Field Values

MATCH_SUFFIX

public static final int MATCH_SUFFIX
Constant indicating that the name should be used for a suffix match.

See Also:
Constant Field Values

_matchType

protected int _matchType
The requested match type of behavior, i.e., MATCH_WHOLE.


_matchCase

protected boolean _matchCase
Whether we are matching case (case-sensitive).


_matchName

protected java.lang.String _matchName
The name that we are using for the match.

Constructor Detail

SimpleNameFilter

public SimpleNameFilter(java.lang.String matchName,
                        boolean matchCase,
                        int matchType)
Construct a filter based on the given name, case, and type information.

Parameters:
matchName - the name we are matching
matchCase - whether to match case, true for case-sensitive matches
matchType - the type of match we are performing with the name, such as MATCH_WHOLE
Method Detail

getMatchType

public int getMatchType()
Fetch the match type requested.

Returns:
the match type requested, such as MATCH_WHOLE.

getMatchCase

public boolean getMatchCase()
Fetch whether we are suppose to match case for the search.

Returns:
true to match case (case-sensitive), false otherwise

getMatchName

public java.lang.String getMatchName()
Fetch the name we are using for the match.

Returns:
the name we are using for the match.

setMatchName

public void setMatchName(java.lang.String matchName)
Sets the text to use to determine whether a name is accepted by the filter.

Specified by:
setMatchName in interface ClassNameFilter
Specified by:
setMatchName in interface PackageNameFilter
Parameters:
matchText - the text to match

acceptClassName

public boolean acceptClassName(java.lang.String className,
                               java.lang.String packagePrefix)
Check whether the given class name should be accepted by the filter implementation. The package prefix is provided also for those implementations that operate on the entire fully-qualified class name.

Specified by:
acceptClassName in interface ClassNameFilter
Parameters:
className - the unqualified class name
packagePrefix - the package prefix
Returns:
true if the filter accepts the given name, false otherwise

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
Parameters:
packageName - the package name
Returns:
true if the filter accepts the given name, false otherwise

acceptName

public boolean acceptName(java.lang.String testName)
Check whether the given name (class or package name) should be accepted by the filter implementation.

Parameters:
name - the name to search against
Returns:
true if the filter accepts the given name, false otherwise

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

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