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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
package com.github.javaparser.ast.modules;
import com.github.javaparser.Range;
import com.github.javaparser.ast.AllFieldsConstructor;
import com.github.javaparser.ast.Node;
import com.github.javaparser.ast.NodeList;
import com.github.javaparser.ast.expr.Name;
import com.github.javaparser.ast.nodeTypes.NodeWithName;
import com.github.javaparser.ast.observer.ObservableProperty;
import com.github.javaparser.ast.visitor.CloneVisitor;
import com.github.javaparser.ast.visitor.GenericVisitor;
import com.github.javaparser.ast.visitor.VoidVisitor;
import com.github.javaparser.metamodel.JavaParserMetaModel;
import com.github.javaparser.metamodel.ModuleExportsStmtMetaModel;
import java.util.Arrays;
import java.util.List;
import static com.github.javaparser.utils.Utils.assertNotNull;
import javax.annotation.Generated;
public class ModuleExportsStmt extends ModuleStmt implements NodeWithName<ModuleExportsStmt> {
private Name name;
private NodeList<Name> moduleNames;
public ModuleExportsStmt() {
this(null, new Name(), new NodeList<>());
}
@AllFieldsConstructor
public ModuleExportsStmt(Name name, NodeList<Name> moduleNames) {
this(null, name, moduleNames);
}
/**This constructor is used by the parser and is considered private.*/
@Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator")
public ModuleExportsStmt(Range range, Name name, NodeList<Name> moduleNames) {
super(range);
setName(name);
setModuleNames(moduleNames);
customInitialization();
}
@Override
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
return v.visit(this, arg);
}
@Override
public <A> void accept(VoidVisitor<A> v, A arg) {
v.visit(this, arg);
}
@Override
public boolean remove(Node node) {
if (node == null)
return false;
for (int i = 0; i < moduleNames.size(); i++) {
if (moduleNames.get(i) == node) {
moduleNames.remove(i);
return true;
}
}
return super.remove(node);
}
public Name getName() {
return name;
}
public ModuleExportsStmt setName(final Name name) {
assertNotNull(name);
if (name == this.name) {
return (ModuleExportsStmt) this;
}
notifyPropertyChange(ObservableProperty.NAME, this.name, name);
if (this.name != null)
this.name.setParentNode(null);
this.name = name;
setAsParentNodeOf(name);
return this;
}
public NodeList<Name> getModuleNames() {
return moduleNames;
}
public ModuleExportsStmt setModuleNames(final NodeList<Name> moduleNames) {
assertNotNull(moduleNames);
if (moduleNames == this.moduleNames) {
return (ModuleExportsStmt) this;
}
notifyPropertyChange(ObservableProperty.MODULE_NAMES, this.moduleNames, moduleNames);
if (this.moduleNames != null)
this.moduleNames.setParentNode(null);
this.moduleNames = moduleNames;
setAsParentNodeOf(moduleNames);
return this;
}
@Override
public List<NodeList<?>> getNodeLists() {
return Arrays.asList(getModuleNames());
}
@Override
public ModuleExportsStmt clone() {
return (ModuleExportsStmt) accept(new CloneVisitor(), null);
}
@Override
public ModuleExportsStmtMetaModel getMetaModel() {
return JavaParserMetaModel.moduleExportsStmtMetaModel;
}
}
|