|
1
|
|
|
/* |
|
2
|
|
|
* Copyright 2014, Armenak Grigoryan, and individual contributors as indicated |
|
3
|
|
|
* by the @authors tag. See the copyright.txt in the distribution for a |
|
4
|
|
|
* full listing of individual contributors. |
|
5
|
|
|
* |
|
6
|
|
|
* This is free software; you can redistribute it and/or modify it |
|
7
|
|
|
* under the terms of the GNU Lesser General Public License as |
|
8
|
|
|
* published by the Free Software Foundation; either version 2.1 of |
|
9
|
|
|
* the License, or (at your option) any later version. |
|
10
|
|
|
* |
|
11
|
|
|
* This software is distributed in the hope that it will be useful, |
|
12
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14
|
|
|
* Lesser General Public License for more details. |
|
15
|
|
|
*/ |
|
16
|
|
|
package com.strider.datadefender.requirement.plan; |
|
17
|
|
|
|
|
18
|
|
|
import java.lang.reflect.InvocationTargetException; |
|
19
|
|
|
|
|
20
|
|
|
import javax.xml.bind.Unmarshaller; |
|
21
|
|
|
import javax.xml.bind.annotation.XmlAccessType; |
|
22
|
|
|
import javax.xml.bind.annotation.XmlAccessorType; |
|
23
|
|
|
import javax.xml.bind.annotation.XmlAttribute; |
|
24
|
|
|
import javax.xml.bind.annotation.XmlID; |
|
25
|
|
|
|
|
26
|
|
|
import lombok.extern.log4j.Log4j2; |
|
27
|
|
|
import lombok.Getter; |
|
28
|
|
|
import lombok.NoArgsConstructor; |
|
29
|
|
|
import lombok.Setter; |
|
30
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* |
|
34
|
|
|
* @author Zaahid Bateson |
|
35
|
|
|
*/ |
|
36
|
|
|
@Log4j2 |
|
37
|
|
|
@Getter |
|
38
|
|
|
@Setter |
|
39
|
|
|
@NoArgsConstructor |
|
40
|
|
|
@XmlAccessorType(XmlAccessType.NONE) |
|
41
|
|
|
public class GlobalPlan extends Plan { |
|
42
|
|
|
|
|
43
|
|
|
@XmlID |
|
44
|
|
|
@XmlAttribute |
|
45
|
|
|
private String id; |
|
46
|
|
|
|
|
47
|
|
|
public GlobalPlan(String id) { |
|
48
|
|
|
this.id = id; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Uses functionName and parameters to find the method to associate with |
|
53
|
|
|
* 'Function'. |
|
54
|
|
|
* |
|
55
|
|
|
* @param unmarshaller |
|
56
|
|
|
* @param parent |
|
57
|
|
|
* @throws ClassNotFoundException |
|
58
|
|
|
* @throws InstantiationException |
|
59
|
|
|
* @throws IllegalAccessException |
|
60
|
|
|
* @throws InvocationTargetException |
|
61
|
|
|
*/ |
|
62
|
|
|
@Override |
|
63
|
|
|
public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) |
|
64
|
|
|
throws ClassNotFoundException, |
|
65
|
|
|
InstantiationException, |
|
66
|
|
|
IllegalAccessException, |
|
67
|
|
|
InvocationTargetException { |
|
68
|
|
|
|
|
69
|
|
|
log.debug("Unmarshalling GlobalPlan with id {}", id); |
|
70
|
|
|
log.debug("Number of functions: {}", CollectionUtils.size(getFunctions())); |
|
71
|
|
|
// do nothing |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|