2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.ihc.internal.ws.datatypes;
15 import java.io.IOException;
17 import javax.xml.xpath.XPathExpressionException;
19 import org.openhab.binding.ihc.internal.ws.exeptions.IhcExecption;
22 * Class for WSSegmentationSize complex type.
24 * @author Pauli Anttila - Initial contribution
26 public class WSSegmentationSize {
30 public WSSegmentationSize() {
33 public WSSegmentationSize(int size) {
38 * Gets the segmentation size value.
40 * @return segmentation size
42 public int getSegmentationSize() {
47 * Sets the segmentation size value.
51 public void setSegmentationSize(int size) {
55 public WSSegmentationSize parseXMLData(String data) throws IhcExecption {
57 String value = XPathUtils.parseXMLValue(data,
58 "/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:getIHCProjectSegmentationSize1");
59 setSegmentationSize(Integer.parseInt(value));
61 } catch (IOException | XPathExpressionException | NumberFormatException e) {
62 throw new IhcExecption("Error occured during XML data parsing", e);