Package com.oorian.schema
Class SchemaArticle
java.lang.Object
com.oorian.schema.SchemaType
com.oorian.schema.SchemaArticle
- All Implemented Interfaces:
Jsonable
Represents a Schema.org Article.
An Article represents a written work intended for a wide audience, such as a news article, blog post, or scholarly article. This schema type helps search engines display rich snippets with article information.
Usage:
SchemaArticle article = new SchemaArticle()
.setHeadline("Getting Started with Oorian")
.setDescription("Learn how to build your first Oorian application")
.setDatePublished("2025-01-10")
.setDateModified("2025-01-15")
.setAuthorName("Marvin Warble")
.setImage("https://oorian.com/blog/getting-started.jpg");
head.addElement(new JsonLdScript(article));
- Since:
- 2025
- Version:
- 1.0
- Author:
- Claude
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds an image URL for the article.setAuthorName(String authorName) Sets the name of the article author.setAuthorUrl(String authorUrl) Sets the URL of the article author's profile.setDateModified(String dateModified) Sets the date the article was last modified (ISO 8601 format).setDatePublished(String datePublished) Sets the date the article was first published (ISO 8601 format).setDescription(String description) Sets a description/summary of the article.setHeadline(String headline) Sets the headline/title of the article.Sets a single image for the article (convenience method).setMainEntityOfPage(String mainEntityOfPage) Sets the URL of the page that is the main subject of this article.setPublisher(SchemaOrganization publisher) Sets the publisher of the article.setWordCount(String wordCount) Sets the word count of the article.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
-
SchemaArticle
public SchemaArticle()
-
-
Method Details
-
setHeadline
Sets the headline/title of the article.- Parameters:
headline- The article headline- Returns:
- This article for method chaining
-
setDescription
Sets a description/summary of the article.- Parameters:
description- The article description- Returns:
- This article for method chaining
-
setDatePublished
Sets the date the article was first published (ISO 8601 format).- Parameters:
datePublished- The publication date (e.g., "2025-01-10")- Returns:
- This article for method chaining
-
setDateModified
Sets the date the article was last modified (ISO 8601 format).- Parameters:
dateModified- The modification date (e.g., "2025-01-15")- Returns:
- This article for method chaining
-
setAuthorName
Sets the name of the article author.- Parameters:
authorName- The author's name- Returns:
- This article for method chaining
-
setAuthorUrl
Sets the URL of the article author's profile.- Parameters:
authorUrl- The author's profile URL- Returns:
- This article for method chaining
-
setPublisher
Sets the publisher of the article.- Parameters:
publisher- The publishing organization- Returns:
- This article for method chaining
-
setMainEntityOfPage
Sets the URL of the page that is the main subject of this article.- Parameters:
mainEntityOfPage- The main entity URL (typically the article's URL)- Returns:
- This article for method chaining
-
setWordCount
Sets the word count of the article.- Parameters:
wordCount- The number of words- Returns:
- This article for method chaining
-
addImage
Adds an image URL for the article.- Parameters:
imageUrl- The image URL- Returns:
- This article for method chaining
-
setImage
Sets a single image for the article (convenience method).- Parameters:
imageUrl- The image URL- Returns:
- This article 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.
-