MCPcopy
hub / github.com/apache/groovy / DynamicVariable

Class DynamicVariable

src/main/java/org/codehaus/groovy/ast/DynamicVariable.java:25–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23// An implicitly created variable, such as a variable in a script that's doesn't have an explicit
24// declaration, or the "it" argument to a closure.
25public class DynamicVariable implements Variable {
26
27 private final String name;
28 private boolean closureShare = false;
29 private boolean staticContext = false;
30
31 public DynamicVariable(String name, boolean context) {
32 this.name = name;
33 staticContext = context;
34 }
35
36 @Override
37 public ClassNode getType() {
38 return ClassHelper.dynamicType();
39 }
40
41 @Override
42 public String getName() {
43 return name;
44 }
45
46 @Override
47 public Expression getInitialExpression() {
48 return null;
49 }
50
51 @Override
52 public boolean hasInitialExpression() {
53 return false;
54 }
55
56 @Override
57 public boolean isInStaticContext() {
58 return staticContext;
59 }
60
61 @Override
62 public boolean isDynamicTyped() {
63 return true;
64 }
65
66 @Override
67 public boolean isClosureSharedVariable() {
68 return closureShare;
69 }
70
71 @Override
72 public void setClosureSharedVariable(boolean inClosure) {
73 closureShare = inClosure;
74 }
75
76 @Override
77 public int getModifiers() {
78 return 0;
79 }
80
81 @Override
82 public ClassNode getOriginType() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…