I have data of class Element. I am trying to write its values to a file, but I am having problems:
< Some process to acquire values into the variable "fieldData" >
FileWriter fstream = new FileWriter("C:/output.txt");
BufferedWriter out = new BufferedWriter(fstream);
Element field = fieldData.getElement(i);
out.write(field);
out.write(field.getValueAsString());
Any suggestions on how I should handle this case? Also, what is the best way for me to see (e.g. print on the screen) the available static variables and methods associated with the object? thank.
Additional code snippets for debugging:
private static final Name SECURITY_DATA = new Name("securityData");
private static final Name FIELD_DATA = new Name("fieldData");
Element securityDataArray = msg.getElement(SECURITY_DATA);
Element securityData = securityDataArray.getValueAsElement(0);
Element fieldData = securityData.getElement(FIELD_DATA);
Element field = fieldData.getElement(0)
out.write(field);
out.write(field.getValueAsString());
source
share