Use to generate a custom validation constraint class. You can select the Generate Validator Class option in the wizard if you want the IDE to also generate a constraint validator class for the validation constraint.
You can use a validation constraint to ensure that the values of fields, methods, and types are valid and within a specified constraint. You apply a validation constraint by placing annotations on a field, method, or class, for example on a managed bean or persistent entity class.
You can use the validation constraints that are defined as part of the Bean Validation API or create custom constraints by specifying the constraints for the field or property and the annotation that is associated with the custom constraints. You can specify the constraints in the validation constraint class or create a validator class for the constraint.
In the Name and Location page you set the following properties:
Element | Description |
---|---|
Class Name |
Specifies the name of the constraint class. |
Project |
Specifies the project in which the constraint class will be located. |
Location |
Specifies a folder to house the constraint class. |
Package |
Specifies a package within the location to house the constraint class. |
Created File |
Displays the full path to the new constraint class. |
Generate Validator Class |
Select this option if you want the IDE to also generate a constraint validator class. If you select this option you need to supply the following details for the generated class. |
Validator Class Name |
Type the name of the constraint validator class. |
Java type to Validate |
Type the Java type that is to be validated. |
Related Topics
Developing Applications with NetBeans IDE,
Developing Applications with NetBeans IDE,
Developing Applications with NetBeans IDE,
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. |