reflectWith

open override fun reflectWith(reflector: AttributeReflector)

This method is for introspection of attributes, it should simply add the key/values this attribute holds to the given AttributeReflector.

Implementations look like this (e.g. for a combined attribute implementation):

public void reflectWith(AttributeReflector reflector) {
reflector.reflect(CharTermAttribute.class, "term", term());
reflector.reflect(PositionIncrementAttribute.class, "positionIncrement", getPositionIncrement());
}
*

If you implement this method, make sure that for each invocation, the same set of [ ] interfaces and keys are passed to AttributeReflector.reflect in the same order, but possibly different values. So don't automatically exclude e.g. null properties!

See also

.reflectAsString