Search in sources :

Example 1 with Field

use of net.opengis.swe.x20.DataRecordType.Field in project arctic-sea by 52North.

the class SweCommonEncoderv20 method createField.

private DataRecordType.Field createField(SweField field) throws EncodingException {
    SweAbstractDataComponent element = field.getElement();
    DataRecordType.Field xmlField = DataRecordType.Field.Factory.newInstance(getXmlOptions());
    if (field.isSetName()) {
        xmlField.setName(NcName.makeValid(field.getName().getValue()));
    }
    XmlObject encodeObjectToXml = createAbstractDataComponent(element, EncodingContext.empty());
    XmlObject substituteElement = XmlHelper.substituteElement(xmlField.addNewAbstractDataComponent(), encodeObjectToXml);
    substituteElement.set(encodeObjectToXml);
    return xmlField;
}
Also used : DataRecordType(net.opengis.swe.x20.DataRecordType) SweAbstractDataComponent(org.n52.shetland.ogc.swe.SweAbstractDataComponent) Field(net.opengis.swe.x20.DataRecordType.Field) XmlObject(org.apache.xmlbeans.XmlObject)

Example 2 with Field

use of net.opengis.swe.x20.DataRecordType.Field in project arctic-sea by 52North.

the class SensorMLDecoderV20Test method shouldDecodeDataInterfaceInterfaceParameters.

@Test
@Ignore("not yet implemented")
public void shouldDecodeDataInterfaceInterfaceParameters() throws DecodingException {
    DataInterfaceType xbDataInterface = DataInterfaceType.Factory.newInstance();
    DataRecordPropertyType xbInterfaceParameters = xbDataInterface.addNewInterfaceParameters();
    Field field = xbInterfaceParameters.addNewDataRecord().addNewField();
    field.setName("test-field-name");
    SmlDataInterface parsedDataInterface = getDecoder().parseDataInterfaceType(xbDataInterface);
    assertThat(parsedDataInterface.isSetInterfaceParameters(), is(true));
    assertThat(parsedDataInterface.getInterfaceParameters(), CoreMatchers.isA(SweDataRecord.class));
}
Also used : Field(net.opengis.swe.x20.DataRecordType.Field) DataInterfaceType(net.opengis.sensorml.x20.DataInterfaceType) SweDataRecord(org.n52.shetland.ogc.swe.SweDataRecord) DataRecordPropertyType(net.opengis.swe.x20.DataRecordPropertyType) SmlDataInterface(org.n52.shetland.ogc.sensorML.v20.SmlDataInterface) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Field (net.opengis.swe.x20.DataRecordType.Field)2 DataInterfaceType (net.opengis.sensorml.x20.DataInterfaceType)1 DataRecordPropertyType (net.opengis.swe.x20.DataRecordPropertyType)1 DataRecordType (net.opengis.swe.x20.DataRecordType)1 XmlObject (org.apache.xmlbeans.XmlObject)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1 SmlDataInterface (org.n52.shetland.ogc.sensorML.v20.SmlDataInterface)1 SweAbstractDataComponent (org.n52.shetland.ogc.swe.SweAbstractDataComponent)1 SweDataRecord (org.n52.shetland.ogc.swe.SweDataRecord)1