-
Notifications
You must be signed in to change notification settings - Fork 2
/
hnadmods.txt
179 lines (176 loc) · 9.55 KB
/
hnadmods.txt
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
protected<_P extends BodyarchType >_P init(final _P _product) {
if (this.inertialOrJointOrFreejoint!= null) {
final List<JAXBElement<?>> inertialOrJointOrFreejoint = new ArrayList<JAXBElement<?>>(this.inertialOrJointOrFreejoint.size());
for (Buildable _item: this.inertialOrJointOrFreejoint) {
try {
inertialOrJointOrFreejoint.add(buildRecoursive(_item));
} catch (NoSuchMethodException | SecurityException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
_product.inertialOrJointOrFreejoint = inertialOrJointOrFreejoint;
}
return super.init(_product);
}
private JAXBElement<?> buildRecoursive(Object o) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException{
Class<? extends Object> class1 = o.getClass();
//System.out.println("Class "+class1);
Method setNameMethod = class1.getMethod("build");
Object product = setNameMethod.invoke(o);
if(JAXBElement.class.isInstance(product))
return (JAXBElement<?>)product;
if (product==null)
throw new NullPointerException();
if(BodyarchType.class.isInstance(product)) {
BodyarchType bat = (BodyarchType)product;
return new JAXBElement<BodyarchType>(new QName("body"),BodyarchType.class,bat);
}
//GeomType
if(GeomType.class.isInstance(product)) {
GeomType bat = (GeomType)product;
return new JAXBElement<GeomType>(new QName("geom"),GeomType.class,bat);
}
//LightType
if(LightType.class.isInstance(product)) {
LightType bat = (LightType)product;
return new JAXBElement<LightType>(new QName("light"),LightType.class,bat);
}
//JointType
if(JointType.class.isInstance(product)) {
JointType bat = (JointType)product;
if(bat.getType()==JointtypeType.FREE) {
bat.setType(null);
return new JAXBElement<JointType>(new QName("freejoint"),JointType.class,bat);
}
return new JAXBElement<JointType>(new QName("joint"),JointType.class,bat);
}
// //FreejointType
// if(FreejointType.class.isInstance(product)) {
// FreejointType bat = (FreejointType)product;
// return new JAXBElement<FreejointType>(new QName("freejoint"),FreejointType.class,bat);
// }
//CameraType
if(CameraType.class.isInstance(product)) {
CameraType bat = (CameraType)product;
return new JAXBElement<CameraType>(new QName("camera"),CameraType.class,bat);
}
//InertialType
if(InertialType.class.isInstance(product)) {
InertialType bat = (InertialType)product;
return new JAXBElement<InertialType>(new QName("inertial"),InertialType.class,bat);
}
return buildRecoursive(product);
}
/**
* Returns a new builder to build an additional value of the "camera" property.
* Use {@link org.mujoco.xml.body.CameraType.Builder#end()} to return to the current builder.
*
* @return
* a new builder to build an additional value of the "camera" property.
* Use {@link org.mujoco.xml.body.CameraType.Builder#end()} to return to the current builder.
*/
public org.mujoco.xml.body.InertialType.Builder<? extends BodyType.Builder<_B>> addInertial() {
if (this.inertialOrJointOrFreejoint == null) {
this.inertialOrJointOrFreejoint = new ArrayList<Buildable>();
}
final org.mujoco.xml.body.InertialType.Builder<BodyType.Builder<_B>> camera_Builder = new org.mujoco.xml.body.InertialType.Builder<BodyType.Builder<_B>>(this, null, false);
this.inertialOrJointOrFreejoint.add(camera_Builder);
return camera_Builder;
}
/**
* Returns a new builder to build an additional value of the "camera" property.
* Use {@link org.mujoco.xml.body.CameraType.Builder#end()} to return to the current builder.
*
* @return
* a new builder to build an additional value of the "camera" property.
* Use {@link org.mujoco.xml.body.CameraType.Builder#end()} to return to the current builder.
*/
public org.mujoco.xml.body.CameraType.Builder<? extends BodyType.Builder<_B>> addCamera() {
if (this.inertialOrJointOrFreejoint == null) {
this.inertialOrJointOrFreejoint = new ArrayList<Buildable>();
}
final org.mujoco.xml.body.CameraType.Builder<BodyType.Builder<_B>> camera_Builder = new org.mujoco.xml.body.CameraType.Builder<BodyType.Builder<_B>>(this, null, false);
this.inertialOrJointOrFreejoint.add(camera_Builder);
return camera_Builder;
}
/**
* Returns a new builder to build an additional value of the "body" property.
* Use {@link org.mujoco.xml.BodyarchType.Builder#end()} to return to the current builder.
*
* @return
* a new builder to build an additional value of the "body" property.
* Use {@link org.mujoco.xml.BodyarchType.Builder#end()} to return to the current builder.
*/
public BodyarchType.Builder<? extends BodyType.Builder<_B>> addBody() {
if (this.inertialOrJointOrFreejoint == null) {
this.inertialOrJointOrFreejoint = new ArrayList<Buildable>();
}
final BodyarchType.Builder<BodyType.Builder<_B>> body_Builder = new BodyarchType.Builder<BodyType.Builder<_B>>(this, null, false);
//System.out.println("Builder type is "+body_Builder.getClass());
this.inertialOrJointOrFreejoint.add(body_Builder);
return body_Builder;
}
/**
* Returns a new builder to build an additional value of the "geom" property.
* Use {@link org.mujoco.xml.body.GeomType.Builder#end()} to return to the current builder.
*
* @return
* a new builder to build an additional value of the "geom" property.
* Use {@link org.mujoco.xml.body.GeomType.Builder#end()} to return to the current builder.
*/
public org.mujoco.xml.body.GeomType.Builder<? extends BodyType.Builder<_B>> addGeom() {
if (this.inertialOrJointOrFreejoint == null) {
this.inertialOrJointOrFreejoint = new ArrayList<Buildable>();
}
final org.mujoco.xml.body.GeomType.Builder<BodyType.Builder<_B>> geom_Builder = new org.mujoco.xml.body.GeomType.Builder<BodyType.Builder<_B>>(this, null, false);
this.inertialOrJointOrFreejoint.add(geom_Builder);
return geom_Builder;
}
/**
* Returns a new builder to build an additional value of the "light" property.
* Use {@link org.mujoco.xml.body.LightType.Builder#end()} to return to the current builder.
*
* @return
* a new builder to build an additional value of the "light" property.
* Use {@link org.mujoco.xml.body.LightType.Builder#end()} to return to the current builder.
*/
public org.mujoco.xml.body.LightType.Builder<? extends BodyType.Builder<_B>> addLight() {
if (this.inertialOrJointOrFreejoint == null) {
this.inertialOrJointOrFreejoint = new ArrayList<Buildable>();
}
final org.mujoco.xml.body.LightType.Builder<BodyType.Builder<_B>> light_Builder = new org.mujoco.xml.body.LightType.Builder<BodyType.Builder<_B>>(this, null, false);
this.inertialOrJointOrFreejoint.add(light_Builder);
return light_Builder;
}
//JointType
/**
* Returns a new builder to build an additional value of the "joint" property.
* Use {@link org.mujoco.xml.body.FreejointType.Builder#end()} to return to the current builder.
*
* @return
* a new builder to build an additional value of the "joint" property.
* Use {@link org.mujoco.xml.body.FreejointType.Builder#end()} to return to the current builder.
*/
public org.mujoco.xml.body.JointType.Builder<? extends BodyType.Builder<_B>> addFreejoint() {
return addJoint(JointtypeType.FREE);
}
//JointType
/**
* Returns a new builder to build an additional value of the "joint" property.
* Use {@link org.mujoco.xml.body.JointType.Builder#end()} to return to the current builder.
*
* @return
* a new builder to build an additional value of the "joint" property.
* Use {@link org.mujoco.xml.body.JointType.Builder#end()} to return to the current builder.
*/
public org.mujoco.xml.body.JointType.Builder<? extends BodyType.Builder<_B>> addJoint(JointtypeType type) {
if (this.inertialOrJointOrFreejoint == null) {
this.inertialOrJointOrFreejoint = new ArrayList<Buildable>();
}
final org.mujoco.xml.body.JointType.Builder<BodyType.Builder<_B>> joint_builder = new org.mujoco.xml.body.JointType.Builder<BodyType.Builder<_B>>(this, null, false);
this.inertialOrJointOrFreejoint.add(joint_builder);
joint_builder.withType(type);
return joint_builder;
}