public FOMUnsupportedTextTypeException(String message) { super(Localizer.sprintf("UNSUPPORTED.TEXT.TYPE", message)); }
public FOMUnsupportedContentTypeException(String message) { super(Localizer.sprintf("UNSUPPORTED.CONTENT.TYPE", message)); }
private RuntimeException throwex(String id, String arg, Throwable t) { return new RuntimeException(Localizer.sprintf(id, arg), t); }
protected void checkFactory(Factory factory) { if (!(factory instanceof FOMFactory)) throw new FOMException(Localizer.sprintf("WRONG.PARSER.INSTANCE", FOMFactory.class.getName())); }
public static int getPageSize(RequestContext request, String pagesizeparam, int defaultpagesize) { int size = defaultpagesize; try { String _ps = request.getParameter(pagesizeparam); size = (_ps != null) ? Math.min(Math.max(Integer.parseInt(_ps), 0), defaultpagesize) : defaultpagesize; } catch (Exception e) { } log.debug(Localizer.sprintf("PAGE.SIZE", size)); return size; }
/** * Return a new instance of org.apache.abdera.parser.ParserFactory * * @return A new ParserFactory instance */ public ParserFactory newParserFactoryInstance(Abdera abdera) { try { return ServiceUtil.newParserFactoryInstance(abdera); } catch (NoClassDefFoundError n) { throw new RuntimeException(Localizer.sprintf("IMPLEMENTATION.NOT.AVAILABLE","Parser"),n); } }
public <T extends StreamWriter> T newStreamWriter(String name) { Class<? extends StreamWriter> _class = getStreamWriters().get(name); StreamWriter sw = null; if (_class != null) { try { sw = _class.newInstance(); } catch (Exception e) { throw new RuntimeException(Localizer.sprintf("IMPLEMENTATION.NOT.AVAILABLE", "StreamWriter"), e); } } return (T)sw; }
public static synchronized Abdera getAbdera() { if (abdera == null) { log.debug(Localizer.sprintf("CREATING.NEW.INSTANCE", "Abdera")); abdera = new Abdera(); } return abdera; }
/** * Return a new instance of the default org.apache.abdera.writer.Writer * * @return A new default writer implementation instance */ public StreamWriter newStreamWriterInstance(Abdera abdera) { try { return ServiceUtil.newStreamWriterInstance(abdera); } catch (NoClassDefFoundError n) { throw new RuntimeException(Localizer.sprintf("IMPLEMENTATION.NOT.AVAILABLE","StreamWriter"),n); } }
public static int getOffset(RequestContext request, String pageparam, int pageSize) { int offset = 0; try { String _page = request.getParameter(pageparam); int page = (_page != null) ? Integer.parseInt(_page) : 1; page = Math.max(page, 1) - 1; offset = pageSize * page; } catch (Exception e) { } log.debug(Localizer.sprintf("OFFSET", offset)); return offset; }
public static synchronized ServiceManager getInstance() { if (INSTANCE == null) { log.debug(Localizer.sprintf("CREATING.NEW.INSTANCE", "ServiceManager")); INSTANCE = new ServiceManager(); } return INSTANCE; }
/** * Return a new instance of org.apache.abdera.xpath.XPath * * @return A new XPath instance */ public XPath newXPathInstance(Abdera abdera) { try { return ServiceUtil.newXPathInstance(abdera); } catch (NoClassDefFoundError n) { throw new RuntimeException(Localizer.sprintf("IMPLEMENTATION.NOT.AVAILABLE","XPath"),n); } }
/** * Return a new instance of org.apache.abdera.writer.WriterFactory * * @return A new WriterFactory instance */ public WriterFactory newWriterFactoryInstance(Abdera abdera) { try { return ServiceUtil.newWriterFactoryInstance(abdera); } catch (NoClassDefFoundError n) { throw new RuntimeException(Localizer.sprintf("IMPLEMENTATION.NOT.AVAILABLE","WriterFactory"),n); } }
/** * Return a new instance of the default org.apache.abdera.writer.Writer * * @return A new default writer implementation instance */ public Writer newWriterInstance(Abdera abdera) { try { return ServiceUtil.newWriterInstance(abdera); } catch (NoClassDefFoundError n) { throw new RuntimeException(Localizer.sprintf("IMPLEMENTATION.NOT.AVAILABLE","Writer"),n); } }
public Provider newProvider(Map<String, String> properties) { Abdera abdera = getAbdera(); String instance = properties.get(PROVIDER); if (instance == null) { instance = DefaultProvider.class.getName(); } log.debug(Localizer.sprintf("CREATING.NEW.INSTANCE", "Provider")); Provider provider = (Provider)Discover.locate(PROVIDER, instance); log.debug(Localizer.sprintf("INITIALIZING.INSTANCE", "Provider")); provider.init(abdera, properties); return provider; } }
/** * Sanitize the value of a Slug header. Any non alphanumeric characters in the slug are replaced with an underscore */ public static String sanitizeSlug(String slug) { if (slug == null) throw new IllegalArgumentException(Localizer.get("SLUG.NOT.NULL")); String sanitized = Sanitizer.sanitize(slug); log.debug(Localizer.sprintf("SLUG.SANITIZED", slug, sanitized)); return sanitized; }
if ((content.getSrc() != null || content.getContentType() == Content.Type.MEDIA) && entry .getSummaryElement() == null) { log.debug(Localizer.sprintf("CHECKING.VALID.ENTRY", false)); return false; log.debug(Localizer.sprintf("CHECKING.VALID.ENTRY", false)); return false; log.debug(Localizer.sprintf("CHECKING.VALID.ENTRY", true)); return true;