Class ModelNamespace

java.lang.Object
org.apache.maven.doxia.site.ModelNamespace

public final class ModelNamespace extends Object
Checks the namespace version of a site or skin descriptor against the model version this Doxia Sitetools reads. The generated readers do not check it, so a descriptor written for a newer model fails with errors about unknown elements instead of saying that the model is too new.
Since:
2.2.0
  • Field Details

    • SITE_MODEL_VERSION

      public static final String SITE_MODEL_VERSION
      The newest site descriptor model this version reads, as in http://maven.apache.org/SITE/2.2.0.
      See Also:
    • SKIN_MODEL_VERSION

      public static final String SKIN_MODEL_VERSION
      The newest skin descriptor model this version reads, as in http://maven.apache.org/SKIN/2.1.0.
      See Also:
  • Method Details

    • declaredVersion

      public static String declaredVersion(String descriptorContent, String model)
      Returns the model version of the descriptor's SITE or SKIN namespace, if it declares one.
      Parameters:
      descriptorContent - the descriptor XML
      model - "SITE" or "SKIN"
      Returns:
      the version, for example "2.1.0", or null without such a namespace
    • isNewerThan

      public static boolean isNewerThan(String descriptorContent, String model, String supportedVersion)
      Returns whether the descriptor declares a namespace for a newer model than supportedVersion.
      Parameters:
      descriptorContent - the descriptor XML
      model - "SITE" or "SKIN"
      supportedVersion - the newest model version that can be read
      Returns:
      true if the declared namespace version is newer than the supported one