1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.fourthline.cling.support.lastchange;
17
18 import org.fourthline.cling.model.types.Datatype;
19 import org.fourthline.cling.model.types.InvalidValueException;
20 import org.seamless.util.Exceptions;
21
22 import java.net.URI;
23 import java.util.Map;
24 import java.util.logging.Logger;
25
26
27
28
29 public class EventedValueURI extends EventedValue<URI> {
30
31 final private static Logger log = Logger.getLogger(EventedValueURI.class.getName());
32
33 public EventedValueURI(URI value) {
34 super(value);
35 }
36
37 public EventedValueURI(Map.Entry<String, String>[] attributes) {
38 super(attributes);
39 }
40
41 @Override
42 protected URI valueOf(String s) throws InvalidValueException {
43 try {
44
45
46 return super.valueOf(s);
47 } catch (InvalidValueException ex) {
48 log.info("Ignoring invalid URI in evented value '" + s +"': " + Exceptions.unwrap(ex));
49 return null;
50 }
51 }
52
53 @Override
54 protected Datatype getDatatype() {
55 return Datatype.Builtin.URI.getDatatype();
56 }
57 }