com.rubecula.util
Class StringPresentation

java.lang.Object
  extended bycom.rubecula.util.Presentation
      extended bycom.rubecula.util.StringPresentation
All Implemented Interfaces:
Auditable, Identifiable
Direct Known Subclasses:
Style

public class StringPresentation
extends Presentation

Class to model the presentation of pure text.

Since:
V_0_3
Version:
$Revision: 1.5 $
Author:
Robin Hillyard

Field Summary
(package private) static java.lang.String _PresentableClass
          The name of the class that will be used to create a Presentable from a StringPresentation, when invoking the Presentation.parse() method. // TODO Check this!
private  java.lang.String _S
           
 
Fields inherited from class com.rubecula.util.Presentation
_Appearance, $empty, $Stars
 
Constructor Summary
StringPresentation(java.lang.String s)
           
 
Method Summary
 java.lang.String audit(java.lang.String label)
          Method to return a detailed string from an object for debugging purposes.
 AttrMap getAttributes()
          Return the attributes with which this presentation was created, or at least the best guess.
 java.lang.String getIdentifier()
          Method to get the specific identifier for an object.
 java.lang.String getPresentableClass()
          Method to get the name of the corresponding Presentable class for this Presentation.
 java.lang.String toString(int width)
          Render this Presentation as a String within the width specified.
 
Methods inherited from class com.rubecula.util.Presentation
audit, audit, parse, toString, updateAppearance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_PresentableClass

static java.lang.String _PresentableClass
The name of the class that will be used to create a Presentable from a StringPresentation, when invoking the Presentation.parse() method. // TODO Check this! Ideally we would like to create any implementer of Replaceable.


_S

private final java.lang.String _S
Constructor Detail

StringPresentation

public StringPresentation(java.lang.String s)
Method Detail

getAttributes

public AttrMap getAttributes()
                      throws PresentationException
Return the attributes with which this presentation was created, or at least the best guess.

Specified by:
getAttributes in class Presentation
Returns:
a map of attributes used to render this Presentation. Currently returns an empty map.
Throws:
PresentationException

toString

public java.lang.String toString(int width)
Render this Presentation as a String within the width specified.

Specified by:
toString in class Presentation
Parameters:
width - the max. number of characters within which to output the presentation.
Returns:
a representation (rendering) of this Presentation.
Throws:
PresentationException - if the presentation cannot be rendered within the given width.

audit

public java.lang.String audit(java.lang.String label)
Description copied from interface: Auditable
Method to return a detailed string from an object for debugging purposes.

Parameters:
label - the label to associate with the data. If label is non-null, a more detailed audit will be returned (this normally occurs only at the top level).
Returns:
the detailed string.

getPresentableClass

public java.lang.String getPresentableClass()
Method to get the name of the corresponding Presentable class for this Presentation.

Specified by:
getPresentableClass in class Presentation
Returns:
_PresentableClass.

getIdentifier

public java.lang.String getIdentifier()
Method to get the specific identifier for an object.

Returns:
the text itself.