Getting Started > Creating and Managing Categories >  Adding Categories  

Adding Categories

You add code to categories using filters.

To add a category:

1 From the main menu, select JProbe > Manage Categories.

2 Select the folder in which the category logically belongs and click New Category.

3 Enter a name in the Name field.

4 To add packages to this category, double-click the cell and enter the package name.

The package is displayed in the cell and the Action is set to Include.

5 To exclude some code from this category, enter the package, class, or method (no signature) in the cell. See the following subsection, Syntax for Filters. Set the Action to Exclude.

6 To add existing folders or categories to this category, select the folder or category and click the Include button.

7 Order is important. Filters lower in the table override filters defined higher in the table. If you need to rearrange the filters, click and hold the row button for the filter you want to move and drag it to its new location. Right-click a row button to insert or delete a row.

8 Click Apply.

9 Repeat to create additional categories.

10 Click OK.

Syntax for Filters

Filters are case-sensitive and blanks are not allowed. You can use an asterisk (*) as a wild card; it matches any character, including the package separator. If you specify the code in a shorthand or partial form, JProbe automatically changes it to canonical form. The change may not be exactly what you desire, so be sure to verify it. JProbe does not check to see whether the filter actually matches anything in your code. For example, if you make a typing error in your package name, nothing in your code will match the filter and so the filter is not applied.

The following table contains common syntax and describes how JProbe interprets it:

 

If you type this:

Canonical form is this:

And filters are applied to:

*
*.*.*()

All methods in all classes in all packages (including the unnamed package)

.*
.*.*()

All methods in all classes in the unnamed package only

C
*.C.*()

All methods in classes named C in any package

.C
.C.*()

All methods in the class named C in the unnamed package only

M()
*.*.M()

Method M in all classes in all packages

P.String*
P.String*.*()

All methods in any class in the package P whose name starts with String and all methods in any class in a package or subpackage of P.String* (matches both P.StringArt.draw() and P.Stringent.Check.English.
spelling()
)

P.*.C.do*()

no change

Any method whose name starts with do in any class named C in any subpackage of P, except P directly (matches P.SubPkg.C.doGet(), but does not match P.C.doNotMatch())

Pre*
*.Pre*.*()

All methods in all classes starting with Pre in any package, as well as any class in a subpackage whose name starts with Pre (matches both Pkg.Prepare.m() and Pkg.Pretend.C.m())

s*y
*.s*y.*()

All methods in classes whose name ends with y and either starts with s or belongs to a subpackage that starts with s (matches both java.rmi.server.RMISocketFactory,com.quest.say, and java.security.cert.X509CRLEntry)

foo.bar
foo.bar.*()

All methods in the class bar in package foo. This is likely not what you wanted. See the next example.

foo.bar.*
foo.bar.*.*()

All methods in all classes in foo.bar or any of its subpackages

foo.bar.
String.t*e()

no change

Methods whose names start with t and end in e in foo.bar.String (matches both toUpperCase() and toLowerCase())