How to use javax.xml.bind.annotation in python?



I want the function of 'javax.xml.bind.annotation' in python.


This is the java code below that the reason of why i want to use in python.



import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlElementRefs;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"command"
})


@XmlRootElement(name = "meters")
public class Meters
{

@XmlElementRefs({
@XmlElementRef(name = "setMeterSub", namespace = "http://ift.tt/1pvq3wj", type = SetMeterSub.class),
@XmlElementRef(name = "getMeterInfo", namespace = "http://ift.tt/1pvq3wj", type = GetMeterInfo.class),
@XmlElementRef(name = "meterSubList", namespace = "http://ift.tt/1pvq3wj", type = MeterSubList.class),
@XmlElementRef(name = "meterInfoAck", namespace = "http://ift.tt/1pvq3wj", type = MeterInfoAck.class),
@XmlElementRef(name = "meterInfo", namespace = "http://ift.tt/1pvq3wj", type = MeterInfo.class),
@XmlElementRef(name = "getMeterSub", namespace = "http://ift.tt/1pvq3wj", type = GetMeterSub.class),
@XmlElementRef(name = "clearMeterSub", namespace = "http://ift.tt/1pvq3wj", type = ClearMeterSub.class)
})
@XmlAnyElement(lax = true)
protected Object command;


I want to move this java code to python so that i've thought the 'PYXB' but i have no idea how to use like that.


No comments:

Post a Comment