• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to read info from a class which has xml data  RSS feed

Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i know how to extract pass through parameters from a class. this class parses a xml file and has that data. below is the class

public class Item implements Serializable {

private String id = UUID.randomUID().toString();

@XmlElementWrapper(name = "itemParameters")
@XmlElement(name = "itemField")
private List<ItemField> itemFields = new ArrayList<ItemField>(); // 'field' elements in this query

private Map<String, String> passThroughInfo = new HashMap<String, String>(); // 'field' element name/value pairs

public String getId() {
return id;

public List<ItemField> getItemFields() {
return itemFields;
public void setItemFields(List<ItemField> itemFields) {
this.itemFields = itemFields;
public Map<String, String> getPassThruInfo() {
return passThruInfo;
public void setPassThroughInfo(Map<String, String> passThroughInfo) {
this.passThroughInfo = passThroughInfo;

below is the sample xml..

<?xml version="1.0"?>
<inquiry priority ="5">
<object name="xyz" />
<indexquery range="N">
<field name="z" />
<field name="p" low="3" />
<indexquery range="N">
<field name="g" />
<field name="m" low="3"/>
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!