Package com.oorian.schema
Class SchemaWebSite
java.lang.Object
com.oorian.schema.SchemaType
com.oorian.schema.SchemaWebSite
- All Implemented Interfaces:
Jsonable
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetDescription(String description) Sets a description of the website.Sets the name of the website.setPublisher(SchemaOrganization publisher) Sets the publisher/owner of the website.setSearchAction(String searchUrlTemplate) Enables the sitelinks search box by setting the search action target URL.Sets the URL of the website.Serializes this object to aJsonValue.Methods inherited from class com.oorian.schema.SchemaType
createBaseJson, getType, initFromJsonMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oorian.json.Jsonable
initFromJson, initFromJson, toJsonString
-
Constructor Details
-
SchemaWebSite
public SchemaWebSite()
-
-
Method Details
-
setName
Sets the name of the website.- Parameters:
name- The website name- Returns:
- This website for method chaining
-
setUrl
Sets the URL of the website.- Parameters:
url- The website URL- Returns:
- This website for method chaining
-
setDescription
Sets a description of the website.- Parameters:
description- The website description- Returns:
- This website for method chaining
-
setPublisher
Sets the publisher/owner of the website.- Parameters:
publisher- The organization that owns the website- Returns:
- This website for method chaining
-
setSearchAction
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
Description copied from interface:JsonableSerializes this object to aJsonValue.- Specified by:
toJsonValuein interfaceJsonable- Specified by:
toJsonValuein classSchemaType- Returns:
- the JSON representation of this object.
-