@Test public void testGetClasses() throws Exception { final ResourceConfig rc = new ResourceConfig() .packages(false, PublicRootResourceClass.class.getPackage().getName()); Set<Class<?>> classes = rc.getClasses(); assertThat(classes.size(), is(1)); assertThat(classes, hasItem(PublicRootResourceClass.class)); rc.register(InnerStaticClass.PublicClass.class); classes = rc.getClasses(); assertThat(classes.size(), is(2)); assertThat(classes, hasItem(PublicRootResourceClass.class)); assertThat(classes, hasItem(InnerStaticClass.PublicClass.class)); }
@Override public final Set<Class<?>> getClasses() { if (cachedClassesView == null) { cachedClasses = _getClasses(); cachedClassesView = Collections.unmodifiableSet(cachedClasses); } return cachedClassesView; }
ResourceConfig extends Application implements Configurable<ResourceConfig>, ServerConfig { @Override public final Set<Class<?>> getClasses() { if (cachedClassesView == null) { cachedClasses = _getClasses(); cachedClassesView = Collections.unmodifiableSet(cachedClasses); } return cachedClassesView; } }
ResourceConfig extends Application implements Configurable<ResourceConfig>, ServerConfig { @Override public final Set<Class<?>> getClasses() { if (cachedClassesView == null) { cachedClasses = _getClasses(); cachedClassesView = Collections.unmodifiableSet(cachedClasses); } return cachedClassesView; } ResourceConfig();  ResourceConfig(final Set<Class<?>> classes);  ResourceConfig(final Class<?>... classes);  ResourceConfig(final ResourceConfig original); }
ResourceConfig extends Application implements Configurable<ResourceConfig>, ServerConfig { @Override public final Set<Class<?>> getClasses() { if (cachedClassesView == null) { cachedClasses = _getClasses(); cachedClassesView = Collections.unmodifiableSet(cachedClasses); } return cachedClassesView; } ResourceConfig();  ResourceConfig(final Set<Class<?>> classes);  ResourceConfig(final Class<?>... classes);  ResourceConfig(final ResourceConfig original); static ResourceConfig forApplication(final Application application); static ResourceConfig forApplicationClass(final Class<? extends Application> applicationClass); static ResourceConfig forApplicationClass(final Class<? extends Application> applicationClass,
                                                     final Set<Class<?>> defaultClasses); final ResourceConfig addProperties(final Map<String, Object> properties); ResourceConfig setProperties(final Map<String, ?> properties); @Override ResourceConfig property(final String name, final Object value); @Override ResourceConfig register(final Class<?> componentClass); @Override ResourceConfig register(final Class<?> componentClass, final int bindingPriority); @Override ResourceConfig register(final Class<?> componentClass, final Class<?>... contracts); @Override ResourceConfig register(final Class<?> componentClass, final Map<Class<?>, Integer> contracts); @Override ResourceConfig register(final Object component); @Override ResourceConfig register(final Object component, final int bindingPriority); @Override ResourceConfig register(final Object component, final Class<?>... contracts); @Override ResourceConfig register(final Object component, final Map<Class<?>, Integer> contracts); final ResourceConfig registerClasses(final Set<Class<?>> classes); final ResourceConfig registerClasses(final Class<?>... classes); final ResourceConfig registerInstances(final Set<Object> instances); final ResourceConfig registerInstances(final Object... instances); final ResourceConfig registerResources(final Resource... resources); final ResourceConfig registerResources(final Set<Resource> resources); final ResourceConfig registerFinder(final ResourceFinder resourceFinder); final ResourceConfig setApplicationName(final String applicationName); final ResourceConfig setClassLoader(final ClassLoader classLoader); final ResourceConfig packages(final String... packages); final ResourceConfig packages(final boolean recursive, final String... packages); final ResourceConfig files(final String... files); final ResourceConfig files(final boolean recursive, final String... files); @Override final ServerConfig getConfiguration(); @Override final Map<String, Object> getProperties(); @Override final Object getProperty(final String name); @Override Collection<String> getPropertyNames(); @Override final boolean isProperty(final String name); @Override final Set<Class<?>> getClasses(); @Override final Set<Object> getInstances(); @Override final Set<Object> getSingletons(); @Override RuntimeType getRuntimeType(); @Override boolean isEnabled(final Feature feature); @Override boolean isEnabled(final Class<? extends Feature> featureClass); @Override boolean isRegistered(final Object component); @Override boolean isRegistered(final Class<?> componentClass); @Override Map<Class<?>, Integer> getContracts(final Class<?> componentClass); @Override final Set<Resource> getResources(); final ClassLoader getClassLoader(); final Application getApplication(); String getApplicationName(); }
