Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.progeeks.meta.format
Class DefaultListPropertyFormat  view DefaultListPropertyFormat download DefaultListPropertyFormat.java

java.lang.Object
  extended byorg.progeeks.meta.format.AbstractPropertyFormat
      extended byorg.progeeks.meta.format.DefaultListPropertyFormat
All Implemented Interfaces:
org.progeeks.meta.PropertyFormat

public class DefaultListPropertyFormat
extends AbstractPropertyFormat

Default implementation for converting a list of objects to and from text data. This assumes that the values' have a useful toString() method. This formatter can only be used for rendering.

Version:
$Revision: 1.2 $

Field Summary
private  java.lang.String delimiter
           
private  org.progeeks.meta.PropertyFormat valueFormat
           
 
Constructor Summary
DefaultListPropertyFormat(org.progeeks.meta.PropertyFormat valueFormat, java.lang.String delimiter)
          Creates a property format object that will output a list of values by converting them individually with the specified property format object and then appending them together separated by the specified delimiter.
 
Method Summary
 java.lang.String format(java.lang.Object obj)
          Returns the formatted String for the specified Object.
 java.lang.StringBuffer format(java.lang.Object obj, java.lang.StringBuffer appendTo)
          Appends the formatted string to the specified StringBuffer and returns the supplied StringBuffer.
 java.lang.Object parseObject(java.lang.String source, int index)
          Parses the text starting at the specified index and converts it into an Object of the appropriate type.
 
Methods inherited from class org.progeeks.meta.format.AbstractPropertyFormat
parseObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delimiter

private java.lang.String delimiter

valueFormat

private org.progeeks.meta.PropertyFormat valueFormat
Constructor Detail

DefaultListPropertyFormat

public DefaultListPropertyFormat(org.progeeks.meta.PropertyFormat valueFormat,
                                 java.lang.String delimiter)
Creates a property format object that will output a list of values by converting them individually with the specified property format object and then appending them together separated by the specified delimiter.

Method Detail

format

public java.lang.String format(java.lang.Object obj)
Returns the formatted String for the specified Object.

Specified by:
format in interface org.progeeks.meta.PropertyFormat
Specified by:
format in class AbstractPropertyFormat

format

public java.lang.StringBuffer format(java.lang.Object obj,
                                     java.lang.StringBuffer appendTo)
Appends the formatted string to the specified StringBuffer and returns the supplied StringBuffer.

Specified by:
format in interface org.progeeks.meta.PropertyFormat
Overrides:
format in class AbstractPropertyFormat

parseObject

public java.lang.Object parseObject(java.lang.String source,
                                    int index)
Parses the text starting at the specified index and converts it into an Object of the appropriate type. If this method is not supported then an UnsupportedOperationException will be thrown.

Specified by:
parseObject in interface org.progeeks.meta.PropertyFormat
Specified by:
parseObject in class AbstractPropertyFormat