Skip to content

Commit

Permalink
docs: add package-info.java and Javadoc comments for config and annot…
Browse files Browse the repository at this point in the history
…ation packages
  • Loading branch information
benny123tw committed Jun 20, 2024
1 parent dd801f9 commit 3cd3f2a
Show file tree
Hide file tree
Showing 11 changed files with 186 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.0.2
version=0.1.0-alpha
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@
import java.lang.annotation.Target;
import org.springframework.context.annotation.Import;

/**
* Annotation to enable Vite integration in a Spring MVC application.
*
* <p>When this annotation is applied to a {@code @Configuration} class, it imports the
* {@link ViteConfig} configuration, which sets up the necessary beans and configuration
* for using Vite in the application.</p>
*
* <p>Usage:</p>
* <pre class="code">
* &#64;Configuration
* &#64;EnableVite
* public class AppConfig {
* // Your other Spring configuration
* }
* </pre>
*
* <p>This annotation is typically applied at the top-level configuration class to ensure
* that Vite's configuration is loaded and available to the application context.</p>
*
* @see io.github.benny123tw.servlet.config.ViteConfig
*/
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This package contains annotations for enabling Vite integration in Spring MVC applications.
*
* <p>The primary annotation in this package is {@link EnableVite}, which when applied to a
* configuration class, imports the necessary configuration for Vite.</p>
*
* @see io.github.benny123tw.servlet.config.ViteConfig
*/
package io.github.benny123tw.servlet.annotation;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,29 @@
import org.springframework.beans.factory.annotation.Value;

