@Override
    @SuppressWarnings("unchecked")
    protected <T> HasDelegate<T> tryWriteDelegateIdTo(Output output,
            int fieldNumber, Class<T> clazz) throws IOException
    {
        final HasDelegate<T> hd = (HasDelegate<T>) delegateMapping.get(clazz
                .getName());
        if (hd == null)
            return null;

        output.writeString(fieldNumber, clazz.getName(), false);

        return hd;
    }
Used by {@link RuntimeSchema#map(Class, Class)}.
protostuff-runtime/src/main/java/io/protostuff/runtime/DefaultIdStrategy.java