/** * Parse a {@link DataMap} to obtain a {@link Name}. * * Return an empty {@link Name} (see {@link Name#isEmpty()}) if * a name cannot be obtained from the {@link DataMap}. * * @param map to parse. * @param nameKey is the key used to find the name in the map. * @param currentNamespace is the current namespace. * @return a {@link Name} parsed from the {@link DataMap}. */ protected Name getNameFromDataMap(DataMap map, String nameKey, String currentNamespace) { String nameString = getString(map, nameKey, true); String namespaceString = getString(map, NAMESPACE_KEY, false); Name name = getName(nameString, namespaceString, currentNamespace); // associate a name with a location, // this allows error messages such re-definition of a name to include a location. addToDataLocationMap(name, lookupDataLocation(nameString)); return name; }