@Override
	public AttributedString createAnnotatedString(AttributedString prototypeString, String[] text,
			Program program) {

		// if the text is not of adequate size, then show an error string
		if (text.length <= 1) {
			throw new AnnotationException(INVALID_SYMBOL_TEXT);
		}

		if (program == null) { // this can happen during merge operations
			return createUndecoratedString(prototypeString, text);
		}

		List<Symbol> symbols = CommentUtils.getSymbols(text[1], program);

		// check for a symbol of the given name first
		if (symbols.size() >= 1) {
			String symbolText = symbols.get(0).getName();
			return new AttributedString(symbolText, prototypeString.getColor(0),
				prototypeString.getFontMetrics(0), true, prototypeString.getColor(0));
		}

		return new AttributedString("No symbol: " + text[1], Messages.ERROR,
			prototypeString.getFontMetrics(0), false, null);
	}
An annotated string handler that handles annotations that begin with
{@link #SUPPORTED_ANNOTATIONS}.  This class expects one string following the annotation
text that is the address or a symbol name.  The display text will be that of the symbol that
is referred to by the address or symbol name.
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/SymbolAnnotatedStringHandler.java