Top Description Inners Methods
org.hibernate.validator.constraints

public @Interface ISBN

extends Annotation
Annotations
@Documented
@Constraint
validatedBy:
@Target:METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE
@Retention:RUNTIME
@Repeatable:List
Static Imports
java.lang.annotation.ElementType.ANNOTATION_TYPE, .ElementType.CONSTRUCTOR, .ElementType.FIELD, .ElementType.METHOD, .ElementType.PARAMETER, .ElementType.TYPE_USE, .RetentionPolicy.RUNTIME

Checks that the annotated character sequence is a valid ISBN. The length of the number and the check digit are both verified.

The supported type is CharSequence. null is considered valid.

During validation all non ISBN characters are ignored. All digits and 'X' are considered to be valid ISBN characters. This is useful when validating ISBN with dashes separating parts of the number (ex. 978-161-729-045-9).

Author
Marko Bekhta
Since
6.0.6

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static @interface
ISBN.List

Defines several @ISBN annotations on the same element.

public static enum
ISBN.Type

Defines the ISBN length.

Method Summary

Modifier and TypeMethod and Description
public Class<?>[]
public String
public Class<? extends Payload>[]
public ISBN.Type
type()

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

groupsback to summary
public Class<?>[] groups()
messageback to summary
public String message()
payloadback to summary
public Class<? extends Payload>[] payload()
typeback to summary
public ISBN.Type type()
org.hibernate.validator.constraints back to summary

public @Interface ISBN.List

extends Annotation
Annotations
@Target:METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE
@Retention:RUNTIME
@Documented

Defines several @ISBN annotations on the same element.

Method Summary

Modifier and TypeMethod and Description
public ISBN[]
Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public ISBN[] value()
org.hibernate.validator.constraints back to summary

public final Enum ISBN.Type

extends Enum<ISBN.Type>
Class Inheritance

Defines the ISBN length. Valid lengths of ISBNs are 10 and 13 which are represented as Type#ISBN_10 and Type#ISBN_13 respectively.

Using Type#ANY allows to validate values that could either be ISBN10 or ISBN13. In such case, ISBN type would be determined by the length of the corresponding value.

Field Summary

Modifier and TypeField and Description
public static final ISBN.Type
public static final ISBN.Type
public static final ISBN.Type

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

Modifier and TypeMethod and Description
public static ISBN.Type
public static ISBN.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ANYback to summary
public static final ISBN.Type ANY
ISBN_10back to summary
public static final ISBN.Type ISBN_10
ISBN_13back to summary
public static final ISBN.Type ISBN_13

Constructor Detail

Typeback to summary
private Type()

Method Detail

valueOfback to summary
public static ISBN.Type valueOf(String name)
valuesback to summary
public static ISBN.Type[] values()