net.sf.japaki.text
Class ClassFormat
java.lang.Object
java.text.Format
net.sf.japaki.text.AbstractFormat
net.sf.japaki.text.ClassFormat
- All Implemented Interfaces:
- Serializable, Cloneable
public class ClassFormat
- extends AbstractFormat
A format to parse class names.
- See Also:
- Serialized Form
getInstance
public static ClassFormat getInstance()
- Returns the singleton instance of this class.
- Returns:
- the singleton instance of this class
parseObject
public Object parseObject(String source,
ParsePosition pos)
- Parses the sourcestring to the first non-java letter and tries to
find the class for the parsed name.
- Specified by:
parseObject in class Format
- Returns:
- the class that has the parsed name
- Throws:
NullPointerException - if source or pos is
null.
format
public StringBuffer format(Object obj,
StringBuffer toAppendTo,
FieldPosition pos)
- Appends the the canonical name of the given class to the string buffer.
- Overrides:
format in class AbstractFormat
- Parameters:
obj - class to be formattedtoAppendTo - where the text is to be appendedpos - ignored
- Returns:
- the string buffer passed in as
toAppendTo,
with formatted text appended
- Throws:
NullPointerException - if obj is null.
IllegalArgumentException - if obj ist not a class.