@Override
	public boolean isValid() {

		if (isValid) {
			return true;
		}

		if (!super.isValid()) {
			return false;
		}

		if (spaceNameMap.isEmpty()) {
			try {
				validateDefaultSpaceMap();
			}
			catch (IncompatibleLanguageException e) {
				log.error("Bad translation spec (" + e.getMessage() + "): " + this);
				return false;
			}
		}
		else {

			AddressFactory oldFactory = getOldLanguage().getAddressFactory();
			AddressFactory newFactory = getNewLanguage().getAddressFactory();

			StringBuffer errBuf = new StringBuffer();
			ArrayList<AddressSpace> oldSpaces =
				new ArrayList<AddressSpace>(Arrays.asList(oldFactory.getPhysicalSpaces()));
			for (String name : spaceNameMap.keySet()) {
				AddressSpace space = oldFactory.getAddressSpace(name);
				oldSpaces.remove(space);
				if (space == null) {
					errBuf.append("  Mapped address space not found (from): " + name + "\r\n");
					continue;
				}
				String newName = spaceNameMap.get(name);
				if (newName == null) {
					if (oldFactory.getDefaultAddressSpace() == space) {
						errBuf.append("  Default space must be mapped: " + name + "\r\n");
					}
					continue;
				}
				AddressSpace newSpace = newFactory.getAddressSpace(newName);
				if (newSpace == null) {
					errBuf.append("  Mapped address space not found (to): " + name + "\r\n");
					continue;
				}
			}

			if (!oldSpaces.isEmpty()) {
				errBuf.append("  Failed to map old address spaces: ");
				for (AddressSpace space : oldSpaces) {
					errBuf.append(space.getName());
					errBuf.append(" ");
				}
				errBuf.append("\r\n");
			}
			if (errBuf.length() != 0) {
				log.error("Bad translation spec (details follow): " + this);
				log.error(errBuf.toString());
				return false;
			}
		}

		isValid = true;
		return true;
	}
<code>SimpleLanguageTranslator</code> provides a simple translator which
derives its mappings from an XML translation specification file.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/util/SimpleLanguageTranslator.java