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.hpprinter.internal.api;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.w3c.dom.Document;
17 import org.w3c.dom.Element;
20 * The {@link HPScannerStatusFeatures} is responsible for determining what type of printer scanner
21 * status features the Web Interface supports.
23 * @author Stewart Cossey - Initial contribution
26 public class HPScannerStatusFeatures {
27 public static final String ENDPOINT = "/eSCL/ScannerStatus";
29 private final boolean hasStatus;
30 private final boolean hasAdf;
32 public HPScannerStatusFeatures(Document document) {
33 boolean localHasStatus = false;
34 boolean localHasAdf = false;
36 Element nodes = (Element) document.getDocumentElement();
37 localHasStatus = (nodes.getElementsByTagName("pwg:State").getLength() > 0);
38 localHasAdf = (nodes.getElementsByTagName("scan:AdfState").getLength() > 0);
40 hasStatus = localHasStatus;
44 public boolean hasStatus() {
48 public boolean hasAdf() {