X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftemplate%2FNotificationAccessor.java;fp=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftemplate%2FNotificationAccessor.java;h=0000000000000000000000000000000000000000;hb=40e29fa1abc0d1da75831d69d4cc9f52601a4045;hp=22c53c303373ab9f51c974d92e3e2584329fea17;hpb=0e2b79c53a31b7aaa5e44e02a9c6491b4b973d5e;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/template/NotificationAccessor.java b/src/main/java/net/pterodactylus/sone/template/NotificationAccessor.java deleted file mode 100644 index 22c53c3..0000000 --- a/src/main/java/net/pterodactylus/sone/template/NotificationAccessor.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Sone - NotificationAccessor.java - Copyright © 2010 David Roden - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package net.pterodactylus.sone.template; - -import java.io.IOException; -import java.io.StringWriter; - -import net.pterodactylus.util.notify.Notification; -import net.pterodactylus.util.template.DataProvider; -import net.pterodactylus.util.template.ReflectionAccessor; - -/** - * Adds additional properties to a {@link Notification}. - *
- *
render
- *
Returns the rendered notification.
- *
- * - * @author David ‘Bombe’ Roden - */ -public class NotificationAccessor extends ReflectionAccessor { - - /** - * {@inheritDoc} - */ - @Override - public Object get(DataProvider dataProvider, Object object, String member) { - Notification notification = (Notification) object; - if ("render".equals(member)) { - StringWriter stringWriter = new StringWriter(); - try { - notification.render(stringWriter); - } catch (IOException ioe1) { - /* TODO - log. */ - /* ignore. */ - } - return stringWriter.toString(); - } - return super.get(dataProvider, object, member); - } - -}