@Test public void parseImages() { ResourceReference reference = this.parser.parse("attach:wiki:space.page@filename"); assertEquals(ResourceType.ATTACHMENT, reference.getType()); assertEquals("wiki:space.page@filename", reference.getReference()); assertTrue(reference.isTyped()); assertEquals("Typed = [true] Type = [attach] Reference = [wiki:space.page@filename]", reference.toString()); reference = this.parser.parse("path:/some/image"); assertEquals(ResourceType.PATH, reference.getType()); assertEquals("/some/image", reference.getReference()); assertTrue(reference.isTyped()); assertEquals("Typed = [true] Type = [path] Reference = [/some/image]", reference.toString()); reference = this.parser.parse("icon:name"); assertEquals(ResourceType.ICON, reference.getType()); assertEquals("name", reference.getReference()); assertTrue(reference.isTyped()); assertEquals("Typed = [true] Type = [icon] Reference = [name]", reference.toString()); }
@Override public ResourceReference parse(String rawReference) { ResourceReference reference = this.defaultResourceReferenceParser.parse(rawReference); if (reference.getType().equals(ResourceType.UNKNOWN)) { reference = this.untypedImageReferenceParser.parse(rawReference); } return reference; }
DefaultImageReferenceParser implements ResourceReferenceParser { @Override public ResourceReference parse(String rawReference) { ResourceReference reference = this.defaultResourceReferenceParser.parse(rawReference); if (reference.getType().equals(ResourceType.UNKNOWN)) { reference = this.untypedImageReferenceParser.parse(rawReference); } return reference; } }
DefaultImageReferenceParser implements ResourceReferenceParser { @Override public ResourceReference parse(String rawReference) { ResourceReference reference = this.defaultResourceReferenceParser.parse(rawReference); if (reference.getType().equals(ResourceType.UNKNOWN)) { reference = this.untypedImageReferenceParser.parse(rawReference); } return reference; }  }
DefaultImageReferenceParser implements ResourceReferenceParser { @Override public ResourceReference parse(String rawReference) { ResourceReference reference = this.defaultResourceReferenceParser.parse(rawReference); if (reference.getType().equals(ResourceType.UNKNOWN)) { reference = this.untypedImageReferenceParser.parse(rawReference); } return reference; }  @Override ResourceReference parse(String rawReference); }
DefaultImageReferenceParser implements ResourceReferenceParser { @Override public ResourceReference parse(String rawReference) { ResourceReference reference = this.defaultResourceReferenceParser.parse(rawReference); if (reference.getType().equals(ResourceType.UNKNOWN)) { reference = this.untypedImageReferenceParser.parse(rawReference); } return reference; }  @Override ResourceReference parse(String rawReference);  }