Class SchemaWebPage

java.lang.Object
com.oorian.schema.SchemaType
com.oorian.schema.SchemaWebPage
All Implemented Interfaces:
Jsonable

public class SchemaWebPage extends SchemaType
Represents a Schema.org WebPage.

A WebPage is a distinct page within a website. This schema type provides metadata about the page itself, including when it was last modified, its primary topic, and breadcrumb navigation.

Usage:


 SchemaWebPage page = new SchemaWebPage()
     .setName("Features")
     .setDescription("Explore Oorian's features")
     .setUrl("https://oorian.com/features")
     .setDateModified("2025-01-15");

 head.addElement(new JsonLdScript(page));
 
Since:
2025
Version:
1.0
Author:
Claude
  • Constructor Details

    • SchemaWebPage

      public SchemaWebPage()
  • Method Details

    • setName

      public SchemaWebPage setName(String name)
      Sets the name/title of the web page.
      Parameters:
      name - The page name
      Returns:
      This page for method chaining
    • setDescription

      public SchemaWebPage setDescription(String description)
      Sets a description of the web page.
      Parameters:
      description - The page description
      Returns:
      This page for method chaining
    • setUrl

      public SchemaWebPage setUrl(String url)
      Sets the URL of the web page.
      Parameters:
      url - The page URL
      Returns:
      This page for method chaining
    • setDatePublished

      public SchemaWebPage setDatePublished(String datePublished)
      Sets the date the page was first published (ISO 8601 format).
      Parameters:
      datePublished - The publication date (e.g., "2025-01-01")
      Returns:
      This page for method chaining
    • setDateModified

      public SchemaWebPage setDateModified(String dateModified)
      Sets the date the page was last modified (ISO 8601 format).
      Parameters:
      dateModified - The modification date (e.g., "2025-01-15")
      Returns:
      This page for method chaining
    • setBreadcrumb

      public SchemaWebPage setBreadcrumb(SchemaBreadcrumbList breadcrumb)
      Sets the breadcrumb navigation for the page.
      Parameters:
      breadcrumb - The breadcrumb list
      Returns:
      This page for method chaining
    • setPublisher

      public SchemaWebPage setPublisher(SchemaOrganization publisher)
      Sets the publisher of the page.
      Parameters:
      publisher - The organization that published the page
      Returns:
      This page for method chaining
    • setInLanguage

      public SchemaWebPage setInLanguage(String inLanguage)
      Sets the language of the page (BCP 47 format).
      Parameters:
      inLanguage - The language code (e.g., "en", "en-US")
      Returns:
      This page for method chaining
    • toJsonValue

      public JsonValue toJsonValue()
      Description copied from interface: Jsonable
      Serializes this object to a JsonValue.
      Specified by:
      toJsonValue in interface Jsonable
      Specified by:
      toJsonValue in class SchemaType
      Returns:
      the JSON representation of this object.