Java 类org.hibernate.validator.Pattern 实例源码
项目:caarray
文件:RegistrationRequest.java
/**
* @return the phone
*/
@Column(length = PHONE_NUMBER_FIELD_LENGTH)
@NotNull
@Length(min = 1, max = PHONE_NUMBER_FIELD_LENGTH)
@Pattern(regex = "(\\+)?([-\\._\\(\\) ]?[\\d]{3,20}[-\\._\\(\\) ]?){2,10}")
public String getPhone() {
return phone;
}
项目:caarray
文件:RegistrationRequest.java
/**
* @return the fax
*/
@Column(length = FAX_FIELD_LENGTH)
@Length(max = FAX_FIELD_LENGTH)
@Pattern(regex = "(\\+)?([-\\._\\(\\) ]?[\\d]{3,20}[-\\._\\(\\) ]?){2,10}||^$")
public String getFax() {
return fax;
}
项目:windup
文件:Booking.java
@NotNull(message="Credit card number is required")
@Length(min=16, max=16, message="Credit card number must 16 digits long")
@Pattern(regex="^\\d*$", message="Credit card number must be numeric")
public String getCreditCard()
{
return creditCard;
}
项目:windup
文件:User.java
@Id
@Length(min=4, max=15)
@Pattern(regex="^\\w*$", message="not a valid username")
public String getUsername()
{
return username;
}