@Test public void testResolve() { EntityReference reference = this.resolver.resolve("page", EntityType.DOCUMENT); Assert.assertEquals("page", reference.extractReference(EntityType.DOCUMENT).getName()); Assert.assertEquals("XWiki", reference.extractReference(EntityType.SPACE).getName()); Assert.assertNull(reference.extractReference(EntityType.WIKI)); }
@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);  }