Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WELD-2779 Address javadoc warning in Weld API #194

Merged
merged 3 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
<version>49</version>
</parent>

<prerequisites>
<maven>3.8</maven>
</prerequisites>

<name>Weld APIs Parent</name>

<modules>
Expand Down
10 changes: 0 additions & 10 deletions weld-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,4 @@


</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public interface Environment {
*/
Set<Class<? extends Service>> getRequiredDeploymentServices();

/**
* The bean deployment archive scoped services required for this environment
*
* @return the services to require
*/
Set<Class<? extends Service>> getRequiredBeanDeploymentArchiveServices();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public interface ServiceRegistry extends Iterable<Service> {
*/
void addAll(Collection<Entry<Class<? extends Service>, Service>> services);

/**
* Returns a set of all service entries
*
* @return all service entries as a set
*/
Set<Entry<Class<? extends Service>, Service>> entrySet();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public abstract class SingletonProvider {

private static final String DEFAULT_SCOPE_FACTORY = RegistrySingletonProvider.class.getName();

/**
* Returns a singleton instance of this class.
*
* @return {@link SingletonProvider} instance
*/
public static SingletonProvider instance() {
if (INSTANCE == null) {
synchronized (SingletonProvider.class) {
Expand All @@ -51,6 +56,10 @@ public static SingletonProvider instance() {
return INSTANCE;
}

/**
* Protected constructor.
* {@link SingletonProvider#instance()} should be used to obtain an instance of this class.
*/
protected SingletonProvider() {
}

Expand Down Expand Up @@ -90,6 +99,9 @@ public static void initialize(SingletonProvider instance) {
}
}

/**
* Sets the reference to the singleton instance of this class back to {@code null}.
*/
public static void reset() {
INSTANCE = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import org.jboss.weld.bootstrap.api.BootstrapService;

/**
* Defines {@link #cleanup()} implementation as a simple delegation to {@link #cleanupAfterBoot()}
*/
public abstract class AbstractBootstrapService implements BootstrapService {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
*/
public abstract class ForwardingBootstrap implements Bootstrap {

/**
* Returns the delegate
*
* @return delegate
*/
protected abstract Bootstrap delegate();

public WeldManager getManager(BeanDeploymentArchive beanDeploymentArchive) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,19 @@
import org.jboss.weld.bootstrap.api.Service;
import org.jboss.weld.bootstrap.api.ServiceRegistry;

/**
* An implementation of {@link ServiceRegistry} which forwards all its method calls to another {@link ServiceRegistry}
* Subclasses should override one or more methods to modify the behavior of the backing {@link ServiceRegistry} as
* desired per the <a href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>.
*
*/
public abstract class ForwardingServiceRegistry implements ServiceRegistry {

/**
* Returns the delegate
*
* @return delegate
*/
protected abstract ServiceRegistry delegate();

public <S extends Service> void add(Class<S> type, S service) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
* @author mathieuancelin
*/
public class RegistrySingletonProvider extends SingletonProvider {
/**
* Static instance constant
*/
public static final String STATIC_INSTANCE = "STATIC_INSTANCE";

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,21 @@
import org.jboss.weld.bootstrap.api.Service;
import org.jboss.weld.bootstrap.api.ServiceRegistry;

/**
* Utility class for {@link ServiceRegistry}
*/
public class ServiceRegistries {

private ServiceRegistries() {
}

/**
* Returns an unmodifiable version of provided {@link ServiceRegistry} where any attempt to add a service results in an
* exception
*
* @param serviceRegistry service registry to process
* @return unmodifiable variant
*/
public static ServiceRegistry unmodifiableServiceRegistry(final ServiceRegistry serviceRegistry) {
return new ForwardingServiceRegistry() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public class SimpleServiceRegistry implements ServiceRegistry {

private final Map<Class<? extends Service>, Service> services;

/**
* Initialize a new instance of {@link SimpleServiceRegistry}
*/
public SimpleServiceRegistry() {
this.services = new HashMap<Class<? extends Service>, Service>();
}
Expand All @@ -58,6 +61,11 @@ public Set<Entry<Class<? extends Service>, Service>> entrySet() {
return services.entrySet();
}

/**
* Returns a map containing all registered services
*
* @return map with all services
*/
protected Map<Class<? extends Service>, Service> get() {
return services;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
import java.net.URL;
import java.util.List;

/**
* Representation of parsed {@code beans.xml} file.
*/
public interface BeansXml {

/**
* Empty {@code beans.xml}
*/
BeansXml EMPTY_BEANS_XML = new BeansXml() {

public List<Metadata<String>> getEnabledInterceptors() {
Expand Down Expand Up @@ -48,19 +54,46 @@ public boolean isTrimmed() {
}
};

/**
* Returns list of enabled alternative stereotypes
*
* @return {@link List} of enabled alternatives stereotypes; can be empty but never {@code null}
*/
List<Metadata<String>> getEnabledAlternativeStereotypes();

/**
* Returns list of enabled alternative classes
*
* @return {@link List} of enabled alternative classes; can be empty but never {@code null}
*/
List<Metadata<String>> getEnabledAlternativeClasses();

/**
* Returns list of enabled decorators
*
* @return {@link List} of enabled decorators; can be empty but never {@code null}
*/
List<Metadata<String>> getEnabledDecorators();

/**
* Returns list of enabled interceptors
*
* @return {@link List} of enabled interceptors; can be empty but never {@code null}
*/
List<Metadata<String>> getEnabledInterceptors();

/**
* @return Initialized {@link Scanning} instance or {@code Scanning.EMPTY_SCANNING} if empty. Never null.
*/
Scanning getScanning();

/**
* Returns the {@link URL} of this {@code beans.xml}.
* Can be {@code null} in certain including but not limited to {@link #EMPTY_BEANS_XML} and synthetic bean archives in Weld
* SE
*
* @return {@link URL} of this {@code beans.xml}, or {@code null}
*/
URL getUrl();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
*/
package org.jboss.weld.bootstrap.spi;

/**
* Represents CDI 1.1 and newer deployment.
*
* @see Deployment javadoc
*/
public interface CDI11Deployment extends Deployment {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public interface ClassAvailableActivation {
*/
String getClassName();

/**
* Returns true if the filter is inverted (via {@code !}), false otherwise
*
* @return true if inverted, false otherwise
*/
boolean isInverted();

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,20 @@

/**
* In Java EE environment, each {@link BeanDeploymentArchive} should provide a description of the Java EE module it belongs to
* (WAR, RAR, etc.). This applies to
* physical bean archives deployed within the given module and also to logical bean archives that belong to the module. Bean
* archives that are not part of a
* Java EE module (e.g. built-in server libraries) are not required to have a {@link EEModuleDescriptor} service registered.
* (WAR, RAR, etc.). This applies to physical bean archives deployed within the given module and also to logical bean archives
* that belong to the module.
* Bean archives that are not part of a Java EE module (e.g. built-in server libraries) are not required to have a
* {@link EEModuleDescriptor} service registered.
*
* <p>
* {@link EEModuleDescriptor} is a per-BDA service.
* </p>
*
* <p>
* It is recommended to share an immutable {@link EEModuleDescriptor} instance for all bean deployment archives of the same Java
* EE module. However, each bean
* deployment archive may register its own {@link EEModuleDescriptor} instance. In this case, all descriptors representing a
* given EE module must use the same
* id and type.
* EE module.
* However, each bean deployment archive may register its own {@link EEModuleDescriptor} instance. In this case, all descriptors
* representing a given EE module must use the same id and type.
* </p>
*
* @author Jozef Hartinger
Expand All @@ -51,10 +50,25 @@ public interface EEModuleDescriptor extends Service {
*
*/
public enum ModuleType {
/**
* Enterprise archive libraries (ear/lib)
*/
EAR,
/**
* Web modules (wars)
*/
WEB,
/**
* EJB archive
*/
EJB_JAR,
/**
* Application client modules
*/
APPLICATION_CLIENT,
/**
* Connector modules (rar)
*/
CONNECTOR
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
*/
public interface Scanning {

/**
* A {@link Scanning} instance with no include or exclude filters
*/
Scanning EMPTY_SCANNING = new Scanning() {

public Collection<Metadata<Filter>> getIncludes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,20 @@

import org.jboss.weld.bootstrap.spi.EEModuleDescriptor;

/**
* A convenience impl class for {@link EEModuleDescriptor}
*/
public class EEModuleDescriptorImpl implements EEModuleDescriptor {

private final String id;
private final EEModuleDescriptor.ModuleType moduleType;

/**
* Creates new instance of this class
*
* @param id identifier
* @param moduleType type of the module (EAR, WAR, ...)
*/
public EEModuleDescriptorImpl(String id, EEModuleDescriptor.ModuleType moduleType) {
this.id = id;
this.moduleType = moduleType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
*/
public abstract class ForwardingBeanDeploymentArchive implements BeanDeploymentArchive {

/**
* Returns the delegate
*
* @return delegate
*/
protected abstract BeanDeploymentArchive delegate();

public Collection<String> getBeanClasses() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,30 @@

import org.jboss.weld.bootstrap.spi.Metadata;

/**
* Basic implementation of {@link Metadata}
*
* @param <T> the type of metadata
*/
public class MetadataImpl<T> implements Metadata<T> {

/**
* Constant used to declare that the metadata location is not available
*/
public static final String LOCATION_NOT_AVAILABLE = "n/a";

private final String location;

private final T value;

/**
* Constructs {@link Metadata} from given value.
* Metadata location is set to {@link #LOCATION_NOT_AVAILABLE}
*
* @param value metadata value
* @return instance of metadata
* @param <T> metadata type
*/
public static <T> MetadataImpl<T> from(T value) {
return new MetadataImpl<T>(value);
}
Expand Down
Loading