/** * Register a class to be dynamically created using the provided * {@link DynamicClassWriter}. The registered writer is used when the * {@link #findClass(String)} method is called back on this loader from the * {@link #loadClass(String)} call. * <p> * If a duplicate request is made for the same className and the writers are * not compatible a {@link DynamicException} will be thrown. If the * duplicate request contains a compatible writer then the second request is * ignored as the class may already have been generated. * * @see #findClass(String) */ public void addClass(String className, EclipseLinkClassWriter writer) throws DynamicException { EclipseLinkClassWriter existingWriter = getClassWriter(className); // Verify that the existing writer is compatible with the requested if (existingWriter != null) { if (!existingWriter.isCompatible(writer)) { throw DynamicException.incompatibleDuplicateWriters(className, existingWriter, writer); } } else { getClassWriters().put(className, writer == null ? getDefaultWriter() : writer); } }
/** * Register a class to be dynamically created using the provided * {@link DynamicClassWriter}. The registered writer is used when the * {@link #findClass(String)} method is called back on this loader from the * {@link #loadClass(String)} call. * <p> * If a duplicate request is made for the same className and the writers are * not compatible a {@link DynamicException} will be thrown. If the * duplicate request contains a compatible writer then the second request is * ignored as the class may already have been generated. * * @see #findClass(String) */ public void addClass(String className, DynamicClassWriter writer) throws DynamicException { DynamicClassWriter existingWriter = getClassWriter(className); // Verify that the existing writer is compatible with the requested if (existingWriter != null) { if (!existingWriter.isCompatible(writer)) { throw DynamicException.incompatibleDuplicateWriters(className, existingWriter, writer); } } else { getClassWriters().put(className, writer == null ? getDefaultWriter() : writer); } }
/** * Register a class to be dynamically created using the provided * {@link DynamicClassWriter}. The registered writer is used when the * {@link #findClass(String)} method is called back on this loader from the * {@link #loadClass(String)} call. * <p> * If a duplicate request is made for the same className and the writers are * not compatible a {@link DynamicException} will be thrown. If the * duplicate request contains a compatible writer then the second request is * ignored as the class may already have been generated. * * @see #findClass(String) */ public void addClass(String className, EclipseLinkClassWriter writer) throws DynamicException { EclipseLinkClassWriter existingWriter = getClassWriter(className); // Verify that the existing writer is compatible with the requested if (existingWriter != null) { if (!existingWriter.isCompatible(writer)) { throw DynamicException.incompatibleDuplicateWriters(className, existingWriter, writer); } } else { getClassWriters().put(className, writer == null ? getDefaultWriter() : writer); } }