@Test public void testLoadFromDefinitionWithDisplayNameElement() { URL definitionUrl = getClass().getResource("layerDefinitionWithDisplayName.xml"); LayerIdentifier result = LayerIdentifierFactory.createFromDefinition(definitionUrl); assertNotNull(result); assertEquals(definitionUrl.toExternalForm(), result.getLocation()); assertEquals("myName", result.getName()); }
public static LayerIdentifier createFromDefinition(URL definitionLocation) { if (definitionLocation == null) { return null; } String layerName = getNameFromDefinition(definitionLocation); if (isBlank(layerName)) { layerName = getNameFromUrlLocation(definitionLocation); } return new LayerIdentifierImpl(layerName, definitionLocation.toExternalForm()); }
LayerIdentifierFactory { public static LayerIdentifier createFromDefinition(URL definitionLocation) { if (definitionLocation == null) { return null; } String layerName = getNameFromDefinition(definitionLocation); if (isBlank(layerName)) { layerName = getNameFromUrlLocation(definitionLocation); } return new LayerIdentifierImpl(layerName, definitionLocation.toExternalForm()); } }
LayerIdentifierFactory { public static LayerIdentifier createFromDefinition(URL definitionLocation) { if (definitionLocation == null) { return null; } String layerName = getNameFromDefinition(definitionLocation); if (isBlank(layerName)) { layerName = getNameFromUrlLocation(definitionLocation); } return new LayerIdentifierImpl(layerName, definitionLocation.toExternalForm()); }  }
LayerIdentifierFactory { public static LayerIdentifier createFromDefinition(URL definitionLocation) { if (definitionLocation == null) { return null; } String layerName = getNameFromDefinition(definitionLocation); if (isBlank(layerName)) { layerName = getNameFromUrlLocation(definitionLocation); } return new LayerIdentifierImpl(layerName, definitionLocation.toExternalForm()); }  static List<LayerIdentifier> readFromPropertiesFile(String baseName); static LayerIdentifier createFromLayer(Layer layer); static LayerIdentifier createFromDefinition(URL definitionLocation); }
LayerIdentifierFactory { public static LayerIdentifier createFromDefinition(URL definitionLocation) { if (definitionLocation == null) { return null; } String layerName = getNameFromDefinition(definitionLocation); if (isBlank(layerName)) { layerName = getNameFromUrlLocation(definitionLocation); } return new LayerIdentifierImpl(layerName, definitionLocation.toExternalForm()); }  static List<LayerIdentifier> readFromPropertiesFile(String baseName); static LayerIdentifier createFromLayer(Layer layer); static LayerIdentifier createFromDefinition(URL definitionLocation);  }