blob: d9e25dc28d1b600d10b9e222e7ee38dbc9e3704c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
/*******************************************************************************
* Copyright (c) 2010, 2016 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.help.internal.criteria;
import org.eclipse.help.ICriterionDefinition;
import org.eclipse.help.ICriterionValueDefinition;
import org.eclipse.help.internal.UAElement;
import org.w3c.dom.Element;
public class CriterionDefinition extends UAElement implements ICriterionDefinition {
public static final String NAME = "criterion"; //$NON-NLS-1$
public static final String ATTRIBUTE_ID = "id"; //$NON-NLS-1$
public static final String ATTRIBUTE_NAME = "name"; //$NON-NLS-1$
public CriterionDefinition(ICriterionDefinition src) {
super(NAME, src);
setId(src.getId());
setName(src.getName());
appendChildren(src.getChildren());
}
public CriterionDefinition(Element src) {
super(src);
}
@Override
public String getId() {
return getAttribute(ATTRIBUTE_ID);
}
@Override
public String getName() {
return getAttribute(ATTRIBUTE_NAME);
}
public void setId(String id) {
setAttribute(ATTRIBUTE_ID, id);
}
public void setName(String name){
setAttribute(ATTRIBUTE_NAME, name);
}
@Override
public ICriterionValueDefinition[] getCriterionValueDefinitions() {
return getChildren(ICriterionValueDefinition.class);
}
}
|