示例#1
0
        public abstract NieuwsBericht createNieuwsbericht(String type)
        {
            NieuwsBericht news = new NieuwsBericht();

            if (type.Equals("weerbericht"))
            {
                AbstractComponentFactory factory = new factories.WeerberichtComponentFactory();
                news.setType("Weerbericht");
                news.setHeader(factory.createHeader());
                news.setContent(factory.createContent());
                news.setFooter(factory.createFooter());
            }
            else if (type.Equals("Nieuwsbericht"))
            {
                AbstractComponentFactory factory = new factories.NieuwsberichtComponentFactory();
                news.setType("Nieuwsbericht");
                news.setHeader(factory.createHeader());
                news.setContent(factory.createContent());
                news.setFooter(factory.createFooter());
            }
            else if (type.Equals("Sportbericht"))
            {
                AbstractComponentFactory factory = new factories.SportberichtComponentFactory();
                news.setType("Sportbericht");
                news.setHeader(factory.createHeader());
                news.setContent(factory.createContent());
                news.setFooter(factory.createFooter());
            }
            else if (type.Equals("Overlijdingsbericht"))
            {
                AbstractComponentFactory factory = new factories.OverlijdingsberichtComponentFactory();
                news.setType("Overlijdingsbericht");
                news.setHeader(factory.createHeader());
                news.setContent(factory.createContent());
                news.setFooter(factory.createFooter());
            }
            return news;
        }
示例#2
0
 private void selectMessage(String message)
 {
     SWA2.Stores.ANewsStore store = new SWA2.Stores.ANewsStore();
     bericht = store.createNieuwsbericht(message);
 }