net.sf.doolin.gui.swing
Class ByClassAndPropertyFormat<T>

java.lang.Object
  extended by java.text.Format
      extended by net.sf.doolin.gui.swing.ByClassAndPropertyFormat<T>
Type Parameters:
T - Type of the item
All Implemented Interfaces:
Serializable, Cloneable

public class ByClassAndPropertyFormat<T>
extends Format

Completion handler that is based on a bean class name and one of its properties to store the text value

Author:
Damien Coraboeuf
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.Format
Format.Field
 
Constructor Summary
ByClassAndPropertyFormat()
          Default constructor
ByClassAndPropertyFormat(Class<T> beanClass, String propertyName)
          Constructor
 
Method Summary
 StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
           
 Class<T> getBeanClass()
          Returns the beanClass
 String getPropertyName()
          Returns the propertyName
 Object parseObject(String source, ParsePosition pos)
           
 void setBeanClass(Class<T> beanClass)
          Sets the beanClass
 void setPropertyName(String propertyName)
          Sets the propertyName
 
Methods inherited from class java.text.Format
clone, format, formatToCharacterIterator, parseObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByClassAndPropertyFormat

public ByClassAndPropertyFormat(Class<T> beanClass,
                                String propertyName)
Constructor

Parameters:
beanClass - Bean class
propertyName - Name of the bean property that holds the text value

ByClassAndPropertyFormat

public ByClassAndPropertyFormat()
Default constructor

Method Detail

getBeanClass

public Class<T> getBeanClass()
Returns the beanClass

Returns:
Class

setBeanClass

public void setBeanClass(Class<T> beanClass)
Sets the beanClass

Parameters:
beanClass - Class

getPropertyName

public String getPropertyName()
Returns the propertyName

Returns:
String

setPropertyName

public void setPropertyName(String propertyName)
Sets the propertyName

Parameters:
propertyName - String

format

public StringBuffer format(Object obj,
                           StringBuffer toAppendTo,
                           FieldPosition pos)
Specified by:
format in class Format

parseObject

public Object parseObject(String source,
                          ParsePosition pos)
Specified by:
parseObject in class Format


Copyright © 2011. All Rights Reserved.