@Test public void testSerializeSpaceReferenceWithChild() { EntityReference reference = this.serializer.serialize(new SpaceReference("space", new WikiReference("wiki"))); Assert.assertEquals(EntityType.SPACE, reference.getType()); Assert.assertEquals("space", reference.getName()); Assert.assertNull(reference.getParent()); }
@Override public EntityReference serialize(EntityReference reference, Object... parameters) { EntityReference newReference = null; EntityReference parent; for (EntityReference currentReference = reference; currentReference != null; currentReference = currentReference.getParent()) { if (currentReference.getType() == EntityType.WIKI) { return newReference; } parent = new EntityReference(currentReference.getName(), currentReference.getType()); if (newReference != null) { newReference = newReference.appendParent(parent); } else { newReference = parent; } } return newReference; }
DeprecatedLocalReferenceEntityReferenceSerializer implements EntityReferenceSerializer { @Override public EntityReference serialize(EntityReference reference, Object... parameters) { EntityReference newReference = null; EntityReference parent; for (EntityReference currentReference = reference; currentReference != null; currentReference = currentReference.getParent()) { if (currentReference.getType() == EntityType.WIKI) { return newReference; } parent = new EntityReference(currentReference.getName(), currentReference.getType()); if (newReference != null) { newReference = newReference.appendParent(parent); } else { newReference = parent; } } return newReference; } }
DeprecatedLocalReferenceEntityReferenceSerializer implements EntityReferenceSerializer { @Override public EntityReference serialize(EntityReference reference, Object... parameters) { EntityReference newReference = null; EntityReference parent; for (EntityReference currentReference = reference; currentReference != null; currentReference = currentReference.getParent()) { if (currentReference.getType() == EntityType.WIKI) { return newReference; } parent = new EntityReference(currentReference.getName(), currentReference.getType()); if (newReference != null) { newReference = newReference.appendParent(parent); } else { newReference = parent; } } return newReference; }  }
DeprecatedLocalReferenceEntityReferenceSerializer implements EntityReferenceSerializer { @Override public EntityReference serialize(EntityReference reference, Object... parameters) { EntityReference newReference = null; EntityReference parent; for (EntityReference currentReference = reference; currentReference != null; currentReference = currentReference.getParent()) { if (currentReference.getType() == EntityType.WIKI) { return newReference; } parent = new EntityReference(currentReference.getName(), currentReference.getType()); if (newReference != null) { newReference = newReference.appendParent(parent); } else { newReference = parent; } } return newReference; }  @Override EntityReference serialize(EntityReference reference, Object... parameters); }
DeprecatedLocalReferenceEntityReferenceSerializer implements EntityReferenceSerializer { @Override public EntityReference serialize(EntityReference reference, Object... parameters) { EntityReference newReference = null; EntityReference parent; for (EntityReference currentReference = reference; currentReference != null; currentReference = currentReference.getParent()) { if (currentReference.getType() == EntityType.WIKI) { return newReference; } parent = new EntityReference(currentReference.getName(), currentReference.getType()); if (newReference != null) { newReference = newReference.appendParent(parent); } else { newReference = parent; } } return newReference; }  @Override EntityReference serialize(EntityReference reference, Object... parameters);  }