Package org.jostraca.section

Examples of org.jostraca.section.SectionSet


  }


  public void testHasSection() {
    Section    s1  = new BasicSection( "s1" );
    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1 );
    assertTrue( ss1.hasSection( "s1" ) );
    assertTrue( !ss1.hasSection( "s2" ) );
    assertTrue( !ss1.hasSection( null ) );
  }
View Full Code Here


  }


  public void appendToSection() {
    Section    s1  = new BasicSection( "s1" );
    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1 );
    ss1.appendToSection( "s1", "a" );
    assertTrue( ss1.hasSection( "s1" ) );
    assertEquals( "a", ss1.getSection( "s1").getContent() );
    ss1.appendToSection( "s1", "b" );
    assertEquals( "ab", ss1.getSection( "s1").getContent() );
  }
View Full Code Here

  }


  public void testClearSection() {
    Section    s1  = new BasicSection( "s1" );
    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1 );
    ss1.appendToSection( "s1", "a" );
    assertTrue( ss1.hasSection( "s1" ) );
    assertEquals( "a", ss1.getSection( "s1").getContent() );
    ss1.clearSection( "s1" );
    assertEquals( "", ss1.getSection( "s1").getContent() );
  }
View Full Code Here


  public void testClearAllSections() {
    Section    s1  = new BasicSection( "s1" );
    Section    s2  = new BasicSection( "s2" );
    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1 );
    ss1.appendToSection( "s1", "1" );
    ss1.appendToSection( "s2", "2" );
    assertTrue( ss1.hasSection( "s1" ) );
    assertTrue( ss1.hasSection( "s2" ) );
    assertEquals( "1", ss1.getSection( "s1").getContent() );
    assertEquals( "2", ss1.getSection( "s2").getContent() );
    ss1.clearAllSections();
    assertEquals( "", ss1.getSection( "s1").getContent() );
    assertEquals( "", ss1.getSection( "s2").getContent() );
  }
View Full Code Here

  }


  public void testGetSection() {
    Section    s1  = new BasicSection( "s1" );
    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1 );
    assertTrue( ss1.hasSection( "s1" ) );
    assertEquals( s1, ss1.getSection( "s1" ) );
    assertEquals( "", ss1.getSection( "s2" ).getContent() );
  }
View Full Code Here

  }


  public void isEmptySection() {
    Section    s1  = new BasicSection( "s1" );
    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1 );
    assertTrue( ss1.isEmptySection( "s1" ) );
    ss1.appendToSection( "s1", "a" );
    assertTrue( !ss1.isEmptySection( "s1" ) );
    ss1.clearSection( "s1" );
    assertTrue( ss1.isEmptySection( "s1" ) );
    assertTrue( ss1.isEmptySection( "s2" ) );
  }
View Full Code Here

    assertEquals( s2a, s2b );

    assertTrue( !s1a.equals(s2a) );
    assertTrue( !s1b.equals(s2b) );

    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1a );
    ss1.addSection( s1b );

    SectionSet ss2 = new SectionSet();

    assertTrue( !ss1.equals(ss2) );

    ss2.addSection( s1a );
    ss2.addSection( s1b );

    assertEquals( ss1, ss2 );
  }
View Full Code Here


  protected void processImpl( Template pTemplate ) {
    Template    template   = pTemplate;
    PropertySet tmps       = pTemplate.getMergedPropertySet();
    SectionSet  sectionSet = new SectionSet();

    String src = template.getSource();
    TemplateParser templateParser = getTemplateParser( tmps );
    templateParser.setPropertySet( tmps );
    templateParser.setSectionSet( sectionSet );
View Full Code Here


  // interface UnitProcessor

  public SectionSet process( UnitList pUnitList ) throws UnitException {
    return process( pUnitList, new SectionSet() );
  }
View Full Code Here

  public SectionSet process( UnitList pUnitList ) throws UnitException {
    return process( pUnitList, new SectionSet() );
  }

  public SectionSet process( UnitList pUnitList, SectionSet pSectionSet ) throws UnitException {
    SectionSet ss = pSectionSet;
    if( ErrorUtil.is_null( pSectionSet, "pSectionSet" ) ) {
      ss = new SectionSet();
    }

    return processImpl( pUnitList, ss );
  }
View Full Code Here

TOP

Related Classes of org.jostraca.section.SectionSet

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.