Commit e623775c authored by R.W.Majeed's avatar R.W.Majeed
Browse files

JAXB annotations

parent f49346d4
......@@ -2,31 +2,53 @@ package de.sekmi.histream.impl;
import java.time.Instant;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import de.sekmi.histream.ext.ExternalSourceType;
public class ExternalSourceImpl implements ExternalSourceType {
protected Instant sourceTimestamp;
protected String sourceId;
private Instant timestamp;
private String id;
public static class Adapter extends XmlAdapter<String, Instant>{
public Instant unmarshal(String v) throws Exception {
return javax.xml.bind.DatatypeConverter.parseDateTime(v).toInstant();
public String marshal(Instant v) throws Exception {
return v.toString();
public Instant getSourceTimestamp() {
return sourceTimestamp;
return timestamp;
public void setSourceTimestamp(Instant instant) {
this.sourceTimestamp = instant;
this.timestamp = instant;
public String getSourceId() {
return sourceId;
return id;
public void setSourceId(String sourceSystemId) {
this.sourceId = sourceSystemId; = sourceSystemId;
......@@ -42,11 +42,11 @@ public class Meta {
case ObservationSupplier.META_SOURCE_ID:
if( source == null )source = new ExternalSourceImpl();
source.sourceId = value;
case ObservationSupplier.META_SOURCE_TIMESTAMP:
if( source == null )source = new ExternalSourceImpl();
source.sourceTimestamp = javax.xml.bind.DatatypeConverter.parseDateTime(value).toInstant();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment