@Test public void testResolveWhenNoPageReferenceSpecified() { try { this.resolver.resolve("", EntityType.DOCUMENT); Assert.fail("Should have thrown an exception here"); } catch (IllegalArgumentException expected) { Assert.assertEquals("A Reference to a page must be passed as a parameter when the string to resolve " + "doesn't specify a page", expected.getMessage()); } }
@Override public EntityReference resolve(String entityReferenceRepresentation, EntityType type, Object... parameters) { EntityReference explicitReference = new EntityReference("XWiki", EntityType.SPACE); if (parameters.length > 0 && (parameters[0] instanceof EntityReference)) { EntityReference extractedPageReference = ((EntityReference) parameters[0]).extractReference(EntityType.DOCUMENT); if (extractedPageReference != null) { explicitReference = new EntityReference(extractedPageReference.getName(), EntityType.DOCUMENT, explicitReference); } } return super.resolve(entityReferenceRepresentation, type, explicitReference); }
XClassRelativeStringEntityReferenceResolver extends AbstractStringEntityReferenceResolver { @Override public EntityReference resolve(String entityReferenceRepresentation, EntityType type, Object... parameters) { EntityReference explicitReference = new EntityReference("XWiki", EntityType.SPACE); if (parameters.length > 0 && (parameters[0] instanceof EntityReference)) { EntityReference extractedPageReference = ((EntityReference) parameters[0]).extractReference(EntityType.DOCUMENT); if (extractedPageReference != null) { explicitReference = new EntityReference(extractedPageReference.getName(), EntityType.DOCUMENT, explicitReference); } } return super.resolve(entityReferenceRepresentation, type, explicitReference); } }
XClassRelativeStringEntityReferenceResolver extends AbstractStringEntityReferenceResolver { @Override public EntityReference resolve(String entityReferenceRepresentation, EntityType type, Object... parameters) { EntityReference explicitReference = new EntityReference("XWiki", EntityType.SPACE); if (parameters.length > 0 && (parameters[0] instanceof EntityReference)) { EntityReference extractedPageReference = ((EntityReference) parameters[0]).extractReference(EntityType.DOCUMENT); if (extractedPageReference != null) { explicitReference = new EntityReference(extractedPageReference.getName(), EntityType.DOCUMENT, explicitReference); } } return super.resolve(entityReferenceRepresentation, type, explicitReference); }  }
XClassRelativeStringEntityReferenceResolver extends AbstractStringEntityReferenceResolver { @Override public EntityReference resolve(String entityReferenceRepresentation, EntityType type, Object... parameters) { EntityReference explicitReference = new EntityReference("XWiki", EntityType.SPACE); if (parameters.length > 0 && (parameters[0] instanceof EntityReference)) { EntityReference extractedPageReference = ((EntityReference) parameters[0]).extractReference(EntityType.DOCUMENT); if (extractedPageReference != null) { explicitReference = new EntityReference(extractedPageReference.getName(), EntityType.DOCUMENT, explicitReference); } } return super.resolve(entityReferenceRepresentation, type, explicitReference); }  @Override EntityReference resolve(String entityReferenceRepresentation, EntityType type, Object... parameters); }
XClassRelativeStringEntityReferenceResolver extends AbstractStringEntityReferenceResolver { @Override public EntityReference resolve(String entityReferenceRepresentation, EntityType type, Object... parameters) { EntityReference explicitReference = new EntityReference("XWiki", EntityType.SPACE); if (parameters.length > 0 && (parameters[0] instanceof EntityReference)) { EntityReference extractedPageReference = ((EntityReference) parameters[0]).extractReference(EntityType.DOCUMENT); if (extractedPageReference != null) { explicitReference = new EntityReference(extractedPageReference.getName(), EntityType.DOCUMENT, explicitReference); } } return super.resolve(entityReferenceRepresentation, type, explicitReference); }  @Override EntityReference resolve(String entityReferenceRepresentation, EntityType type, Object... parameters);  }