@Retention(value=RUNTIME) @Target(value=METHOD) public @interface MaxSize
Here is a simple example:
@PrimaryKey("id")
public class Customer {
private int id;
private String firstName;
private String lastName;
private String comment;
public int getId() { return id; }
public String getFirstName() { return firstName; }
public String getLastName() { return lastName; }
public String getComment() { return comment; }
public void setId(int i) { id = i; }
@MaxSize(20)
public void setFirstName(String s) { firstName = s; }
@MaxSize(30)
public void setLastName(String s) { lastName = s; }
@MaxSize(1000)
public void setComment(String s) { comment = s; }
}
| Modifier and Type | Required Element and Description |
|---|---|
int |
value |
Copyright © 2012-2016 Jeffrey L. Eppinger. All rights reserved. Permission granted for educational use only.