1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.rundeck.api.parser;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.dom4j.Node;
20 import org.rundeck.api.domain.RundeckProject;
21
22
23
24
25
26
27 public class ProjectParser extends BaseXpathParser<RundeckProject> {
28 public ProjectParser() {
29 }
30
31 public ProjectParser(final String xpath) {
32 super(xpath);
33 }
34
35 @Override
36 public RundeckProject parse(Node projectNode) {
37
38 RundeckProject project = new RundeckProject();
39
40 project.setName(StringUtils.trimToNull(projectNode.valueOf("name")));
41 project.setDescription(StringUtils.trimToNull(projectNode.valueOf("description")));
42 project.setResourceModelProviderUrl(StringUtils.trimToNull(projectNode.valueOf("resources/providerURL")));
43
44 return project;
45 }
46
47 }