@Test public void handleImageUppercase() { WikiReference ref = new WikiReference("Image:foo.png", "bar"); clazz.handle(ref); assertEquals("foo.png", clazz.getImgRef()); assertEquals("bar", clazz.getImgLabel()); }
public void handle(WikiReference ref) { String link = ref.getLink(); String label = ref.getLabel(); WikiParameters params = ref.getParameters(); if (params.getSize() == 0 && label == null) { params = params.addParameter("class", "wikimodel-freestanding"); } if (this.supportImage && link.matches(PREFIX_IMAGE)) { link = link.substring(PREFIX_IMAGE_LEN); if (label == null || "".equals(label)) { label = link; } handleImage(link, label, params); } else if (this.supportDownload && link.matches(PREFIX_DOWNLOAD)) { link = link.substring(PREFIX_DOWNLOAD_LEN); if (label == null || "".equals(label)) { label = link; } handleDownload(link, label, params); } else { if (label == null || "".equals(label)) { label = link; } handleReference(link, label, params); } }
ReferenceHandler { public void handle(WikiReference ref) { String link = ref.getLink(); String label = ref.getLabel(); WikiParameters params = ref.getParameters(); if (params.getSize() == 0 && label == null) { params = params.addParameter("class", "wikimodel-freestanding"); } if (this.supportImage && link.matches(PREFIX_IMAGE)) { link = link.substring(PREFIX_IMAGE_LEN); if (label == null || "".equals(label)) { label = link; } handleImage(link, label, params); } else if (this.supportDownload && link.matches(PREFIX_DOWNLOAD)) { link = link.substring(PREFIX_DOWNLOAD_LEN); if (label == null || "".equals(label)) { label = link; } handleDownload(link, label, params); } else { if (label == null || "".equals(label)) { label = link; } handleReference(link, label, params); } } }
ReferenceHandler { public void handle(WikiReference ref) { String link = ref.getLink(); String label = ref.getLabel(); WikiParameters params = ref.getParameters(); if (params.getSize() == 0 && label == null) { params = params.addParameter("class", "wikimodel-freestanding"); } if (this.supportImage && link.matches(PREFIX_IMAGE)) { link = link.substring(PREFIX_IMAGE_LEN); if (label == null || "".equals(label)) { label = link; } handleImage(link, label, params); } else if (this.supportDownload && link.matches(PREFIX_DOWNLOAD)) { link = link.substring(PREFIX_DOWNLOAD_LEN); if (label == null || "".equals(label)) { label = link; } handleDownload(link, label, params); } else { if (label == null || "".equals(label)) { label = link; } handleReference(link, label, params); } } protected  ReferenceHandler(boolean supportImage, boolean supportDownload); }
ReferenceHandler { public void handle(WikiReference ref) { String link = ref.getLink(); String label = ref.getLabel(); WikiParameters params = ref.getParameters(); if (params.getSize() == 0 && label == null) { params = params.addParameter("class", "wikimodel-freestanding"); } if (this.supportImage && link.matches(PREFIX_IMAGE)) { link = link.substring(PREFIX_IMAGE_LEN); if (label == null || "".equals(label)) { label = link; } handleImage(link, label, params); } else if (this.supportDownload && link.matches(PREFIX_DOWNLOAD)) { link = link.substring(PREFIX_DOWNLOAD_LEN); if (label == null || "".equals(label)) { label = link; } handleDownload(link, label, params); } else { if (label == null || "".equals(label)) { label = link; } handleReference(link, label, params); } } protected  ReferenceHandler(boolean supportImage, boolean supportDownload); void handle(WikiReference ref); }
ReferenceHandler { public void handle(WikiReference ref) { String link = ref.getLink(); String label = ref.getLabel(); WikiParameters params = ref.getParameters(); if (params.getSize() == 0 && label == null) { params = params.addParameter("class", "wikimodel-freestanding"); } if (this.supportImage && link.matches(PREFIX_IMAGE)) { link = link.substring(PREFIX_IMAGE_LEN); if (label == null || "".equals(label)) { label = link; } handleImage(link, label, params); } else if (this.supportDownload && link.matches(PREFIX_DOWNLOAD)) { link = link.substring(PREFIX_DOWNLOAD_LEN); if (label == null || "".equals(label)) { label = link; } handleDownload(link, label, params); } else { if (label == null || "".equals(label)) { label = link; } handleReference(link, label, params); } } protected  ReferenceHandler(boolean supportImage, boolean supportDownload); void handle(WikiReference ref); static final String PREFIX_DOWNLOAD; static final int PREFIX_DOWNLOAD_LEN; static final String PREFIX_IMAGE; static final int PREFIX_IMAGE_LEN; }