Package org.jostraca.section

Examples of org.jostraca.section.SectionSet


      //SectionSet         dss = dup.process( ul );
      //System.out.println( dss );

      BasicUnitProcessor bup = new BasicUnitProcessor();
      bup.setPropertySet( iPropertySet );
      SectionSet         uss = bup.process( ul );
     
      //System.out.println( "uss:"+uss );
      //System.out.println( "iSectionSet:"+iSectionSet );
      //System.out.println( "uss==iSectionSet:"+uss.equals(iSectionSet) );
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


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

    WriterFormat wf = makeWriterFormat( tmps );

    modifySections( wf.getSource(), sectionSet, tmps );
View Full Code Here

      //SectionSet         dss = dup.process( ul );
      //System.out.println( dss );

      BasicUnitProcessor bup = new BasicUnitProcessor();
      bup.setPropertySet( iPropertySet );
      SectionSet         uss = bup.process( ul );
     
      //System.out.println( "uss:"+uss );
      //System.out.println( "iSectionSet:"+iSectionSet );
      //System.out.println( "uss==iSectionSet:"+uss.equals(iSectionSet) );
View Full Code Here

    Hashtable attr = (Hashtable) iAttributes.get( ATTR_unit_attr );
    if( null == attr ) {
      throw new TransformException( TransformException.CODE_null_unit_attr );
    }

    SectionSet ss = (SectionSet) iAttributes.get( ATTR_sectionset );
    if( null == ss ) {
      throw new TransformException( TransformException.CODE_null_sectionset );
    }

    if( attr.containsKey( ATTR_unit_source_section ) ) {
      String source_section = (String) attr.get( ATTR_unit_source_section );
      if( ss.hasSection( source_section ) ) {
        content = ss.getSection( source_section ).getContent();
      }
    }

    return content;
  }
View Full Code Here

    String bartext = "bartext";
    Section fooin = new BasicSection( fooname );
    fooin.setContent( footext );
    Section barin = new BasicSection( barname );
    barin.setContent( bartext );
    SectionSet foobarin = new SectionSet();
    foobarin.addSection( fooin );
    foobarin.addSection( barin );

    Identity identity = new Identity();
   
    Section fooout = identity.modify( fooin, mps );
    assertTrue( fooout.getContent().equals( footext ) );
    assertTrue( fooout.getName().equals( fooname ) );

    identity.modify( barin, mps );
    assertTrue( barin.getContent().equals( bartext ) );
    assertTrue( barin.getName().equals( barname ) );   

    SectionSet  foobarout   = identity.modify( foobarin, mps );
    Enumeration sectionEnum = foobarout.enumerateSections();
    while( sectionEnum.hasMoreElements() ) {
      Section section = (Section) sectionEnum.nextElement();
      if( fooname.equals( section.getName() ) ) {
        assertTrue( section.getContent().equals( footext ) );
      }
View Full Code Here

    Section fooin = new BasicSection( fooname );
    fooin.setContent( footext );
    Section barin = new BasicSection( barname );
    barin.setContent( bartext );
    SectionSet foobarin = new SectionSet();
    foobarin.addSection( fooin );
    foobarin.addSection( barin );

    Collapser collapser = new Collapser();
   
    Section fooout = collapser.modify( fooin, mps );
    assertTrue( fooout.getContent().equals( footextcollapse ) );
    assertTrue( fooout.getName().equals( fooname ) );

    collapser.modify( barin, mps );
    assertTrue( barin.getContent().equals( bartextcollapse ) );
    assertTrue( barin.getName().equals( barname ) );   

    fooin.setContent( footext );
    barin.setContent( bartext );

    SectionSet  foobarout   = collapser.modify( foobarin, mps );
    Enumeration sectionEnum = foobarout.enumerateSections();
    while( sectionEnum.hasMoreElements() ) {
      Section section = (Section) sectionEnum.nextElement();
      if( fooname.equals( section.getName() ) ) {
        assertTrue( section.getContent().equals( footextcollapse ) );
      }
View Full Code Here

    foos.setContent( footext1 + footext2 );
    Section bars  = new BasicSection( barname );
    bars.setContent( bartext1 + bartext2 );
    Section naffs = new BasicSection( naffname );
    naffs.setContent( nafftext1 + nafftext2 );
    SectionSet foobarss = new SectionSet();
    foobarss.addSection( foos  );
    foobarss.addSection( bars  );
    foobarss.addSection( naffs );

    String in_1     = "  ";
    String in_1_2   = "    ";
    String in_1_2_3 = "      ";
View Full Code Here

    String  s2_name  = "s2_name";
    Section s2       = (Section)( new BasicSection( s2_name ) );

    assertEquals( s1, s1 );

    SectionSet ss = new SectionSet();
    ss.addSection( s1 );
    assertTrue( ss.hasSection(s1_name) );
    assertTrue( !ss.hasSection(s2_name) );
    assertTrue( !ss.hasSection(null) );
    assertTrue( s1_name.equals( ss.getSection(s1_name).getName() ) );

    assertTrue( ss.isEmptySection(s1_name) );

    ss.appendToSection( s1_name, s1_text1 );
    assertTrue( !ss.isEmptySection( s1_name ) );

    ss.addSection( s2 );
    assertTrue( ss.hasSection(s2_name) );

    assertEquals( ss, ss );
  }
View Full Code Here

  }


  public void testAddSection() {
    Section    s1  = new BasicSection( "s1" );
    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1 );
    assertTrue( ss1.hasSection( "s1" ) );
    assertTrue( !ss1.hasSection( "s2" ) );
  }
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.