public static void main(String[] args) throws Exception { InitManager.reset("jar:///format/config/abc.xml"); //Prepare person populate data into its fields Person person = new Person(); person.setName("George. Wilhelm. T"); person.setAge(57); //Get the defined format element by id "PersonFormat" FormatElement format = FormatFactory.getFormatElement("PersonFormat"); //Create a ReadAdapter for person ReadAdapter read = new JavaReadAdapter(person); //Perform unformat action Message msg = format.format(read); System.out.println("====Format Result===="); System.out.println(msg); }
Read BTT configuration from : "jar:///btt.xml" Initialize BTT Component: traces Initialize BTT Component: traces [Success] Initialize BTT Component: format Initialize BTT Component: format [Success] 2 BTT Components initialized. ====Format Result==== 12C785969987854B40E68993888593944B40E30400000039
In 12C785969987854B40E68993888593944B40E30400000039, 12 indicates that the following 18 bytes is a field for George. Wilhelm. T.