Generate XML on fly in Java dataobject.

M

Manoj Nair

I am a newbie so forgive any stupid Q's.

Reqt : I have a java data object and I need to have a getter method in
it which will return me a XML file for that instance.

Eg: I have a class Customer

Public class Customer
{
private long customerid;
private String first;
private String last;

public Customer(){}

public long getID() { return customerid; }
public String getFirst() { return first; }
public String getLast() { return last; }

public void setID(long aID) { customerid = aID; }
public void setFirst(String afirst) { first = afirst; }
public void setLast(String alast) { last = alast; }

/** THE NEW METHOD I NEED **/
public String generateXML(long custid)
{
return XML_FILE ; // NEW REQUIREMENT
}
}

The generate method should return an XML file ( I dont know whether it
should be a file reference to a temporary file stored on server or a
stream of bytes).
This dataobject resides on the WEBLOGIC 7.0 server.


Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top