Commit 4f21303e authored by PrabithaPrabhakaran's avatar PrabithaPrabhakaran
Browse files

Add SensorData imp and exp

parent 467d4dce
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
### IntelliJ IDEA ###
.idea/
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store
......@@ -8,12 +8,11 @@ import org.citygml4j.builder.jaxb.marshal.citygml.ade.ADEMarshallerHelper;
import org.citygml4j.model.citygml.ade.binding.ADEMarshaller;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.util.mapper.TypeMapper;
import org.sig3d.citygml.energyADE3beta8.*;
import org.sig3d.citygml.energyADE3beta8.ObjectFactory;
import org.sig3d.citygml.energyADE3beta8.*;
import org.w3._1999.xlink.ActuateType;
import org.w3._1999.xlink.ShowType;
import org.w3._1999.xlink.TypeType;
import org.sig3d.citygml.energyADE3beta8.AbstractADEFeatureType;
import javax.xml.bind.JAXBElement;
import javax.xml.datatype.DatatypeConfigurationException;
......@@ -73,7 +72,7 @@ public class EnergyADEMarshaller implements ADEMarshaller {
.with(TypicalValuesRegularTimeSeriesFile.class, this::createTypicalValuesTimeSeriesFile)
.with(SensorConnection.class, this::createSensorConnection)
.with(WeatherData.class, this::createWeatherData)
// .with(WeatherDataProperty.class, this::createWeatherDataProperty)
// .with(WeatherDataProperty.class, this::createWeatherDataProperty)
.with(WeatherStation.class, this::createWeatherStation);
}
} finally {
......@@ -146,6 +145,8 @@ public class EnergyADEMarshaller implements ADEMarshaller {
.with(TypicalValuesMonthlyTimeSeriesFile.class, this::marshalTypicalValuesMonthlyTimeSeriesFile)
.with(TypicalValuesMonthlyTimeSeriesFileProperty.class, this::marshalTypicalValuesMonthlyTimeSeriesFileProperty)
.with(SensorConnection.class, this::marshalSensorConnection)
.with(SensorData.class, this::marshalSensorData)
.with(SensorDataProperty.class, this::marshalSensorDataProperty)
.with(WeatherStationProperty.class, this::marshalWeatherStationProperty);
}
} finally {
......@@ -171,9 +172,6 @@ public class EnergyADEMarshaller implements ADEMarshaller {
return getTypeMapper().apply(src);
}
private WeatherDataType marshalWeatherData(WeatherData src) {
WeatherDataType dest = new WeatherDataType();
if (src.isSetType())
......@@ -184,8 +182,8 @@ public class EnergyADEMarshaller implements ADEMarshaller {
dest.setValueType(helper.getGMLMarshaller().marshalCode(src.getValueType()));
if (src.isSetYearlyValue())
dest.setYearlyValue(helper.getGMLMarshaller().marshalMeasure(src.getYearlyValue()));
if (src.isSetTimeDependentValues())
dest.setTimeDependentValues(marshalAbstractTimeSeriesProperty(src.getTimeDependentValues()));
// if (src.isSetTimeDependentValues())
// dest.setTimeDependentValues(marshalAbstractTimeSeriesProperty(src.getTimeDependentValues()));
return dest;
}
......@@ -2208,6 +2206,9 @@ public class EnergyADEMarshaller implements ADEMarshaller {
if (src.isSetType()) {
dest.setType(helper.getGMLMarshaller().marshalCode(src.getType()));
}
if (src.isSetArea()) {
dest.setArea(helper.getGMLMarshaller().marshalMeasure(src.getArea()));
}
return dest;
}
......@@ -2341,6 +2342,12 @@ public class EnergyADEMarshaller implements ADEMarshaller {
if (src.isReferencePeriod()){
dest.setReferencePeriod(helper.getGMLMarshaller().marshalCode(src.getReferencePeriodValue()));
}
if (src.isSetTimeDependentCosts()){
dest.setTimeDependentCosts(marshalAbstractTimeSeriesProperty(src.getTimeDependentCosts()));
}
if (src.isSetTimeDependentYields()){
dest.setTimeDependentYields(marshalAbstractTimeSeriesProperty(src.getTimeDependentYields()));
}
return dest;
}
......@@ -2568,6 +2575,62 @@ public class EnergyADEMarshaller implements ADEMarshaller {
return dest;
}
private SensorDataType marshalSensorData(SensorData src) {
SensorDataType dest = factory.createSensorDataType();
helper.getGMLMarshaller().marshalAbstractGML(src, dest);
if (src.isSetType()) {
dest.setType(helper.getGMLMarshaller().marshalCode(src.getType()));
}
if (src.isSetValueType()) {
dest.setValueType(helper.getGMLMarshaller().marshalCode(src.getValueType()));
}
if (src.isSetYearlyValue()){
dest.setYearlyValue(helper.getGMLMarshaller().marshalMeasure(src.getYearlyValue()));
}
if (src.isTimeDependentValues())
dest.setTimeDependentValues(marshalAbstractTimeSeriesProperty(src.getTimeDependentValues()));
// if (src.isSetPosition())
// dest.setPosition(src.getPosition());
return dest;
}
private SensorDataPropertyType marshalSensorDataProperty(SensorDataProperty src) {
SensorDataPropertyType dest = factory.createSensorDataPropertyType();
if (src.isSetSensorData()) {
JAXBElement<?> elem = helper.getJAXBMarshaller().marshalJAXBElement(src.getSensorData());
if (elem != null && elem.getValue() instanceof SensorDataType)
dest.setSensorData((JAXBElement<? extends SensorDataType>) elem);
}
if (src.isSetRemoteSchema())
dest.setRemoteSchema(src.getRemoteSchema());
if (src.isSetType())
dest.setType(TypeType.fromValue(src.getType().getValue()));
if (src.isSetHref())
dest.setHref(src.getHref());
if (src.isSetRole())
dest.setRole(src.getRole());
if (src.isSetArcrole())
dest.setArcrole(src.getArcrole());
if (src.isSetTitle())
dest.setTitle(src.getTitle());
if (src.isSetShow())
dest.setShow(ShowType.fromValue(src.getShow().getValue()));
if (src.isSetActuate())
dest.setActuate(ActuateType.fromValue(src.getActuate().getValue()));
return dest;
}
private JAXBElement<?> createRegularTimeSeriesFile(RegularTimeSeriesFile src) {
return factory.createRegularTimeSeriesFile(marshalRegularTimeSeriesFile(src));
}
......
......@@ -94,6 +94,8 @@ public class EnergyADEUnmarshaller implements ADEUnmarshaller {
.with(TypicalValuesMonthlyTimeSeriesPropertyType.class, this::unmarshalTypicalValuesMonthlyTimeSeriesProperty)
.with(TypicalValuesMonthlyTimeSeriesFileType.class, this::unmarshalTypicalValuesMonthlyTimeSeriesFile)
.with(TypicalValuesMonthlyTimeSeriesFilePropertyType.class, this::unmarshalTypicalValuesMonthlyTimeSeriesFileProperty)
.with(SensorDataType.class, this::unmarshalSensorData)
.with(SensorDataPropertyType.class, this::unmarshalSensorDataProperty)
.with(JAXBElement.class, this::unmarshal);
}
} finally {
......@@ -154,6 +156,62 @@ public class EnergyADEUnmarshaller implements ADEUnmarshaller {
return getTypeMapper().apply(src);
}
private SensorData unmarshalSensorData(SensorDataType src) throws MissingADESchemaException {
SensorData dest = new SensorData();
if (src.isSetType()) {
dest.setType(helper.getGMLUnmarshaller().unmarshalCode(src.getType()));
}
if (src.isSetValueType()) {
dest.setValueType(helper.getGMLUnmarshaller().unmarshalCode(src.getValueType()));
}
if (src.isSetTimeDependentValues()) {
dest.setTimeDependentValues(unmarshalAbstractTimeSeriesProperty(src.getTimeDependentValues()));
}
return dest;
}
private SensorDataProperty unmarshalSensorDataProperty(SensorDataPropertyType src) throws MissingADESchemaException {
SensorDataProperty dest = new SensorDataProperty();
if (src.isSetSensorData()) {
ADEModelObject temp = unmarshal(src.getSensorData());
if (temp instanceof SensorData) {
dest.setSensorData((SensorData) temp);
}
}
if (src.isSetRemoteSchema())
dest.setRemoteSchema(src.getRemoteSchema());
if (src.isSetType())
dest.setType(XLinkType.fromValue(src.getType().value()));
if (src.isSetHref())
dest.setHref(src.getHref());
if (src.isSetRole())
dest.setRole(src.getRole());
if (src.isSetArcrole())
dest.setArcrole(src.getArcrole());
if (src.isSetTitle())
dest.setTitle(src.getTitle());
if (src.isSetShow())
dest.setShow(XLinkShow.fromValue(src.getShow().value()));
if (src.isSetActuate())
dest.setActuate(XLinkActuate.fromValue(src.getActuate().value()));
return dest;
}
private AbstractLibrary unmarshalAbstractLibrary(AbstractLibraryType src, AbstractLibrary dest) {
helper.getGMLUnmarshaller().unmarshalAbstractGML(src, dest);
......@@ -733,7 +791,6 @@ public class EnergyADEUnmarshaller implements ADEUnmarshaller {
unitOfMeasure.setUom(src.getUom().getUom());
dest.setUom(unitOfMeasure);
}
if (src.isSetTemporalExtent()) {
dest.setTemporalExtent(unmarshalTimeIntervalLength(src.getTemporalExtent()));
}
......@@ -1544,6 +1601,14 @@ public class EnergyADEUnmarshaller implements ADEUnmarshaller {
if (src.isSetReferencePeriod()){
dest.setReferencePeriodValue(helper.getGMLUnmarshaller().unmarshalCode(src.getReferencePeriod()));
}
if (src.isSetTimeDependentCosts())
{
dest.setTimeDependentCosts(unmarshalAbstractTimeSeriesProperty(src.getTimeDependentCosts()));
}
if (src.isSetTimeDependentYields())
{
dest.setTimeDependentYields(unmarshalAbstractTimeSeriesProperty(src.getTimeDependentYields()));
}
return dest;
......@@ -1775,6 +1840,10 @@ public class EnergyADEUnmarshaller implements ADEUnmarshaller {
if (src.isSetType()){
dest.setType(helper.getGMLUnmarshaller().unmarshalCode(src.getType()));
}
if (src.isSetArea()){
dest.setArea(helper.getGMLUnmarshaller().unmarshalMeasure(src.getArea()));
}
return dest;
}
......
......@@ -11,6 +11,7 @@ import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.basicTypes.Code;
import org.citygml4j.model.gml.basicTypes.Measure;
import org.sig3d.citygml.energyADE3beta8.AbstractTimeSeriesPropertyType;
import org.sig3d.citygml.energyADE3beta8.ResourceStatusValueType;
public abstract class AbstractResource extends AbstractFeatureWithLifeSpan implements ADEModelObject {
......@@ -28,6 +29,24 @@ public abstract class AbstractResource extends AbstractFeatureWithLifeSpan imple
private Measure costsMoney;
private Measure yieldsMoney;
private Code referencePeriodValue;
private AbstractTimeSeriesProperty timeDependentCosts;
private AbstractTimeSeriesProperty timeDependentYields;
public AbstractTimeSeriesProperty getTimeDependentYields() {
return timeDependentYields;
}
public void setTimeDependentYields(AbstractTimeSeriesProperty timeDependentYields) {
this.timeDependentYields = timeDependentYields;
}
public AbstractTimeSeriesProperty getTimeDependentCosts() {
return timeDependentCosts;
}
public void setTimeDependentCosts(AbstractTimeSeriesProperty timeDependentCosts) {
this.timeDependentCosts = timeDependentCosts;
}
public Code getReferencePeriodValue() {
return referencePeriodValue;
......@@ -185,6 +204,13 @@ public abstract class AbstractResource extends AbstractFeatureWithLifeSpan imple
return referencePeriodValue!=null;
}
public boolean isSetTimeDependentCosts() {
return timeDependentCosts != null;
}
public boolean isSetTimeDependentYields() {
return timeDependentYields != null;
}
@Override
public void accept(GMLVisitor gmlVisitor) {
gmlVisitor.visit(this);
......
package org.citygml4j.ade.energy3.model.core;
import org.citygml4j.ade.energy3.model.supportingClasses.AbstractFeatureWithLifeSpan;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
......@@ -11,7 +12,7 @@ import org.citygml4j.model.gml.feature.AbstractFeature;
import javax.xml.datatype.XMLGregorianCalendar;
public class RefurbishmentMeasure extends AbstractFeature implements ADEModelObject {
public class RefurbishmentMeasure extends AbstractFeatureWithLifeSpan implements ADEModelObject {
private Code type;
private XMLGregorianCalendar startDate;
......
package org.citygml4j.ade.energy3.model.core;
import org.citygml4j.ade.energy3.model.supportingClasses.AbstractTimeSeriesProperty;
import org.citygml4j.ade.energy3.model.supportingClasses.SensorData;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
......@@ -11,29 +12,29 @@ import org.citygml4j.model.gml.basicTypes.Code;
import org.citygml4j.model.gml.basicTypes.Measure;
import org.citygml4j.model.gml.feature.AbstractFeature;
public class WeatherData extends AbstractFeature implements ADEModelObject {
private Code libraryCode;
public class WeatherData extends SensorData implements ADEModelObject {
// private Code libraryCode;
private Code type;
private Code valueType;
private Measure yearlyValue;
private ReferencePointProperty position;
private AbstractTimeSeriesProperty timeDependentValues;
public AbstractTimeSeriesProperty getTimeDependentValues() {
return timeDependentValues;
}
public void setTimeDependentValues(AbstractTimeSeriesProperty timeDependentValues) {
this.timeDependentValues = timeDependentValues;
}
public Code getLibraryCode() {
return libraryCode;
}
public void setLibraryCode(Code libraryCode) {
this.libraryCode = libraryCode;
}
// private Code valueType;
// private Measure yearlyValue;
// private ReferencePointProperty position;
// private AbstractTimeSeriesProperty timeDependentValues;
// public AbstractTimeSeriesProperty getTimeDependentValues() {
// return timeDependentValues;
// }
//
// public void setTimeDependentValues(AbstractTimeSeriesProperty timeDependentValues) {
// this.timeDependentValues = timeDependentValues;
// }
//
// public Code getLibraryCode() {
// return libraryCode;
// }
//
// public void setLibraryCode(Code libraryCode) {
// this.libraryCode = libraryCode;
// }
public Code getType() {
return type;
......@@ -43,48 +44,48 @@ public class WeatherData extends AbstractFeature implements ADEModelObject {
this.type = type;
}
public Code getValueType() {
return valueType;
}
public void setValueType(Code valueType) {
this.valueType = valueType;
}
public Measure getYearlyValue() {
return yearlyValue;
}
public void setYearlyValue(Measure yearlyValue) {
this.yearlyValue = yearlyValue;
}
public ReferencePointProperty getPosition() {
return position;
}
public void setPosition(ReferencePointProperty position) {
this.position = position;
}
public boolean isSetPosition() {
return position != null;
}
public boolean isSetValueType() {
return valueType != null;
}
public boolean isSetYearlyValue() {
return yearlyValue != null;
}
// public Code getValueType() {
// return valueType;
// }
//
// public void setValueType(Code valueType) {
// this.valueType = valueType;
// }
//
// public Measure getYearlyValue() {
// return yearlyValue;
// }
//
// public void setYearlyValue(Measure yearlyValue) {
// this.yearlyValue = yearlyValue;
// }
//
// public ReferencePointProperty getPosition() {
// return position;
// }
//
// public void setPosition(ReferencePointProperty position) {
// this.position = position;
// }
//
// public boolean isSetPosition() {
// return position != null;
// }
// public boolean isSetValueType() {
// return valueType != null;
// }
// public boolean isSetYearlyValue() {
// return yearlyValue != null;
// }
public boolean isSetType() {
return type != null;
}
public boolean isSetLibraryCode() {
return libraryCode != null;
}
public boolean isSetTimeDependentValues() {
return timeDependentValues != null;
}
// public boolean isSetLibraryCode() {
// return libraryCode != null;
// }
// public boolean isSetTimeDependentValues() {
// return timeDependentValues != null;
// }
@Override
public Object copy(CopyBuilder copyBuilder) {
......@@ -96,22 +97,22 @@ public class WeatherData extends AbstractFeature implements ADEModelObject {
WeatherData copy = (target == null) ? new WeatherData() : (WeatherData) target;
super.copyTo(copy, copyBuilder);
if (isSetPosition())
copy.setPosition((ReferencePointProperty) copyBuilder.copy(position));
if (isSetValueType())
copy.setValueType((Code) copyBuilder.copy(valueType));
if (isSetLibraryCode())
copy.setLibraryCode((Code) copyBuilder.copy(libraryCode));
if (isSetYearlyValue())
copy.setYearlyValue((Measure) copyBuilder.copy(yearlyValue));
// if (isSetPosition())
// copy.setPosition((ReferencePointProperty) copyBuilder.copy(position));
//
// if (isSetValueType())
// copy.setValueType((Code) copyBuilder.copy(valueType));
//
// if (isSetLibraryCode())
// copy.setLibraryCode((Code) copyBuilder.copy(libraryCode));
//
// if (isSetYearlyValue())
// copy.setYearlyValue((Measure) copyBuilder.copy(yearlyValue));
if (isSetType())
copy.setType((Code) copyBuilder.copy(type));
if (isSetTimeDependentValues())
copy.setTimeDependentValues((AbstractTimeSeriesProperty) copyBuilder.copy(this));
// if (isSetTimeDependentValues())
// copy.setTimeDependentValues((AbstractTimeSeriesProperty) copyBuilder.copy(this));
return copy;
}
......
package org.citygml4j.ade.energy3.model.supportingClasses;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
import org.citygml4j.model.common.visitor.FeatureVisitor;
import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.basicTypes.Code;
import org.citygml4j.model.gml.basicTypes.Measure;
import org.citygml4j.model.gml.feature.AbstractFeature;
import org.citygml4j.model.gml.geometry.primitives.PointProperty;
public class SensorData extends AbstractADEFeature implements ADEModelObject {
private Code type;
private Code valueType;
private Measure yearlyValue;
private PointProperty position;
private AbstractTimeSeriesProperty timeDependentValues;
public AbstractTimeSeriesProperty getTimeDependentValues() {
return timeDependentValues;
}
public boolean isTimeDependentValues() {
return timeDependentValues != null;
}
public void setTimeDependentValues(AbstractTimeSeriesProperty timeDependentValues) {
this.timeDependentValues = timeDependentValues;
}
public boolean isSetType() {
return type != null;
}
public boolean isSetValueType() {
return valueType != null;
}
public boolean isSetYearlyValue() {
return yearlyValue != null;
}
public boolean isSetPosition() {
return position != null;
}
public Code getType() {
return type;
}
public void setType(Code type) {
this.type = type;
}
public Code getValueType() {
return valueType;
}
public void setValueType(Code valueType) {
this.valueType = valueType;
}
public Measure getYearlyValue() {
return yearlyValue;
}
public void setYearlyValue(Measure yearlyValue) {
this.yearlyValue = yearlyValue;
}
public PointProperty getPosition() {
return position;
}
public void setPosition(PointProperty position) {
this.position = position;
}
@Override
public void accept(GMLVisitor gmlVisitor) {
gmlVisitor.visit(this);
}
@Override
public <T> T accept(GMLFunctor<T> gmlFunctor) {
return gmlFunctor.apply(this);
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new SensorDataProperty(), copyBuilder);
}
@Override
public void accept(FeatureVisitor featureVisitor) {
featureVisitor.visit(this);
}
@Override
public <T> T accept(FeatureFunctor<T> featureFunctor) {
return featureFunctor.apply(this);
}
}
package org.citygml4j.ade.energy3.model.supportingClasses;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.gml.base.AssociationByRepOrRef;
public class SensorDataProperty extends AssociationByRepOrRef<SensorData> implements ADEModelObject {
public SensorDataProperty() {
}
public SensorDataProperty(SensorData sensorData) {
super(sensorData);
}
public SensorData getSensorData() {
return super.getObject();
}
public boolean isSetSensorData() {
return super.isSetObject();
}
public void setSensorData(SensorData sensorData) {
super.setObject(sensorData);
}
public void unsetSensorData() {
super.unsetObject();
}
@Override
public Class<SensorData> getAssociableClass() {
return SensorData.class;
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new SensorDataProperty(), copyBuilder);
}
@Override
public Object copyTo(Object target, CopyBuilder copyBuilder) {
SensorDataProperty copy = (target == null) ? new SensorDataProperty() : (SensorDataProperty) target;
return super.copyTo(copy, copyBuilder);
}
}
......@@ -3,12 +3,22 @@ package org.citygml4j.ade.energy3.model.supportingClasses;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.citygml.cityobjectgroup.CityObjectGroup;
import org.citygml4j.model.gml.basicTypes.Code;
import org.citygml4j.model.gml.basicTypes.Measure;
public class UrbanFunctionArea extends CityObjectGroup implements ADEModelObject {
private Code type;
private Code code;
private Measure area;
public Measure getArea() {
return area;
}
public void setArea(Measure area) {
this.area = area;
}
public Code getType() {
return type;
}
......@@ -32,4 +42,7 @@ public class UrbanFunctionArea extends CityObjectGroup implements ADEModelObject
public boolean isSetCode() {
return code != null;
}
public boolean isSetArea() {
return area != null;
}
}
Supports Markdown
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