You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
anna-dodd edited this page Jun 3, 2015
·
1 revision
There isn't a way to get an iterator for the TRE fields in the 1.5 release. However, you can get/set field values. Below is an example that illustrates setting the FILCMT field in a JITCID TRE. (i_3228c.ntf is an example NITF file that contains a JITCID TRE in the FileHeader).
Extensions extendedSection = record.getHeader().getExtendedSection();
Iterable<TRE> tres = extendedSection.getTREsByName("JITCID"); if(tres.iterator().hasNext()) { final TRE tre = tres.iterator().next(); try { finalField field = tre.getField("FILCMT"); // let's go ahead and just re-set the field
field.setData("My comment"); } catch(NoSuchFieldException e) { // TODO Auto-generated catch block
e.printStackTrace(); } }