public class HTMLDescriptionReceiver extends java.lang.Object implements RootDescriptionReciever
DescriptionReceiver
that produces HTML
output using a IMarkupWriter
.
TODO: Make describeAlternate(Object)
exclusive with the other methods
title(String)
, property(String, Object)
, etc.
Constructor and Description |
---|
HTMLDescriptionReceiver(IMarkupWriter writer,
DescribableStrategy adapter) |
HTMLDescriptionReceiver(IMarkupWriter writer,
DescribableStrategy strategy,
HTMLDescriptionReceiverStyles styles) |
Modifier and Type | Method and Description |
---|---|
void |
array(java.lang.String key,
java.lang.Object[] values)
Emits a list of values for the key.
|
void |
collection(java.lang.String key,
java.util.Collection values)
As with
DescriptionReceiver.array(String, Object[]) , but the values are in a collection (which may be
null, to emit nothing). |
void |
describe(java.lang.Object object)
Describes the object, using a
DescribableStrategy , or just the object's toString()
if there is no strategy for the object. |
void |
describeAlternate(java.lang.Object alternate)
Invoke to describe another object instead of the current object.
|
void |
finishUp()
Invoked after one object has been fully described.
|
void |
property(java.lang.String key,
boolean value) |
void |
property(java.lang.String key,
byte value) |
void |
property(java.lang.String key,
char value) |
void |
property(java.lang.String key,
double value) |
void |
property(java.lang.String key,
float value) |
void |
property(java.lang.String key,
int value) |
void |
property(java.lang.String key,
long value) |
void |
property(java.lang.String key,
java.lang.Object value)
Emits a key/value pair, describing a property of the object.
|
void |
property(java.lang.String key,
short value) |
void |
section(java.lang.String section)
Starts a new sub-section within the description.
|
void |
title(java.lang.String title)
Provides a title for the object; usually the object's class name.
|
public HTMLDescriptionReceiver(IMarkupWriter writer, DescribableStrategy adapter)
public HTMLDescriptionReceiver(IMarkupWriter writer, DescribableStrategy strategy, HTMLDescriptionReceiverStyles styles)
public void describe(java.lang.Object object)
RootDescriptionReciever
DescribableStrategy
, or just the object's toString()
if there is no strategy for the object. Automatically invokes RootDescriptionReciever.finishUp()
when done.describe
in interface RootDescriptionReciever
object
- to be described, which may be nullpublic void describeAlternate(java.lang.Object alternate)
DescriptionReceiver
describeAlternate
in interface DescriptionReceiver
public void finishUp()
RootDescriptionReciever
finishUp
in interface RootDescriptionReciever
public void title(java.lang.String title)
DescriptionReceiver
title
in interface DescriptionReceiver
public void section(java.lang.String section)
DescriptionReceiver
section
in interface DescriptionReceiver
public void property(java.lang.String key, java.lang.Object value)
DescriptionReceiver
property
in interface DescriptionReceiver
public void property(java.lang.String key, boolean value)
property
in interface DescriptionReceiver
public void property(java.lang.String key, byte value)
property
in interface DescriptionReceiver
public void property(java.lang.String key, short value)
property
in interface DescriptionReceiver
public void property(java.lang.String key, int value)
property
in interface DescriptionReceiver
public void property(java.lang.String key, long value)
property
in interface DescriptionReceiver
public void property(java.lang.String key, float value)
property
in interface DescriptionReceiver
public void property(java.lang.String key, double value)
property
in interface DescriptionReceiver
public void property(java.lang.String key, char value)
property
in interface DescriptionReceiver
public void array(java.lang.String key, java.lang.Object[] values)
DescriptionReceiver
array
in interface DescriptionReceiver
public void collection(java.lang.String key, java.util.Collection values)
DescriptionReceiver
DescriptionReceiver.array(String, Object[])
, but the values are in a collection (which may be
null, to emit nothing).collection
in interface DescriptionReceiver