XWiki Classes

Last modified by Eleni Cojocariu on 2026/03/19 08:10

Explanation

An XWiki Class is like a template that defines a unique type of XWiki Object. It specifies what XWiki Properties (Data Types) an Object can have, and ensures that all Objects created from this Class follow the same structure. When you define a custom Class, you are preparing your application to create one or many Objects (instances) of that Class.

An analogy is the cookie cutter:

  • The Class is the cookie cutter: it defines the shape and rules.
  • The Objects are the cookies: each one is an individual instance created from the cutter. (And in this case, we’re talking about real, edible cookies, not Web cookies).

Each Class is attached to a Page:

  • There can be at most one Class per Page.
  • The Class name is the same as the name of the Page it is attached to.

In short, a Class in XWiki acts like a schema: it doesn’t hold data itself, but it defines the structure and Properties that all its Objects will share.

Related

Get Connected