File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to read info from a class which has xml data

 
Sandeep Suram
Greenhorn
Posts: 7
  • 0
  • 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

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name="indexQuery")
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>
<indexquery range="N">
<field name="g" />
<field name="m" low="3"/>
</indexquery>
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic