Java Annotation

求教大神,如何让Annotation的成员成为非必填 java

 

@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Table {
	String name();
	String primaryKey();
	
}

@Documented
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Column {
	String name();
	boolean notNull();
	boolean unique();
	String check();
	public String defaultValue();
	String collate();
}


@Table(name = "", primaryKey = "")
public class Task {
	
	@Column(check = "", collate = "", defaultValue = "", name = "", notNull = false, unique = false)
	private String createTime;
	
	@Column(check = "", collate = "", defaultValue = "", name = "", notNull = false, unique = false)
	private String name;
	
	
}

我不但愿Column的全部成员都显示出来。 code

相关文章
相关标签/搜索