No Annotation for contraints (min, max, etc.) generated by Eclipse Plugin

8 views
Skip to first unread message

Koon Sang Khong

unread,
Apr 12, 2017, 4:55:12 AM4/12/17
to ASN.1 Development Tools
The Java code generated by the Eclipse plugin does not have annotation for constraints (such as min, max) anymore.


Below is my ASN.1:

CustomTime ::= SEQUENCE {
hourPadding BIT STRING (SIZE(3)),
hour INTEGER(0..23),
minPadding BIT STRING (SIZE(2)),
minute INTEGER(0..59),
secPadding BIT STRING (SIZE(2)),
second INTEGER(0..59)
}

Below is part of the generated Java code:

public class CustomTime {

private BitString hourPadding;

private Integer hour;

private BitString minPadding;

private Integer minute;

private BitString secPadding;

private Integer second;

--
}

As you can see, there is no mix, max annotation generated.  But, it was working fine previously.  Below is what was generated previously:


public class CustomTime {

@NotNull
@Size(min=3, max=3)
@Component(0)
private BitString hourPadding;

Koon Sang Khong

unread,
Apr 12, 2017, 5:00:49 AM4/12/17
to ASN.1 Development Tools
Just too add that I have selected JSR-303 in the Eclipse preference settings.

Koon Sang Khong

unread,
Apr 12, 2017, 5:08:36 AM4/12/17
to ASN.1 Development Tools
I figured out already. It is working fine after I select "Using annotation (J2SE 1.5+)" in Eclipse preference.  Thank you.



On Wednesday, 12 April 2017 16:55:12 UTC+8, Koon Sang Khong wrote:
Reply all
Reply to author
Forward
0 new messages