Package com.oorian

Class PageInfo

java.lang.Object
com.oorian.PageInfo

public class PageInfo extends Object
Encapsulates metadata about a registered Oorian page.

PageInfo stores information collected from the Page annotation during application startup. It provides access to the page class, its annotation configuration, and any URL parameters defined in the page path.

Key Information Stored:

  • The page class itself for instantiation
  • The @Page annotation with path and configuration
  • URL parameter names extracted from RESTful path patterns

Usage:


 PageInfo info = Application.getPageInfo(MyPage.class);
 List<String> params = info.getUrlParams(); // e.g., ["id", "action"]
 
Since:
2023
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • PageInfo

      public PageInfo(Class pageClass, Page annotation, List<String> urlParams)
      Constructs a new PageInfo with the specified metadata.
      Parameters:
      pageClass - the page class
      annotation - the @Page annotation
      urlParams - the URL parameter names from the path pattern
  • Method Details

    • getPageClass

      public Class getPageClass()
      Returns the page class.
      Returns:
      the class of the page
    • getAnnotation

      public Page getAnnotation()
      Returns the @Page annotation for this page.

      The annotation contains configuration such as the URL path, title, and other page-specific settings.

      Returns:
      the Page annotation
    • getUrlParams

      public List<String> getUrlParams()
      Returns the list of URL parameter names.

      These are the parameter names extracted from RESTful path patterns such as /users/{id}/posts/{postId}. In this example, the list would contain ["id", "postId"].

      Returns:
      list of URL parameter names, or an empty list if none
    • isRequiresAuth

      public boolean isRequiresAuth()
      Returns whether this page requires authentication.

      A page requires authentication if it is annotated with RequiresAuth.

      Returns:
      true if authentication is required, false otherwise