Allows methods to be dynamically added to existing classes at runtime @see groovy.lang.MetaClass
| 122 | * @see groovy.lang.MetaClass |
| 123 | */ |
| 124 | public 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; |
nothing calls this directly
no test coverage detected
searching dependent graphs…