Package com.oorian
Class PageInfo
java.lang.Object
com.oorian.PageInfo
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the @Page annotation for this page.Returns the page class.Returns the list of URL parameter names.booleanReturns whether this page requires authentication.
-
Constructor Details
-
PageInfo
Constructs a new PageInfo with the specified metadata.- Parameters:
pageClass- the page classannotation- the @Page annotationurlParams- the URL parameter names from the path pattern
-
-
Method Details
-
getPageClass
Returns the page class.- Returns:
- the class of the 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
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:
trueif authentication is required,falseotherwise
-