View Javadoc
1   /*
2    * Copyright (C) 2013 4th Line GmbH, Switzerland
3    *
4    * The contents of this file are subject to the terms of either the GNU
5    * Lesser General Public License Version 2 or later ("LGPL") or the
6    * Common Development and Distribution License Version 1 or later
7    * ("CDDL") (collectively, the "License"). You may not use this file
8    * except in compliance with the License. See LICENSE.txt for more
9    * information.
10   *
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14   */
15  
16  package org.fourthline.cling.binding.xml;
17  
18  import org.w3c.dom.Node;
19  
20  /**
21   * Utility interface with static declarations of all "strings".
22   *
23   * @author Christian Bauer
24   */
25  public abstract class Descriptor {
26  
27      public interface Device {
28  
29          public static final String NAMESPACE_URI = "urn:schemas-upnp-org:device-1-0";
30          public static final String DLNA_NAMESPACE_URI = "urn:schemas-dlna-org:device-1-0";
31          public static final String DLNA_PREFIX = "dlna";
32          public static final String SEC_NAMESPACE_URI = "http://www.sec.co.kr/dlna";
33          public static final String SEC_PREFIX = "sec";
34  
35          public enum ELEMENT {
36              root,
37              specVersion, major, minor,
38              URLBase,
39              device,
40              UDN,
41              X_DLNADOC,
42              X_DLNACAP,
43              ProductCap,
44              X_ProductCap,
45              deviceType,
46              friendlyName,
47              manufacturer,
48              manufacturerURL,
49              modelDescription,
50              modelName,
51              modelNumber,
52              modelURL,
53              presentationURL,
54              UPC,
55              serialNumber,
56              iconList, icon, width, height, depth, url, mimetype,
57              serviceList, service, serviceType, serviceId, SCPDURL, controlURL, eventSubURL,
58              deviceList;
59  
60              public static ELEMENT valueOrNullOf(String s) {
61                  try {
62                      return valueOf(s);
63                  } catch (IllegalArgumentException ex) {
64                      return null;
65                  }
66              }
67  
68              public boolean equals(Node node) {
69                  return toString().equals(node.getLocalName());
70              }
71          }
72      }
73  
74      public interface Service {
75  
76          public static final String NAMESPACE_URI = "urn:schemas-upnp-org:service-1-0";
77  
78          public enum ELEMENT {
79              scpd,
80              specVersion, major, minor,
81              actionList, action, name,
82              argumentList, argument, direction, relatedStateVariable, retval,
83              serviceStateTable, stateVariable, dataType, defaultValue,
84              allowedValueList, allowedValue, allowedValueRange, minimum, maximum, step;
85  
86              public static ELEMENT valueOrNullOf(String s) {
87                  try {
88                      return valueOf(s);
89                  } catch (IllegalArgumentException ex) {
90                      return null;
91                  }
92              }
93  
94              public boolean equals(Node node) {
95                  return toString().equals(node.getLocalName());
96              }
97  
98          }
99  
100         public enum ATTRIBUTE {
101             sendEvents
102         }
103     }
104 
105 }