org.jcoderz.commons.logging
Class AsItIsFormat

java.lang.Object
  extended by java.text.Format
      extended by org.jcoderz.commons.logging.AsItIsFormat
All Implemented Interfaces:
Serializable, Cloneable

public final class AsItIsFormat
extends Format

This Format class is used for formatting a String as it is, i.e. do no formatting of the String. For enabling this as a parser for the format, delimiters can be set when constructing an instance of this. But if this functionality is actually desired, one has to be sure the delimiter is not part of the string to format otherwise the result might not be as expected.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.Format
Format.Field
 
Constructor Summary
AsItIsFormat(String delimiters)
          Constructor, saves the delimiters for parsing.
 
Method Summary
 StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
          
 Object parseObject(String source, ParsePosition pos)
          
 
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

AsItIsFormat

public AsItIsFormat(String delimiters)
Constructor, saves the delimiters for parsing. When this is used for parsing a String, the delimiters work as for a StringTokenizer.

Parameters:
delimiters - String containing delimiting chars, used when parsing.
Method Detail

parseObject

public Object parseObject(String source,
                          ParsePosition pos)

Specified by:
parseObject in class Format

format

public StringBuffer format(Object obj,
                           StringBuffer toAppendTo,
                           FieldPosition pos)

Specified by:
format in class Format


Copyright 2007 The jCoderZ Project.