@Override public final ClassFileInfoException nameNotFoundInIndex(final String name) { final ClassFileInfoException result = new ClassFileInfoException(String.format(getLoggingLocale(), nameNotFoundInIndex$str(), name)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } @Override
/** * Loads a resource from the module class loader */ @Override public URL getResource(String name) { try { return module.getClassLoader().getResource(name); } catch (Exception e) { throw new ResourceLoadingException(e); } }
/** * <b>Deprecated</b> - use {@code getClassNestingType()} instead. * * Indicates whether this class is a top-level class or an inner class. * * @return true if this class is a top-level class, false otherwise */ default boolean isTopLevelClass() { return getNestingType().equals(NestingType.TOP_LEVEL); }
private static boolean isClassAvailable(String className, ResourceLoader resourceLoader) { try { resourceLoader.classForName(className); } catch (ResourceLoadingException e) { return false; } return true; }
@Override public boolean test(ClassFileInfo input) { return input.isAssignableTo(type); } }
/** * If the class name is found in additionalClasses then return it. * * Otherwise the class will be loaded from the module ClassLoader */ @Override public Class<?> classForName(String name) { try { if (classes.containsKey(name)) { return classes.get(name); } final Class<?> clazz = module.getClassLoader().loadClass(name); classes.put(name, clazz); return clazz; } catch (ClassNotFoundException | LinkageError e) { throw new ResourceLoadingException(e); } }
@Override public final ClassFileInfoException cannotLoadClass(final String name, final Throwable throwable) { final ClassFileInfoException result = new ClassFileInfoException(String.format(getLoggingLocale(), cannotLoadClass$str(), name), throwable); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } @Override
/** * <b>Deprecated</b> - use {@code getClassNestingType()} instead. * * Indicates whether this class is a top-level class or an inner class. * * @return true if this class is a top-level class, false otherwise */ default boolean isTopLevelClass() { return getNestingType().equals(NestingType.TOP_LEVEL); }
private static boolean isClassAvailable(String className, ResourceLoader resourceLoader) { try { resourceLoader.classForName(className); } catch (ResourceLoadingException e) { return false; } return true; }
@Override public boolean test(ClassFileInfo input) { return input.isAssignableTo(type); } }
/** * Loads resources from the module class loader */ @Override public Collection<URL> getResources(String name) { try { final HashSet<URL> resources = new HashSet<URL>(); Enumeration<URL> urls = module.getClassLoader().getResources(name); while (urls.hasMoreElements()) { resources.add(urls.nextElement()); } return resources; } catch (Exception e) { throw new ResourceLoadingException(e); } }
/** * <b>Deprecated</b> - use {@code getClassNestingType()} instead. * * Indicates whether this class is a top-level class or an inner class. * * @return true if this class is a top-level class, false otherwise */ default boolean isTopLevelClass() { return getNestingType().equals(NestingType.TOP_LEVEL); }
private static boolean isClassAvailable(String className, ResourceLoader resourceLoader) { try { resourceLoader.classForName(className); } catch (ResourceLoadingException e) { return false; } return true; }
@Override public boolean test(ClassFileInfo input) { return input.isAssignableTo(type); } }
/** * <b>Deprecated</b> - use {@code getClassNestingType()} instead. * * Indicates whether this class is a top-level class or an inner class. * * @return true if this class is a top-level class, false otherwise */ default boolean isTopLevelClass() { return getNestingType().equals(NestingType.TOP_LEVEL); }
private static boolean isClassAvailable(String className, ResourceLoader resourceLoader) { try { resourceLoader.classForName(className); } catch (ResourceLoadingException e) { return false; } return true; }
@Override public boolean test(ClassFileInfo input) { return input.isAssignableTo(type); } }
/** * <b>Deprecated</b> - use {@code getClassNestingType()} instead. * * Indicates whether this class is a top-level class or an inner class. * * @return true if this class is a top-level class, false otherwise */ default boolean isTopLevelClass() { return getNestingType().equals(NestingType.TOP_LEVEL); }
private static boolean isClassAvailable(String className, ResourceLoader resourceLoader) { try { resourceLoader.classForName(className); } catch (ResourceLoadingException e) { return false; } return true; }
/** * <b>Deprecated</b> - use {@code getClassNestingType()} instead. * * Indicates whether this class is a top-level class or an inner class. * * @return true if this class is a top-level class, false otherwise */ default boolean isTopLevelClass() { return getNestingType().equals(NestingType.TOP_LEVEL); }