public class StatusInfoHtmlConverter extends ConverterHelper
StatusInfo
class.Constructor and Description |
---|
StatusInfoHtmlConverter() |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Class<?>> |
getObjectClasses(Variant source)
Returns the list of object classes that can be converted from a given
variant.
|
protected java.lang.String |
getStatusLabel(StatusInfo status)
Returns the status information to display in the default representation.
|
java.util.List<VariantInfo> |
getVariants(java.lang.Class<?> source)
Returns the list of variants that can be converted from a given object
class.
|
protected boolean |
isCompatible(Variant variant)
Indicates if the given variant is compatible with the media types
supported by this converter.
|
float |
score(java.lang.Object source,
Variant target,
Resource resource)
Scores the affinity of this helper with the source class.
|
<T> float |
score(Representation source,
java.lang.Class<T> target,
Resource resource)
Scores the affinity of this helper with the source class.
|
protected Representation |
toHtml(StatusInfo status)
Returns a representation for the given status.
|
<T> T |
toObject(Representation source,
java.lang.Class<T> target,
Resource resource)
Converts a Representation into a regular Java object.
|
Representation |
toRepresentation(java.lang.Object source,
Variant target,
Resource resource)
Converts a regular Java object into a Representation.
|
addObjectClass, addVariant, addVariants, getVariants, updatePreferences, updatePreferences
public java.util.List<java.lang.Class<?>> getObjectClasses(Variant source)
ConverterHelper
getObjectClasses
in class ConverterHelper
source
- The source variant.protected java.lang.String getStatusLabel(StatusInfo status)
status
- The status.StatusService.toRepresentation(Status, Request, Response)
public java.util.List<VariantInfo> getVariants(java.lang.Class<?> source) throws java.io.IOException
ConverterHelper
getVariants
in class ConverterHelper
source
- The source object class.java.io.IOException
protected boolean isCompatible(Variant variant)
variant
- The variant.public float score(java.lang.Object source, Variant target, Resource resource)
ConverterHelper
score
in class ConverterHelper
source
- The source object to convert.target
- The expected representation metadata.resource
- The calling resource.public <T> float score(Representation source, java.lang.Class<T> target, Resource resource)
ConverterHelper
score
in class ConverterHelper
source
- The source representation to convert.target
- The expected class of the Java object.resource
- The calling resource.protected Representation toHtml(StatusInfo status)
status
- The status info to represent.public <T> T toObject(Representation source, java.lang.Class<T> target, Resource resource) throws java.io.IOException
ConverterHelper
toObject
in class ConverterHelper
T
- The expected class of the Java object.source
- The source representation to convert.target
- The expected class of the Java object.resource
- The calling resource.java.io.IOException
public Representation toRepresentation(java.lang.Object source, Variant target, Resource resource) throws java.io.IOException
ConverterHelper
toRepresentation
in class ConverterHelper
source
- The source object to convert.target
- The expected representation metadata.resource
- The calling resource.java.io.IOException
Copyright © 2005-2024 Restlet.