use of net.opengis.swe.x20.TextType in project arctic-sea by 52North.
the class SweCommonEncoderv20 method asPropertyType.
private XmlObject asPropertyType(AbstractDataComponentType type) throws NotYetSupportedEncodingException {
if (type instanceof BooleanType) {
BooleanPropertyType propertyType = BooleanPropertyType.Factory.newInstance();
propertyType.setBoolean((BooleanType) type);
return propertyType;
} else if (type instanceof CountType) {
CountPropertyType propertyType = CountPropertyType.Factory.newInstance();
propertyType.setCount((CountType) type);
return propertyType;
} else if (type instanceof CountRangeType) {
CountRangePropertyType propertyType = CountRangePropertyType.Factory.newInstance();
propertyType.setCountRange((CountRangeType) type);
return propertyType;
} else if (type instanceof QuantityType) {
QuantityPropertyType propertyType = QuantityPropertyType.Factory.newInstance();
propertyType.setQuantity((QuantityType) type);
return propertyType;
} else if (type instanceof QuantityRangeType) {
QuantityRangePropertyType propertyType = QuantityRangePropertyType.Factory.newInstance();
propertyType.setQuantityRange((QuantityRangeType) type);
return propertyType;
} else if (type instanceof TimeType) {
TimePropertyType propertyType = TimePropertyType.Factory.newInstance();
propertyType.setTime((TimeType) type);
return propertyType;
} else if (type instanceof TimeRangeType) {
TimeRangePropertyType propertyType = TimeRangePropertyType.Factory.newInstance();
propertyType.setTimeRange((TimeRangeType) type);
return propertyType;
} else if (type instanceof CategoryType) {
CategoryPropertyType propertyType = CategoryPropertyType.Factory.newInstance();
propertyType.setCategory((CategoryType) type);
return propertyType;
} else if (type instanceof CategoryRangeType) {
CategoryRangePropertyType propertyType = CategoryRangePropertyType.Factory.newInstance();
propertyType.setCategoryRange((CategoryRangeType) type);
return propertyType;
} else if (type instanceof MatrixType) {
MatrixPropertyType propertyType = MatrixPropertyType.Factory.newInstance();
propertyType.setMatrix((MatrixType) type);
return propertyType;
} else if (type instanceof DataArrayType) {
DataArrayPropertyType propertyType = DataArrayPropertyType.Factory.newInstance();
propertyType.setDataArray1((DataArrayType) type);
return propertyType;
} else if (type instanceof DataChoiceType) {
DataChoicePropertyType propertyType = DataChoicePropertyType.Factory.newInstance();
propertyType.setDataChoice((DataChoiceType) type);
return propertyType;
} else if (type instanceof DataRecordType) {
DataRecordPropertyType propertyType = DataRecordPropertyType.Factory.newInstance();
propertyType.setDataRecord((DataRecordType) type);
return propertyType;
} else if (type instanceof TextType) {
TextPropertyType propertyType = TextPropertyType.Factory.newInstance();
propertyType.setText((TextType) type);
return propertyType;
} else if (type instanceof VectorType) {
VectorPropertyType propertyType = VectorPropertyType.Factory.newInstance();
propertyType.setVector((VectorType) type);
return propertyType;
} else {
throw new NotYetSupportedEncodingException(type.getClass().getName(), type);
}
}
use of net.opengis.swe.x20.TextType in project arctic-sea by 52North.
the class SweCommonEncoderv20 method asDocument.
private XmlObject asDocument(AbstractDataComponentType type) throws NotYetSupportedEncodingException {
if (type instanceof BooleanType) {
BooleanDocument document = BooleanDocument.Factory.newInstance();
document.setBoolean((BooleanType) type);
return document;
} else if (type instanceof CountType) {
CountDocument document = CountDocument.Factory.newInstance();
document.setCount((CountType) type);
return document;
} else if (type instanceof CountRangeType) {
CountRangeDocument document = CountRangeDocument.Factory.newInstance();
document.setCountRange((CountRangeType) type);
return document;
} else if (type instanceof QuantityType) {
QuantityDocument document = QuantityDocument.Factory.newInstance();
document.setQuantity((QuantityType) type);
return document;
} else if (type instanceof QuantityRangeType) {
QuantityRangeDocument document = QuantityRangeDocument.Factory.newInstance();
document.setQuantityRange((QuantityRangeType) type);
return document;
} else if (type instanceof TimeType) {
TimeDocument document = TimeDocument.Factory.newInstance();
document.setTime((TimeType) type);
return document;
} else if (type instanceof TimeRangeType) {
TimeRangeDocument document = TimeRangeDocument.Factory.newInstance();
document.setTimeRange((TimeRangeType) type);
return document;
} else if (type instanceof CategoryType) {
CategoryDocument document = CategoryDocument.Factory.newInstance();
document.setCategory((CategoryType) type);
return document;
} else if (type instanceof CategoryRangeType) {
CategoryRangeDocument document = CategoryRangeDocument.Factory.newInstance();
document.setCategoryRange((CategoryRangeType) type);
return document;
} else if (type instanceof MatrixType) {
MatrixDocument document = MatrixDocument.Factory.newInstance();
document.setMatrix((MatrixType) type);
return document;
} else if (type instanceof DataArrayType) {
DataArrayDocument document = DataArrayDocument.Factory.newInstance();
document.setDataArray1((DataArrayType) type);
return document;
} else if (type instanceof DataChoiceType) {
DataChoiceDocument document = DataChoiceDocument.Factory.newInstance();
document.setDataChoice((DataChoiceType) type);
return document;
} else if (type instanceof DataRecordType) {
DataRecordDocument document = DataRecordDocument.Factory.newInstance();
document.setDataRecord((DataRecordType) type);
return document;
} else if (type instanceof TextType) {
TextDocument document = TextDocument.Factory.newInstance();
document.setText((TextType) type);
return document;
} else if (type instanceof VectorType) {
VectorDocument document = VectorDocument.Factory.newInstance();
document.setVector((VectorType) type);
return document;
} else {
throw new NotYetSupportedEncodingException(type.getClass().getName(), type);
}
}
use of net.opengis.swe.x20.TextType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapToFLUXFAReportMessage.
@SneakyThrows
public FLUXFAReportMessage mapToFLUXFAReportMessage(List<FaReportDocumentEntity> faReportMessageEntity) {
FLUXFAReportMessage target = new FLUXFAReportMessage();
FLUXReportDocument fluxReportDocument = new FLUXReportDocument();
CodeType codeType = new CodeType();
codeType.setValue("9");
codeType.setListID("FLUX_GP_PURPOSE");
fluxReportDocument.setPurposeCode(codeType);
IDType idType = new IDType();
idType.setSchemeID("UUID");
idType.setValue(UUID.randomUUID().toString());
fluxReportDocument.setIDS(Collections.singletonList(idType));
DateTimeType dateTimeType = new DateTimeType();
dateTimeType.setDateTime(DateUtils.getCurrentDate());
fluxReportDocument.setCreationDateTime(dateTimeType);
TextType textType = new TextType();
textType.setValue("LOAD_REPORTS");
fluxReportDocument.setPurpose(textType);
FLUXParty party = new FLUXParty();
IDType idType1 = new IDType();
idType1.setSchemeID("FLUX_GP_PARTY");
idType1.setValue("TODO_SET_NODE_ALIAS");
party.setIDS(Collections.singletonList(idType1));
fluxReportDocument.setOwnerFLUXParty(party);
target.setFLUXReportDocument(fluxReportDocument);
if (CollectionUtils.isNotEmpty(faReportMessageEntity)) {
mapFAReportDocuments(target, faReportMessageEntity);
}
return target;
}
use of net.opengis.swe.x20.TextType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapNames.
private void mapNames(RegistrationLocation target, RegistrationLocationEntity source) {
if (ObjectUtils.allNotNull(target, source)) {
TextType textType = new TextType();
textType.setValue(source.getName());
textType.setLanguageID(source.getNameLanguageId());
target.setNames(singletonList(textType));
}
}
use of net.opengis.swe.x20.TextType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapDescription.
private void mapDescription(RegistrationEvent target, String description, String descLanguageId) {
if (ObjectUtils.allNotNull(target) && StringUtils.isNotEmpty(description) || StringUtils.isNotEmpty(descLanguageId)) {
TextType textType = new TextType();
if (StringUtils.isNotEmpty(description)) {
textType.setValue(description);
}
if (StringUtils.isNotEmpty(descLanguageId)) {
textType.setLanguageID(descLanguageId);
}
target.setDescriptions(Collections.singletonList(textType));
}
}
Aggregations