remove xml data adaptor

4.x.x
manoj 10 years ago
parent 1736d5db3e
commit 4d87e3f605

@ -20,12 +20,8 @@
package org.wso2.carbon.device.mgt.core.config.license; package org.wso2.carbon.device.mgt.core.config.license;
import org.wso2.carbon.device.mgt.core.util.DateAdapter;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;
@XmlRootElement(name = "License") @XmlRootElement(name = "License")
public class License { public class License {
@ -34,8 +30,9 @@ public class License {
private String name; private String name;
private String version; private String version;
private String language; private String language;
private Date validFrom;
private Date validTo; private String validFrom;
private String validTo;
private String license; private String license;
@XmlElement(name = "provider") @XmlElement(name = "provider")
@ -74,31 +71,30 @@ public class License {
this.language = language; this.language = language;
} }
@XmlJavaTypeAdapter(DateAdapter.class) @XmlElement(name = "license")
public Date getValidFrom() { public String getLicense() {
return license;
}
public void setLicense(String license) {
this.license = license;
}
@XmlElement(name = "validFrom")
public String getValidFrom() {
return validFrom; return validFrom;
} }
public void setValidFrom(Date validFrom) { public void setValidFrom(String validFrom) {
this.validFrom = validFrom; this.validFrom = validFrom;
} }
@XmlJavaTypeAdapter(DateAdapter.class) @XmlElement(name = "validTo")
public Date getValidTo() { public String getValidTo() {
return validTo; return validTo;
} }
public void setValidTo(Date validTo) { public void setValidTo(String validTo) {
this.validTo = validTo; this.validTo = validTo;
} }
@XmlElement(name = "license")
public String getLicense() {
return license;
}
public void setLicense(String license) {
this.license = license;
}
} }

@ -124,9 +124,9 @@ public class LicenseManagementServiceComponent {
artifact.setAttribute(DeviceManagementConstants.LicenseProperties.OVERVIEW_PROVIDER, artifact.setAttribute(DeviceManagementConstants.LicenseProperties.OVERVIEW_PROVIDER,
license.getProvider()); license.getProvider());
artifact.setAttribute(DeviceManagementConstants.LicenseProperties.VALID_TO, artifact.setAttribute(DeviceManagementConstants.LicenseProperties.VALID_TO,
license.getValidTo().toString()); license.getValidTo());
artifact.setAttribute(DeviceManagementConstants.LicenseProperties.VALID_FROM, artifact.setAttribute(DeviceManagementConstants.LicenseProperties.VALID_FROM,
license.getValidFrom().toString()); license.getValidFrom());
artifact.setAttribute(DeviceManagementConstants.LicenseProperties.LICENSE,license.getLicense()); artifact.setAttribute(DeviceManagementConstants.LicenseProperties.LICENSE,license.getLicense());
artifactManager.addGenericArtifact(artifact); artifactManager.addGenericArtifact(artifact);
} }

Loading…
Cancel
Save