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

Quick Search    Search Deep

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

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

public class DefaultPropertyFormat
extends AbstractPropertyFormat

Default implementation for converting objects to and from text data. This assumes that the associated class has a useful toString() method that can also be passed to a String arg constructor.

Version:
$Revision: 1.1 $

Field Summary
private  java.lang.Class type
           
 
Constructor Summary
DefaultPropertyFormat(java.lang.Class type)
           
 
Method Summary
 java.lang.String format(org.progeeks.meta.MetaObject obj)
          Returns the formatted String for the specified MetaObject.
 java.lang.String format(java.lang.Object obj)
          Returns the formatted String for the specified Object.
 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
format, parseObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

private java.lang.Class type
Constructor Detail

DefaultPropertyFormat

public DefaultPropertyFormat(java.lang.Class type)
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.String format(org.progeeks.meta.MetaObject obj)
Returns the formatted String for the specified MetaObject.


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