1
2
3
4
5
6
7
8
9
10
11
12
13 package org.abstracthorizon.danube.webdav.xml.dav.request;
14
15 import org.abstracthorizon.danube.webdav.xml.XMLParserHandler;
16 import org.abstracthorizon.danube.webdav.xml.dav.DAVFactory;
17
18 import org.xml.sax.Attributes;
19 import org.xml.sax.SAXException;
20
21
22
23
24
25
26 public class LockInfo extends LockEntry {
27
28
29 protected Owner owner;
30
31
32
33
34
35
36 public LockInfo(XMLParserHandler parent, DAVFactory factory) {
37 super(parent, factory);
38 lockScope = factory.newLockScope(this);
39 lockType = factory.newLockType(this);
40 }
41
42 @Override
43 public Object start(Object current, String tag, Attributes attributes) throws SAXException {
44 if ("owner".equals(tag)) {
45 owner = new Owner(this);
46 return owner;
47 } else {
48 return super.start(current, tag, attributes);
49 }
50 }
51
52 @Override
53 public Object end(Object current, String tag, String value) throws SAXException {
54 return this;
55 }
56
57
58
59
60
61 public Object getOwner() {
62 if (owner != null) {
63 return owner.getOwner();
64 } else {
65 return null;
66 }
67 }
68
69 @Override
70 public String toString() {
71 if (owner == null) {
72 return "LockInfo[" + lockScope + "," + lockType + "]";
73 } else {
74 return "LockInfo[" + lockScope + "," + lockType + "," + owner + "]";
75 }
76 }
77 }