/** * {@inheritDoc} */ public String rebase(TypeDescription typeDescription) { return typeDescription.getName(); } }
/** {@inheritDoc} */ public String resolve(TypeDescription instrumentedType) { return instrumentedType.getName(); } },
/** * {@inheritDoc} */ public String getName() { return delegate.getName(); }
/** * {@inheritDoc} */ public String getName() { return typeDescription.getName(); }
/** * {@inheritDoc} */ public String resolve(TypeDescription typeDescription) { return this.typeDescription.getName(); } }
/** * Loads the class that is represented by this Java type. * * @return A loaded type of this Java type. * @throws ClassNotFoundException If the represented type cannot be loaded. */ public Class<?> load() throws ClassNotFoundException { return Class.forName(typeDescription.getName()); } }
/** * {@inheritDoc} */ public void onIgnored(TypeDescription typeDescription, ClassLoader classLoader, JavaModule module, boolean loaded) { printStream.printf(PREFIX + " IGNORE %s [%s, %s, loaded=%b]%n", typeDescription.getName(), classLoader, module, loaded); }
@Override protected String name(TypeDescription superClass) { return prefix + "." + superClass.getName() + "$" + randomString.nextString(); } }
/** * {@inheritDoc} */ public String name(TypeDescription instrumentedType) { return instrumentedType.getName() + "$" + suffix + "$" + randomString.nextString(); } }
/** * {@inheritDoc} */ @SuppressWarnings("unchecked") public AnnotationValue.Loaded<V[]> load(ClassLoader classLoader) throws ClassNotFoundException { List<AnnotationValue.Loaded<?>> values = new ArrayList<AnnotationValue.Loaded<?>>(this.values.size()); for (AnnotationValue<?, ?> value : this.values) { values.add(value.load(classLoader)); } return new Loaded<V>((Class<V>) Class.forName(componentType.getName(), false, classLoader), values); }
/** * {@inheritDoc} */ public String apply(TypeDescription instrumentedType, MethodDescription instrumentedMethod) { return instrumentedMethod.getReturnType().asErasure().getName(); } }
/** * {@inheritDoc} */ public void onTransformation(TypeDescription typeDescription, ClassLoader classLoader, JavaModule module, boolean loaded, DynamicType dynamicType) { if (matcher.matches(typeDescription.getName())) { delegate.onTransformation(typeDescription, classLoader, module, loaded, dynamicType); } }
@Override public String toString() { StringBuilder stringBuilder = new StringBuilder(Modifier.toString(getModifiers())); if (getModifiers() != EMPTY_MASK) { stringBuilder.append(' '); } stringBuilder.append(isVarArgs() ? getType().asErasure().getName().replaceFirst("\\[\\]$", "...") : getType().asErasure().getName()); return stringBuilder.append(' ').append(getName()).toString(); } }
/** * {@inheritDoc} */ public AnnotationValue.Loaded<U> load(ClassLoader classLoader) throws ClassNotFoundException { @SuppressWarnings("unchecked") Class<U> enumerationType = (Class<U>) Class.forName(enumerationDescription.getEnumerationType().getName(), false, classLoader); return new Loaded<U>(enumerationDescription.load(enumerationType)); }
/** * {@inheritDoc} */ protected ClassVisitor writeTo(ClassVisitor classVisitor, TypeInitializer typeInitializer, ContextRegistry contextRegistry, int writerFlags, int readerFlags) { classVisitor = new RedefinitionClassVisitor(classVisitor, typeInitializer, contextRegistry, writerFlags, readerFlags); return originalType.getName().equals(instrumentedType.getName()) ? classVisitor : new OpenedClassRemapper(classVisitor, new SimpleRemapper(originalType.getInternalName(), instrumentedType.getInternalName())); }
/** * {@inheritDoc} */ public AnnotationValue.Loaded<U> load(ClassLoader classLoader) throws ClassNotFoundException { @SuppressWarnings("unchecked") Class<U> annotationType = (Class<U>) Class.forName(annotationDescription.getAnnotationType().getName(), false, classLoader); return new Loaded<U>(annotationDescription.prepare(annotationType).load()); }
@Override public boolean equals(Object other) { if (this == other) { return true; } else if (!(other instanceof TypeDefinition)) { return false; } TypeDefinition typeDefinition = (TypeDefinition) other; return typeDefinition.getSort().isNonGeneric() && getName().equals(typeDefinition.asErasure().getName()); }
/** * {@inheritDoc} */ public String getName() { return isMethod() ? getInternalName() : getDeclaringType().asErasure().getName(); }
/** * {@inheritDoc} */ public void register(DynamicType dynamicType, ClassLoader classLoader, InitializationStrategy.Dispatcher.InjectorFactory injectorFactory) { Map<TypeDescription, byte[]> auxiliaryTypes = dynamicType.getAuxiliaryTypes(); LoadedTypeInitializer loadedTypeInitializer = auxiliaryTypes.isEmpty() ? dynamicType.getLoadedTypeInitializers().get(dynamicType.getTypeDescription()) : new Dispatcher.InjectingInitializer(dynamicType.getTypeDescription(), auxiliaryTypes, dynamicType.getLoadedTypeInitializers(), injectorFactory.resolve()); nexusAccessor.register(dynamicType.getTypeDescription().getName(), classLoader, identification, loadedTypeInitializer); } }
/** * {@inheritDoc} */ @CachedReturnPlugin.Enhance("erasure") public TypeDescription asErasure() { try { return ForLoadedType.of(classLoadingDelegate.load(delegate.asErasure().getName(), classLoader)); } catch (ClassNotFoundException ignored) { return delegate.asErasure(); } }