blob: 8e90d4744a7a03701cb1dc6dfb1a9aabcd101242 [file] [log] [blame]
Stefano Lenzi476013d2007-09-21 23:59:54 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19package org.apache.felix.sandbox.obr.plugin;
20
21import org.w3c.dom.Document;
22import org.w3c.dom.Element;
23import org.w3c.dom.Node;
24
25/**
26 * this class store a Require tag.
27 * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
28 */
29public class Require {
30
31 /**
32 * store the extend attribute.
33 */
34 private String m_extend;
35
36 /**
37 * store the multiple attribute.
38 */
39 private String m_multiple;
40
41 /**
42 * store the optional attribute.
43 */
44 private String m_optional;
45
46 /**
47 * store the name attribute.
48 */
49 private String m_name;
50
51 /**
52 * store the filter attribute.
53 */
54 private String m_filter;
55
56 /**
57 * store the value of the tag.
58 */
59 private String m_value;
60
61 /**
62 * get the extend attribute.
63 * @return a string which contains the value of the boolean
64 */
65 public String getExtend() {
66 return m_extend;
67 }
68
69 /**
70 * set the extend attribute.
71 * @param extend new value for the extend attribute
72 */
73 public void setExtend(String extend) {
74 this.m_extend = extend;
75 }
76
77 /**
78 * get the filter attribute.
79 * @return m_filter value
80 */
81 public String getFilter() {
82 return m_filter;
83 }
84
85 /**
86 * set the filter attribute.
87 * @param filter new value for filter
88 */
89 public void setFilter(String filter) {
90 this.m_filter = filter;
91 }
92
93 /**
94 * get multiple attribute.
95 * @return m_multiple value
96 */
97 public String getMultiple() {
98 return m_multiple;
99 }
100
101 /**
102 * set multiple attribute.
103 * @param multiple new value for m_multiple
104 */
105 public void setMultiple(String multiple) {
106 this.m_multiple = multiple;
107 }
108
109 /**
110 * get name attribute.
111 * @return m_name value
112 */
113 public String getName() {
114 return m_name;
115 }
116
117 /**
118 * set name attribute.
119 * @param name new value for m_name
120 */
121 public void setName(String name) {
122 this.m_name = name;
123 }
124
125 /**
126 * get the optional attribute.
127 * @return m_optional value
128 */
129 public String getOptional() {
130 return m_optional;
131 }
132
133 /**
134 * set the optional attribute.
135 * @param optionnal new value for m_optional
136 */
137 public void setOptional(String optionnal) {
138 this.m_optional = optionnal;
139 }
140
141 /**
142 * get value of the tag.
143 * @return value of this tag
144 */
145 public String getValue() {
146 return m_value;
147 }
148
149 /**
150 * set the value of the tag.
151 * @param value new value for this tag
152 */
153 public void setValue(String value) {
154 this.m_value = value;
155 }
156
157 /**
158 * transform this object to Node.
159 *
160 * @param father father document for create Node
161 * @return node
162 */
163 public Node getNode(Document father) {
164 Element require = father.createElement("require");
165 require.setAttribute("name", this.getName());
166 require.setAttribute("filter", this.getFilter());
167 require.setAttribute("extend", this.getExtend());
168 require.setAttribute("multiple", this.getMultiple());
169 require.setAttribute("optional", this.getOptional());
Stuart McCullochbfc05cf2007-09-26 15:34:00 +0000170 XmlHelper.setTextContent(require,this.getValue());
Stefano Lenzi476013d2007-09-21 23:59:54 +0000171
172 return require;
173 }
174
175}