Package org.jostraca

Examples of org.jostraca.BasicTextElementProcessor



  public void testCreate() throws Exception {
    PropertySet               ps   = new PropertySet();
    TemplateActionHandler     tah  = new TemplateActionHandlerStub();
    BasicTextElementProcessor btep = create( ps, tah );
  }
View Full Code Here


  public void testProcessText() throws Exception {
    TemplateActionHandlerStub tahs  = new TemplateActionHandlerStub();
    PropertySet               ps    = new PropertySet();
    ps.load( new File( "../../../../conf/system.conf" ) );
    BasicTextElementProcessor btep = create( ps, tahs );
    String content   = "content";
    Block  textBlock = new Block( Block.TYPE_text, content );

    assertTrue( btep.isMatch( textBlock ) );

    btep.process( textBlock );

    assertTrue( ("_insert(\""+content+"\");"+BasicTemplateElementProcessor.NEWLINE).equals( tahs.getLastAppendedContent() ) );
  }
View Full Code Here

  private BasicTextElementProcessor create( PropertySet pPropertySet,
                                            TemplateActionHandler pTemplateActionHandler ) throws Exception {

    BasicUnitList bul = new BasicUnitList();   
    TextualTransformManagerTable ttmt = new TextualTransformManagerTable( pPropertySet );
    BasicTextElementProcessor    btep = new BasicTextElementProcessor( bul, pTemplateActionHandler,
                                                                       pPropertySet, ttmt );
    return btep;
  }
View Full Code Here


  public void testCreate() throws Exception {
    PropertySet               ps   = new PropertySet();
    TemplateActionHandler     tah  = new TemplateActionHandlerStub();
    BasicTextElementProcessor btep = create( ps, tah );
  }
View Full Code Here

  public void testProcessText() throws Exception {
    TemplateActionHandlerStub tahs  = new TemplateActionHandlerStub();
    PropertySet               ps    = new PropertySet();
    ps.load( new File( "conf/system.conf" ) );
    BasicTextElementProcessor btep = create( ps, tahs );
    String content   = "content";
    Block  textBlock = new Block( Block.TYPE_text, content );

    assertTrue( btep.isMatch( textBlock ) );

    btep.process( textBlock );

    assertTrue( ("_insert(\""+content+"\");"+BasicTemplateElementProcessor.NEWLINE).equals( tahs.getLastAppendedContent() ) );
  }
View Full Code Here

  private BasicTextElementProcessor create( PropertySet pPropertySet,
                                            TemplateActionHandler pTemplateActionHandler ) throws Exception {

    BasicUnitList bul = new BasicUnitList();   
    TextualTransformManagerTable ttmt = new TextualTransformManagerTable( pPropertySet );
    BasicTextElementProcessor    btep = new BasicTextElementProcessor( bul, pTemplateActionHandler,
                                                                       pPropertySet, ttmt );
    return btep;
  }
View Full Code Here

TOP

Related Classes of org.jostraca.BasicTextElementProcessor

Copyright © 2018 www.massapicom. 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.