MCPcopy Index your code
hub / github.com/apache/groovy / MetaClassImpl

Class MetaClassImpl

src/main/java/groovy/lang/MetaClassImpl.java:124–4313  ·  view source on GitHub ↗

Allows methods to be dynamically added to existing classes at runtime @see groovy.lang.MetaClass

Source from the content-addressed store, hash-verified

122 * @see groovy.lang.MetaClass
123 */
124public class MetaClassImpl implements MetaClass, MutableMetaClass {
125
126 /**
127 * Shared empty argument array used by MOP dispatch helpers.
128 */
129 public static final Object[] EMPTY_ARGUMENTS = MetaClassHelper.EMPTY_ARRAY;
130
131 /**
132 * Synthetic method name used for static {@code methodMissing} dispatch.
133 */
134 protected static final String STATIC_METHOD_MISSING = "$static_methodMissing";
135 /**
136 * Synthetic method name used for static {@code propertyMissing} dispatch.
137 */
138 protected static final String STATIC_PROPERTY_MISSING = "$static_propertyMissing";
139 /**
140 * Conventional Groovy instance {@code methodMissing} hook name.
141 */
142 protected static final String METHOD_MISSING = "methodMissing";
143 /**
144 * Conventional Groovy instance {@code propertyMissing} hook name.
145 */
146 protected static final String PROPERTY_MISSING = "propertyMissing";
147 /**
148 * Conventional Groovy instance {@code invokeMethod} hook name.
149 */
150 protected static final String INVOKE_METHOD_METHOD = "invokeMethod";
151
152 private static final String CALL_METHOD = "call";
153 private static final String DO_CALL_METHOD = "doCall";
154 private static final String CONSTRUCTOR_NAME = "<init>";
155 private static final String GET_PROPERTY_METHOD = "getProperty";
156 private static final String SET_PROPERTY_METHOD = "setProperty";
157
158 private static final Class<?>[] GETTER_MISSING_ARGS = {String.class};
159 private static final Class<?>[] SETTER_MISSING_ARGS = {String.class,Object.class};
160 private static final Class<?>[] METHOD_MISSING_ARGS = {String.class,Object.class};
161 private static final MetaMethod AMBIGUOUS_LISTENER_METHOD = new DummyMetaMethod();
162 private static final Comparator<CachedClass> CACHED_CLASS_NAME_COMPARATOR = Comparator.comparing(CachedClass::getName);
163 private static final boolean PERMISSIVE_PROPERTY_ACCESS = SystemUtil.getBooleanSafe("groovy.permissive.property.access");
164 private static final VMPlugin VM_PLUGIN = VMPluginFactory.getPlugin();
165
166 /**
167 * Java class represented by this meta class.
168 */
169 protected final Class theClass;
170 /**
171 * Cached reflection view for {@link #theClass}.
172 */
173 protected final CachedClass theCachedClass;
174 /**
175 * Indicates whether {@link #theClass} implements {@link GroovyObject}.
176 */
177 protected final boolean isGroovyObject;
178 /**
179 * Indicates whether {@link #theClass} is assignable from {@link Map}.
180 */
181 protected final boolean isMap;

Callers

nothing calls this directly

Calls 2

getBooleanSafeMethod · 0.95
getPluginMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…