org.onemind.commons.java.text
Class SimpleTextGenerator

java.lang.Object
  extended byorg.onemind.commons.java.text.SimpleTextGenerator
All Implemented Interfaces:
TextGenerator

public class SimpleTextGenerator
extends java.lang.Object
implements TextGenerator

A simple implementation of generator

Author:
TiongHiang Lee (thlee@onemindsoft.org)

Constructor Summary
SimpleTextGenerator(java.lang.String delimiter, java.lang.String subDelimiter)
          Constructor
 
Method Summary
 void addGenerator(java.lang.String subSpec, TextGenerator gen)
          add text generator to the sub specification
 java.lang.StringBuffer generateText(java.lang.String spec, java.lang.Object obj)
          {@inheritDoc}
 void generateText(java.lang.String spec, java.lang.Object obj, java.lang.StringBuffer sb)
          Generate some text through the spec passed in
 TextGenerator getGenerator(java.lang.String subSpec)
          Get the generator for subSpec
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTextGenerator

public SimpleTextGenerator(java.lang.String delimiter,
                           java.lang.String subDelimiter)
Constructor

Method Detail

addGenerator

public void addGenerator(java.lang.String subSpec,
                         TextGenerator gen)
add text generator to the sub specification

Parameters:
subSpec - the sub spec
gen - the sub generator

generateText

public java.lang.StringBuffer generateText(java.lang.String spec,
                                           java.lang.Object obj)
{@inheritDoc}


generateText

public void generateText(java.lang.String spec,
                         java.lang.Object obj,
                         java.lang.StringBuffer sb)
Generate some text through the spec passed in

Specified by:
generateText in interface TextGenerator
Parameters:
spec - the specification
obj - the target object where the text should be generate towards
Returns:
the text

getGenerator

public TextGenerator getGenerator(java.lang.String subSpec)
Get the generator for subSpec

Parameters:
subSpec - the sub spec
Returns:
the generator for the sub spec


Copyright © 2004-2006 . All Rights Reserved.