public class Rating extends ExtensionPoint
| Modifier and Type | Class and Description |
|---|---|
static class |
Rating.Rel
Rating type.
|
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandlerAbstractExtension.AttributesHandler| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Float |
average
Average ratings, output with a fixed a 2 digit precision.
|
protected java.lang.Integer |
max
Maximum rating value on rating scale (optional).
|
protected java.lang.Integer |
min
Minimum rating value on rating scale (optional).
|
protected java.lang.Integer |
numRaters
Number of ratings that was taken into account (for average ratings).
|
protected java.lang.Integer |
rating
Rating value (required).
|
protected java.lang.String |
rel
Rating type.
|
xmlBloblocalName, namespace| Constructor and Description |
|---|
Rating()
Constructs an empty
Rating. |
Rating(java.lang.Integer rating)
Constructs a
Rating class with a specified rating. |
| Modifier and Type | Method and Description |
|---|---|
void |
generate(XmlWriter w,
ExtensionProfile extProfile)
Generates an XML representation for the extension.
|
java.lang.Float |
getAverage() |
static ExtensionDescription |
getDefaultDescription()
Returns the suggested extension description and is repeatable.
|
static ExtensionDescription |
getDefaultDescription(boolean repeatable)
Returns the suggested extension description with configurable
repeatability.
|
XmlParser.ElementHandler |
getHandler(ExtensionProfile extProfile,
java.lang.String namespace,
java.lang.String localName,
org.xml.sax.Attributes attrs)
The default implementation uses the
AbstractExtension.AttributesHandler to handle
parsing the extension. |
java.lang.Integer |
getMax() |
java.lang.Integer |
getMin() |
java.lang.Integer |
getNumRaters() |
java.lang.String |
getRel() |
java.lang.Integer |
getValue() |
void |
setAverage(java.lang.Float r) |
void |
setMax(java.lang.Integer r) |
void |
setMin(java.lang.Integer r) |
void |
setNumRaters(java.lang.Integer r) |
void |
setRel(java.lang.String v) |
void |
setValue(java.lang.Integer r) |
addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, createExtensionInstance, declareExtensions, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionDescription, getExtensionHandler, getExtensions, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild, visitChildrenconsumeAttributes, disableStrictValidation, enableStrictValidation, eq, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, putAttributes, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable, validateprotected java.lang.String rel
protected java.lang.Integer rating
protected java.lang.Integer min
protected java.lang.Integer max
protected java.lang.Integer numRaters
protected java.lang.Float average
public Rating()
Rating.public Rating(java.lang.Integer rating)
Rating class with a specified rating.rating - the value of the ratingpublic java.lang.String getRel()
public void setRel(java.lang.String v)
public java.lang.Integer getValue()
public void setValue(java.lang.Integer r)
public java.lang.Integer getMin()
public void setMin(java.lang.Integer r)
public java.lang.Integer getMax()
public void setMax(java.lang.Integer r)
public java.lang.Integer getNumRaters()
public void setNumRaters(java.lang.Integer r)
public java.lang.Float getAverage()
public void setAverage(java.lang.Float r)
public static ExtensionDescription getDefaultDescription(boolean repeatable)
public static ExtensionDescription getDefaultDescription()
public void generate(XmlWriter w, ExtensionProfile extProfile) throws java.io.IOException
Extensiongenerate in interface Extensiongenerate in class AbstractExtensionw - XML writerextProfile - extension profilejava.io.IOExceptionpublic XmlParser.ElementHandler getHandler(ExtensionProfile extProfile, java.lang.String namespace, java.lang.String localName, org.xml.sax.Attributes attrs)
AbstractExtensionAbstractExtension.AttributesHandler to handle
parsing the extension.getHandler in interface ExtensiongetHandler in class ExtensionPointextProfile - extension profilenamespace - extension namespacelocalName - tag name, without the namespace prefixattrs - tag attributes