/** * Returns all lines of this <tt>Plugin</tt> as a string. * * @return all lines of this <tt>plugin</tt> as a string */ @Override public String toString() { final StringBuilder str = new StringBuilder(); str.append("File: ").append(filename.toString()).append(Strings.NEW_LINE.toString()); for (final String line : lines) { str.append(line).append(Strings.NEW_LINE.toString()); } return str.toString(); }
/** * Check if the name parameter of this <tt>Plugin</tt> is correct. Returns the name parameter if * so. * * @return the name parameter if it is correct * @throws PluginException if the name of this Plugin is incorrect */ public String checkName() throws PluginException { final String nameParam = this.checkParamsFor(PluginKeyword.NAME); if (!nameParam.equals(filename.getRawName())) { throw PluginException.create( PluginException.Type.INVALID_PARAMETER, filename, PluginKeyword.NAME.toString(), nameParam); } return nameParam; }
/** * Check if this plugin is of the specified type. is the same. * * @param type plugin type to test against * @throws PluginException if this plugin does not equal that type */ public void checkType(final Plugin.Type type) throws PluginException { if (filename.getType() != type) { throw PluginException.create(PluginException.Type.INVALID_TYPE, filename); } }