Package org.apache.maven.doxia.site
Class ModelNamespace
java.lang.Object
org.apache.maven.doxia.site.ModelNamespace
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdeclaredVersion(String descriptorContent, String model) Returns the model version of the descriptor'sSITEorSKINnamespace, if it declares one.static booleanisNewerThan(String descriptorContent, String model, String supportedVersion) Returns whether the descriptor declares a namespace for a newer model thansupportedVersion.
-
Field Details
-
SITE_MODEL_VERSION
The newest site descriptor model this version reads, as inhttp://maven.apache.org/SITE/2.2.0.- See Also:
-
SKIN_MODEL_VERSION
The newest skin descriptor model this version reads, as inhttp://maven.apache.org/SKIN/2.1.0.- See Also:
-
-
Method Details
-
declaredVersion
Returns the model version of the descriptor'sSITEorSKINnamespace, if it declares one.- Parameters:
descriptorContent- the descriptor XMLmodel-"SITE"or"SKIN"- Returns:
- the version, for example
"2.1.0", ornullwithout such a namespace
-
isNewerThan
Returns whether the descriptor declares a namespace for a newer model thansupportedVersion.- Parameters:
descriptorContent- the descriptor XMLmodel-"SITE"or"SKIN"supportedVersion- the newest model version that can be read- Returns:
trueif the declared namespace version is newer than the supported one
-