Class SchemaBreadcrumbList

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

public class SchemaBreadcrumbList extends SchemaType
Represents a Schema.org BreadcrumbList.

A BreadcrumbList represents a navigation trail showing the page's position in the site hierarchy. Search engines use this to display breadcrumb navigation in search results.

Usage:


 SchemaBreadcrumbList breadcrumbs = new SchemaBreadcrumbList()
     .addItem("Home", "https://oorian.com/")
     .addItem("Features", "https://oorian.com/features")
     .addItem("Flexible Communication", "https://oorian.com/features/flexible-communication");

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

    • SchemaBreadcrumbList

      public SchemaBreadcrumbList()
  • Method Details

    • addItem

      public SchemaBreadcrumbList addItem(String name, String url)
      Adds a breadcrumb item to the list.

      Items should be added in order from the home page to the current page. The position is automatically assigned based on the order of addition.

      Parameters:
      name - The display name of the breadcrumb
      url - The URL of the page
      Returns:
      This breadcrumb list 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.