RTEditor/src/main/java/com/onegravity/rteditor/effects/Effect.java
final public List<RTSpan<V>> getSpans(Spannable str, Selection selection, SpanCollectMode mode) {
        if (mSpanCollector == null) {
            // lazy initialize the SpanCollector
            Type[] types = ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments();
            Class<? extends RTSpan<V>> spanClazz = (Class<? extends RTSpan<V>>) types[types.length - 1];
            mSpanCollector = newSpanCollector(spanClazz);
        }

        return mSpanCollector.getSpans(str, selection, mode);
    }
final public List<RTSpan<V>> getSpans(Spannable str, Selection selection, SpanCollectMode mode) {
        if (mSpanCollector == null) {
            // lazy initialize the SpanCollector
            Type[] types = ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments();
            Class<? extends RTSpan<V>> spanClazz = (Class<? extends RTSpan<V>>) types[types.length - 1];
            mSpanCollector = newSpanCollector(spanClazz);
        }

        return mSpanCollector.getSpans(str, selection, mode);
    }
final public List < RTSpan < V > > getSpans ( Spannable str , Selection selection , SpanCollectMode mode ) { if ( mSpanCollector == null ) { // lazy initialize the SpanCollector Type [ ] types = ( ( ParameterizedType ) getClass ( ) . getGenericSuperclass ( ) ) . getActualTypeArguments ( ) ; Class < ? extends RTSpan < V > > spanClazz = ( Class < ? extends RTSpan < V > > ) types [ types . length - 1 ] ; mSpanCollector = newSpanCollector ( spanClazz ) ; } return mSpanCollector . getSpans ( str , selection , mode ) ; }
Equivalent to the Spanned.getSpans(int, int, Class<T>) method.
Return the markup objects (spans) attached to the specified slice of a Spannable.
The type of the spans is defined in the SpanCollector.

@param str The Spannable to search for spans.
@param selection The selection within the Spannable to search for spans.
@param mode details see SpanCollectMode.

@return the list of spans in this Spannable/Selection, never Null
Equivalent to the Spanned . getSpans ( int int Class<T > ) method . Return the markup objects ( spans ) attached to the specified slice of a Spannable . The type of the spans is defined in the SpanCollector .