org.apache.tapestry.describe
Class HTMLDescriptionReceiver

java.lang.Object
  extended by org.apache.tapestry.describe.HTMLDescriptionReceiver
All Implemented Interfaces:
DescriptionReceiver, RootDescriptionReciever

public class HTMLDescriptionReceiver
extends Object
implements RootDescriptionReciever

Implementation of DescriptionReceiver that produces HTML output using a IMarkupWriter.

TODO: Make describeAlternate(Object) exclusive with the other methods title(String), property(String, Object), etc.

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
HTMLDescriptionReceiver(IMarkupWriter writer, DescribableStrategy adapter)
           
HTMLDescriptionReceiver(IMarkupWriter writer, DescribableStrategy strategy, HTMLDescriptionReceiverStyles styles)
           
 
Method Summary
 void array(String key, Object[] values)
          Emits a list of values for the key.
 void collection(String key, Collection values)
          As with DescriptionReceiver.array(String, Object[]), but the values are in a collection (which may be null, to emit nothing).
 void describe(Object object)
          Describes the object, using a DescribableStrategy, or just the object's toString() if there is no strategy for the object.
 void describeAlternate(Object alternate)
          Invoke to describe another object instead of the current object.
 void finishUp()
          Invoked after one object has been fully described.
 void property(String key, boolean value)
           
 void property(String key, byte value)
           
 void property(String key, char value)
           
 void property(String key, double value)
           
 void property(String key, float value)
           
 void property(String key, int value)
           
 void property(String key, long value)
           
 void property(String key, Object value)
          Emits a key/value pair, describing a property of the object.
 void property(String key, short value)
           
 void section(String section)
          Starts a new sub-section within the description.
 void title(String title)
          Provides a title for the object; usually the object's class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLDescriptionReceiver

public HTMLDescriptionReceiver(IMarkupWriter writer,
                               DescribableStrategy adapter)

HTMLDescriptionReceiver

public HTMLDescriptionReceiver(IMarkupWriter writer,
                               DescribableStrategy strategy,
                               HTMLDescriptionReceiverStyles styles)
Method Detail

describe

public void describe(Object object)
Description copied from interface: RootDescriptionReciever
Describes the object, using a DescribableStrategy, or just the object's toString() if there is no strategy for the object. Automatically invokes RootDescriptionReciever.finishUp() when done.

Specified by:
describe in interface RootDescriptionReciever
Parameters:
object - to be described, which may be null

describeAlternate

public void describeAlternate(Object alternate)
Description copied from interface: DescriptionReceiver
Invoke to describe another object instead of the current object.

Specified by:
describeAlternate in interface DescriptionReceiver

finishUp

public void finishUp()
Description copied from interface: RootDescriptionReciever
Invoked after one object has been fully described. Ends a <table>, if one has been started, and resets the receiver to begin a new object.

Specified by:
finishUp in interface RootDescriptionReciever

title

public void title(String title)
Description copied from interface: DescriptionReceiver
Provides a title for the object; usually the object's class name.

Specified by:
title in interface DescriptionReceiver

section

public void section(String section)
Description copied from interface: DescriptionReceiver
Starts a new sub-section within the description. A description may have any number of sections (but sections do not nest). A second title is only emitted when the firstproperty within the section is emitted.

Specified by:
section in interface DescriptionReceiver

property

public void property(String key,
                     Object value)
Description copied from interface: DescriptionReceiver
Emits a key/value pair, describing a property of the object. The value will itself be described. This method is overridden for scalar property types.

Specified by:
property in interface DescriptionReceiver

property

public void property(String key,
                     boolean value)
Specified by:
property in interface DescriptionReceiver

property

public void property(String key,
                     byte value)
Specified by:
property in interface DescriptionReceiver

property

public void property(String key,
                     short value)
Specified by:
property in interface DescriptionReceiver

property

public void property(String key,
                     int value)
Specified by:
property in interface DescriptionReceiver

property

public void property(String key,
                     long value)
Specified by:
property in interface DescriptionReceiver

property

public void property(String key,
                     float value)
Specified by:
property in interface DescriptionReceiver

property

public void property(String key,
                     double value)
Specified by:
property in interface DescriptionReceiver

property

public void property(String key,
                     char value)
Specified by:
property in interface DescriptionReceiver

array

public void array(String key,
                  Object[] values)
Description copied from interface: DescriptionReceiver
Emits a list of values for the key. Each value will be described. Emits nothing if the array is null.

Specified by:
array in interface DescriptionReceiver

collection

public void collection(String key,
                       Collection values)
Description copied from interface: DescriptionReceiver
As with DescriptionReceiver.array(String, Object[]), but the values are in a collection (which may be null, to emit nothing).

Specified by:
collection in interface DescriptionReceiver


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.