Class Generator

java.lang.Object
org.apache.juneau.bean.atom.Common
org.apache.juneau.bean.atom.Generator

@Bean(typeName="generator") public class Generator extends Common
Identifies the software agent used to generate an Atom feed.

The generator element provides information about the software that created the feed. This is useful for debugging, analytics, and understanding the tools used in feed creation.

The generator has three components:

  • Text content (required) - Human-readable name of the generating agent
  • uri attribute (optional) - URI identifying or describing the generating agent
  • version attribute (optional) - Version of the generating agent
Schema

atomGenerator = element atom:generator { atomCommonAttributes, attribute uri { atomUri }?, attribute version { text }?, text }

Example:

Generator gen = new Generator("My Blog Software") .setUri("http://www.myblogsoftware.com") .setVersion("2.0"); Feed feed = new Feed(...) .setGenerator(gen);

Specification:

Represents an atomGenerator construct in the RFC 4287 - Section 4.2.4 specification.

See Also:
  • Constructor Details

    • Generator

      public Generator(String text)
      Normal constructor.
      Parameters:
      text - The generator statement content.
    • Generator

      public Generator()
      Bean constructor.
  • Method Details

    • getUri

      @Xml(format=ATTR) public URI getUri()
      Bean property getter: uri.

      The URI of this generator statement.

      Returns:
      The property value, or null if it is not set.
    • setUri

      public Generator setUri(Object value)
      Bean property setter: uri.

      The URI of this generator statement.

      The value can be of any of the following types: URI, URL, String. Strings must be valid URIs.

      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • getVersion

      Bean property getter: version.

      The version of this generator statement.

      Returns:
      The property value, or null if it is not set.
    • setVersion

      public Generator setVersion(String value)
      Bean property setter: version.

      The version of this generator statement.

      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • getText

      Bean property getter: text.

      The content of this generator statement.

      Returns:
      The property value, or null if it is not set.
    • setText

      public Generator setText(String value)
      Bean property setter: text.

      The content of this generator statement.

      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • setBase

      public Generator setBase(Object value)
      Description copied from class: Common
      Bean property setter: base.

      Sets the base URI for resolving relative URI references (xml:base attribute).

      The value can be of any of the following types: URI, URL, String. Strings must be valid URIs.

      Example:

      Feed feed = new Feed(...) .setBase("http://example.org/");

      Overrides:
      setBase in class Common
      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object.
    • setLang

      public Generator setLang(String value)
      Description copied from class: Common
      Bean property setter: lang.

      Sets the natural language of the element's content (xml:lang attribute).

      Example:

      Text title = new Text("text") .setText("Mon Blog") .setLang("fr");

      Overrides:
      setLang in class Common
      Parameters:
      value - The new value for this property (e.g., "en", "fr", "de", "en-US").
      Can be null to unset the property.
      Returns:
      This object.