Class SchemaWebSite

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

public class SchemaWebSite extends SchemaType
Represents a Schema.org WebSite.

A WebSite is a set of related web pages served from a single web domain. This schema type helps search engines understand your site structure and can enable site search boxes in search results.

Usage:


 SchemaWebSite website = new SchemaWebSite()
     .setName("Oorian")
     .setUrl("https://oorian.com")
     .setDescription("The Java web framework for real-time applications");

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

    • SchemaWebSite

      public SchemaWebSite()
  • Method Details

    • setName

      public SchemaWebSite setName(String name)
      Sets the name of the website.
      Parameters:
      name - The website name
      Returns:
      This website for method chaining
    • setUrl

      public SchemaWebSite setUrl(String url)
      Sets the URL of the website.
      Parameters:
      url - The website URL
      Returns:
      This website for method chaining
    • setDescription

      public SchemaWebSite setDescription(String description)
      Sets a description of the website.
      Parameters:
      description - The website description
      Returns:
      This website for method chaining
    • setPublisher

      public SchemaWebSite setPublisher(SchemaOrganization publisher)
      Sets the publisher/owner of the website.
      Parameters:
      publisher - The organization that owns the website
      Returns:
      This website for method chaining
    • setSearchAction

      public SchemaWebSite setSearchAction(String searchUrlTemplate)
      Enables the sitelinks search box by setting the search action target URL.

      The target should include {search_term_string} as a placeholder for the query. For example: "https://oorian.com/search?q={search_term_string}"

      Parameters:
      searchUrlTemplate - The search URL template with {search_term_string} placeholder
      Returns:
      This website 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.