net.sf.nakeduml.seamgeneration.page.SeamPageSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metamodel Show documentation
Show all versions of metamodel Show documentation
A uml code generator and execution engine
The newest version!
package net.sf.nakeduml.seamgeneration.page;
import java.util.List;
import net.sf.nakeduml.textmetamodel.TextSource;
import org.jboss.seam.navigation.Page;
public class SeamPageSource extends AbstractSeamPagesSource implements TextSource{
private StringBuffer applicationPages = new StringBuffer();
List exceptions;
public SeamPageSource(Page page,List exceptions){
super(page);
this.exceptions = exceptions;
}
public StringBuffer getApplicationPages() {
return applicationPages;
}
public void setApplicationPages(StringBuffer applicationPages) {
this.applicationPages = applicationPages;
}
protected void startComposition(){
stringBuilder.append("\n");
stringBuilder.append("\n\n");
stringBuilder.append(" \n\n");
stringBuilder.append(" \n");
}
protected void endComposition(){
composeExceptions();
stringBuilder.append(" \n");
stringBuilder.append(" \n");
stringBuilder.append(" \n");
stringBuilder.append(" \n");
stringBuilder.append(" \n");
stringBuilder.append(" Unexpected error, please try again \n");
stringBuilder.append(" \n");
stringBuilder.append(" \n");
stringBuilder.append(" ");
}
private void composeExceptions(){
for(PagesException pagesException:exceptions){
pagesException.addTo(stringBuilder, 2);
}
}
public char[] toCharArray(){
startComposition();
outEvents();
outActions();
outBeginConversation();
outEndConversation();
outNavigations();
outApplicationPageXml();
stringBuilder.append(" \n");
endComposition();
return stringBuilder.toString().toCharArray();
}
private void outApplicationPageXml() {
stringBuilder.append(applicationPages);
}
public boolean hasContent(){
return true;
}
}