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