These two annotations are used in case of generalization in inheritance. The object of parent class can contain object of any child class.
Example is as below:
//@XmlRootElement(name = "WebServiceMethod")
@XmlRootElement(namespace = "pkg")
@XmlAccessorType(XmlAccessType.FIELD)
//If you want you can define the order in which the fields are written
//Optional
@XmlType(propOrder = { "webServiceMethodName", "webServiceMethodParams" })
@XmlSeeAlso({WebServiceMethodParamComposite.class, WebServiceMethodParamLeaf.class})
public class WebServiceMethod {
String webServiceMethodName;
// XmLElementWrapper generates a wrapper element around XML representation
//@XmlElementWrapper(name = "webServiceMethodParams")
// XmlElement sets the name of the entities
//@XmlElement(name = "WebServiceMethodParam")
//@XmlElement(name = "WebServiceMethodParam")
@XmlAnyElement
ArrayList<WebServiceMethodParamComponent> webServiceMethodParams;
public WebServiceMethod()
{
}
public void setWebServiceMethodName(String name)
{
webServiceMethodName = name;
}
public String getWebServiceMethodName()
{
return webServiceMethodName;
}
public void setWebServiceMethodParam(ArrayList<WebServiceMethodParamComponent> paramList)
{
webServiceMethodParams = paramList;
}
public ArrayList<WebServiceMethodParamComponent> getWebServiceMethodParam()
{
return webServiceMethodParams;
}
}
Friday, February 3, 2012
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2012
(113)
-
▼
February
(16)
- SQL server - export xml to file
- xml file from SQL
- SQL server - generate sitemap table
- java - noclassdeffounderror
- com.sun.org.apache.xerces.internal.dom.ElementNSIm...
- Java - Pass by value/Pass by reference
- @XmlTransient for handling Interfaces
- JAXB - Mapping the unmappable
- JAX vs Extreme
- I.E. Object doesn’t support this property or metho...
- window task manager - create dump file
- JAXB : @XmlSeeAlso, @XmlAnyElement
- Jaxb for interfaces
- Workstation components installed but only the Conf...
- Completely remove an existing SQL Server 2005 inst...
- Remove a component from an existing SQL Server 200...
-
▼
February
(16)
No comments:
Post a Comment