From 4d87e3f605fc91c80d45aed97ad20e2369edf18d Mon Sep 17 00:00:00 2001 From: manoj Date: Fri, 13 Feb 2015 15:01:42 +0530 Subject: [PATCH] remove xml data adaptor --- .../mgt/core/config/license/License.java | 40 +++++++++---------- .../LicenseManagementServiceComponent.java | 4 +- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/license/License.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/license/License.java index 1ad70a39522..e9d5188559c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/license/License.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/license/License.java @@ -20,12 +20,8 @@ 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.XmlRootElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import java.util.Date; @XmlRootElement(name = "License") public class License { @@ -34,8 +30,9 @@ public class License { private String name; private String version; private String language; - private Date validFrom; - private Date validTo; + + private String validFrom; + private String validTo; private String license; @XmlElement(name = "provider") @@ -74,31 +71,30 @@ public class License { this.language = language; } - @XmlJavaTypeAdapter(DateAdapter.class) - public Date getValidFrom() { + @XmlElement(name = "license") + public String getLicense() { + return license; + } + + public void setLicense(String license) { + this.license = license; + } + + @XmlElement(name = "validFrom") + public String getValidFrom() { return validFrom; } - public void setValidFrom(Date validFrom) { + public void setValidFrom(String validFrom) { this.validFrom = validFrom; } - @XmlJavaTypeAdapter(DateAdapter.class) - public Date getValidTo() { + @XmlElement(name = "validTo") + public String getValidTo() { return validTo; } - public void setValidTo(Date validTo) { + public void setValidTo(String validTo) { this.validTo = validTo; } - - @XmlElement(name = "license") - public String getLicense() { - return license; - } - - public void setLicense(String license) { - this.license = license; - } - } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/LicenseManagementServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/LicenseManagementServiceComponent.java index 67d2b6a835a..abf3f218c0f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/LicenseManagementServiceComponent.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/LicenseManagementServiceComponent.java @@ -124,9 +124,9 @@ public class LicenseManagementServiceComponent { artifact.setAttribute(DeviceManagementConstants.LicenseProperties.OVERVIEW_PROVIDER, license.getProvider()); artifact.setAttribute(DeviceManagementConstants.LicenseProperties.VALID_TO, - license.getValidTo().toString()); + license.getValidTo()); artifact.setAttribute(DeviceManagementConstants.LicenseProperties.VALID_FROM, - license.getValidFrom().toString()); + license.getValidFrom()); artifact.setAttribute(DeviceManagementConstants.LicenseProperties.LICENSE,license.getLicense()); artifactManager.addGenericArtifact(artifact); }