ResourceConfig extends Application implements Configurable<ResourceConfig>, ServerConfig { @Override public final Set<Class<?>> getClasses() { if (cachedClassesView == null) { cachedClasses = _getClasses(); cachedClassesView = Collections.unmodifiableSet(cachedClasses); } return cachedClassesView; } ResourceConfig();  ResourceConfig(final Set<Class<?>> classes);  ResourceConfig(final Class<?>... classes);  ResourceConfig(final ResourceConfig original); static ResourceConfig forApplication(final Application application); static ResourceConfig forApplicationClass(final Class<? extends Application> applicationClass); static ResourceConfig forApplicationClass(final Class<? extends Application> applicationClass,
                                                     final Set<Class<?>> defaultClasses); final ResourceConfig addProperties(final Map<String, Object> properties); ResourceConfig setProperties(final Map<String, ?> properties); @Override ResourceConfig property(final String name, final Object value); @Override ResourceConfig register(final Class<?> componentClass); @Override ResourceConfig register(final Class<?> componentClass, final int bindingPriority); @Override ResourceConfig register(final Class<?> componentClass, final Class<?>... contracts); @Override ResourceConfig register(final Class<?> componentClass, final Map<Class<?>, Integer> contracts); @Override ResourceConfig register(final Object component); @Override ResourceConfig register(final Object component, final int bindingPriority); @Override ResourceConfig register(final Object component, final Class<?>... contracts); @Override ResourceConfig register(final Object component, final Map<Class<?>, Integer> contracts); final ResourceConfig registerClasses(final Set<Class<?>> classes); final ResourceConfig registerClasses(final Class<?>... classes); final ResourceConfig registerInstances(final Set<Object> instances); final ResourceConfig registerInstances(final Object... instances); final ResourceConfig registerResources(final Resource... resources); final ResourceConfig registerResources(final Set<Resource> resources); final ResourceConfig registerFinder(final ResourceFinder resourceFinder); final ResourceConfig setApplicationName(final String applicationName); final ResourceConfig setClassLoader(final ClassLoader classLoader); final ResourceConfig packages(final String... packages); final ResourceConfig packages(final boolean recursive, final String... packages); final ResourceConfig files(final String... files); final ResourceConfig files(final boolean recursive, final String... files); @Override final ServerConfig getConfiguration(); @Override final Map<String, Object> getProperties(); @Override final Object getProperty(final String name); @Override Collection<String> getPropertyNames(); @Override final boolean isProperty(final String name); @Override final Set<Class<?>> getClasses(); @Override final Set<Object> getInstances(); @Override final Set<Object> getSingletons(); @Override RuntimeType getRuntimeType(); @Override boolean isEnabled(final Feature feature); @Override boolean isEnabled(final Class<? extends Feature> featureClass); @Override boolean isRegistered(final Object component); @Override boolean isRegistered(final Class<?> componentClass); @Override Map<Class<?>, Integer> getContracts(final Class<?> componentClass); @Override final Set<Resource> getResources(); final ClassLoader getClassLoader(); final Application getApplication(); String getApplicationName();  }