Package net.sourceforge.rtf.context

Source Code of net.sourceforge.rtf.context.RTFContextFieldsReader

package net.sourceforge.rtf.context;

import net.sourceforge.rtf.context.fields.RTFContextBookmark;
import net.sourceforge.rtf.context.fields.RTFContextFields;
import net.sourceforge.rtf.context.fields.RTFContextField;

/**
* Implement AbstractRTFContextReader to Read velocity context
* and populate RTFContextFields class with all keys putted
* into Velocity Context.
* @version 1.0.0
* @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
*
*/
public class RTFContextFieldsReader extends AbstractRTFContextReader {

  private RTFContextFields fields;
  protected void startReading() {
    fields = new RTFContextFields();
   
  }
 
  protected void endReading() {
   
  }
 
  /**
   * Add field
   */
  protected void addMergeField(String mergeFieldName, boolean mergeFieldIsList, String mergeFieldNameWithListInfo, boolean isImage) {
    RTFContextField field = new RTFContextField(mergeFieldName, mergeFieldIsList, mergeFieldNameWithListInfo);
    field.setImage(isImage);
    fields.addMergeField(field);
  }
 
  public RTFContextFields getContextFields() {
    return fields;
  }
 
  /**
   * Add Bookmark
   */
  protected void addBookmark(String bookmarkName, String type) {
    RTFContextBookmark bookmark = new RTFContextBookmark(bookmarkName, type);
    fields.addBookmark(bookmark);
  }
 
}
TOP

Related Classes of net.sourceforge.rtf.context.RTFContextFieldsReader

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.