/**
* Provides an out-of-the-box configuration for Vite.
* Provides an out-of-the-box configuration for integrating Vite with Spring MVC applications.
*
* <p>This configuration class automatically scans the package {@code io.github.benny123tw.servlet.config}
* for components and provides the necessary beans and properties to enable Vite integration.</p>
*
* <p>The following properties can be configured in the application's {@code application.properties} file:</p>
* <ul>
* <li>{@code vite.debug} - Enables or disables debug mode for Vite integration. Default is {@code true}.</li>
* <li>{@code vite.manifestPath} - Specifies the path to the Vite manifest file. Default is {@code /WEB-INF/dist/.vite/manifest.json}.</li>
* <li>{@code vite.localServerUrl} - Specifies the URL of the local Vite development server. Default is {@code http://localhost:5173}.</li>
* <li>{@code vite.resourcePath} - Specifies the path to Vite resources. Default is {@code /resources}.</li>
* </ul>
*
* <p>Usage example:</p>
* <pre class="code">
* &#64;Configuration
* &#64;EnableVite
* public class AppConfig {
* // Your other Spring configuration
* }
* </pre>
*
* @see io.github.benny123tw.servlet.annotation.EnableVite
*/
@Configuration
@ComponentScan(basePackages = "io.github.benny123tw.servlet.config")
Expand All @@ -24,6 +46,11 @@ public class ViteConfig {
@Value("${vite.resourcePath:/resources}")
private String resourcePath;

/**
* Creates a {@link ViteProperties} bean configured with the application's Vite settings.
*
* @return a configured {@link ViteProperties} instance
*/
@Bean
public ViteProperties viteProperties() {
ViteProperties viteProperties = new ViteProperties();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* This package contains the configuration classes for integrating Vite with Spring MVC applications.
*
* <p>Classes in this package provide configuration and beans necessary for setting up Vite in a Spring MVC
* application, including properties for the Vite manifest file, local development server URL, resource paths,
* and debug settings.</p>
*
* <p>Usage example:</p>
* <pre class="code">
* &#64;Configuration
* &#64;EnableVite
* public class AppConfig {
* // Your other Spring configuration
* }
* </pre>
*
* @see io.github.benny123tw.servlet.annotation.EnableVite
* @see io.github.benny123tw.servlet.config.ViteConfig
*/
package io.github.benny123tw.servlet.config;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Defines the XML configuration namespace for Spring MVC.
*/
@NonNullApi
@NonNullFields
package io.github.benny123tw.servlet;

import org.springframework.lang.NonNullApi;
import org.springframework.lang.NonNullFields;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* <p>This package contains Vite's JSP standard tag library for JSP 2.0+.
* Supports JSP view implementations within Spring's Web MVC framework.
* For more details on each tag, see the list of tags below with links to
* individual tag classes, or check the {@code vite.tld} file:
*
* <ul>
* <li>{@link io.github.benny123tw.servlet.tags.ViteImport The import tag}
* </ul>
*
* <p>Please note that the various tags generated by this form tag library are
* compliant with https://www.w3.org/TR/xhtml1/ and attendant
* https://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Strict.
*/
@NonNullApi
@NonNullFields
package io.github.benny123tw.servlet.tags;

import org.springframework.lang.NonNullApi;
import org.springframework.lang.NonNullFields;
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@
import java.lang.annotation.Target;
import org.springframework.context.annotation.Import;

/**
* Annotation to enable Vite integration in a Spring MVC application.
*
* <p>When this annotation is applied to a {@code @Configuration} class, it imports the
* {@link ViteConfig} configuration, which sets up the necessary beans and configuration
* for using Vite in the application.</p>
*
* <p>Usage:</p>
* <pre class="code">
* &#64;Configuration
* &#64;EnableVite
* public class AppConfig {
* // Your other Spring configuration
* }
* </pre>
*
* <p>This annotation is typically applied at the top-level configuration class to ensure
* that Vite's configuration is loaded and available to the application context.</p>
*
* @see io.github.benny123tw.servlet.config.ViteConfig
*/
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This package contains annotations for enabling Vite integration in Spring MVC applications.
*
* <p>The primary annotation in this package is {@link EnableVite}, which when applied to a
* configuration class, imports the necessary configuration for Vite.</p>
*
* @see io.github.benny123tw.servlet.config.ViteConfig
*/
package io.github.benny123tw.servlet.annotation;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,29 @@
import org.springframework.beans.factory.annotation.Value;

/**
* Provides an out-of-the-box configuration for Vite.
* Provides an out-of-the-box configuration for integrating Vite with Spring MVC applications.
*
* <p>This configuration class automatically scans the package {@code io.github.benny123tw.servlet.config}
* for components and provides the necessary beans and properties to enable Vite integration.</p>
*
* <p>The following properties can be configured in the application's {@code application.properties} file:</p>
* <ul>
* <li>{@code vite.debug} - Enables or disables debug mode for Vite integration. Default is {@code true}.</li>
* <li>{@code vite.manifestPath} - Specifies the path to the Vite manifest file. Default is {@code /WEB-INF/dist/.vite/manifest.json}.</li>
* <li>{@code vite.localServerUrl} - Specifies the URL of the local Vite development server. Default is {@code http://localhost:5173}.</li>
* <li>{@code vite.resourcePath} - Specifies the path to Vite resources. Default is {@code /resources}.</li>
* </ul>
*
* <p>Usage example:</p>
* <pre class="code">
* &#64;Configuration
* &#64;EnableVite
* public class AppConfig {
* // Your other Spring configuration
* }
* </pre>
*
* @see io.github.benny123tw.servlet.annotation.EnableVite
*/
@Configuration
@ComponentScan(basePackages = "io.github.benny123tw.servlet.config")
Expand All @@ -24,6 +46,11 @@ public class ViteConfig {
@Value("${vite.resourcePath:/resources}")
private String resourcePath;

/**
* Creates a {@link ViteProperties} bean configured with the application's Vite settings.
*
* @return a configured {@link ViteProperties} instance
*/
@Bean
public ViteProperties viteProperties() {
ViteProperties viteProperties = new ViteProperties();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* This package contains the configuration classes for integrating Vite with Spring MVC applications.
*
* <p>Classes in this package provide configuration and beans necessary for setting up Vite in a Spring MVC
* application, including properties for the Vite manifest file, local development server URL, resource paths,
* and debug settings.</p>
*
* <p>Usage example:</p>
* <pre class="code">
* &#64;Configuration
* &#64;EnableVite
* public class AppConfig {
* // Your other Spring configuration
* }
* </pre>
*
* @see io.github.benny123tw.servlet.annotation.EnableVite
* @see io.github.benny123tw.servlet.config.ViteConfig
*/
package io.github.benny123tw.servlet.config;

0 comments on commit 3cd3f2a

Please sign in to comment.