return attributes;
}
private <N, E extends N, T extends N> void handleBasicMutation(RichTextTokenizer tokenizer,
Nindo.Builder builder, ReadableDocument<N, E, T> doc, N splitContainer) {
Type currentType = tokenizer.getCurrentType();
switch (currentType) {
case TEXT:
if (tokenizer.getData() != null) {
builder.characters(PermittedCharacters.BLIP_TEXT.coerceString(tokenizer.getData()));
offset += tokenizer.getData().length();
}
break;
case STYLE_FONT_WEIGHT_START:
startAnnotation(builder, AnnotationConstants.STYLE_FONT_WEIGHT, tokenizer.getData());
break;
case STYLE_FONT_WEIGHT_END:
endAnnotation(builder, AnnotationConstants.STYLE_FONT_WEIGHT);
break;
case STYLE_FONT_STYLE_START:
startAnnotation(builder, AnnotationConstants.STYLE_FONT_STYLE, tokenizer.getData());
break;
case STYLE_FONT_STYLE_END:
endAnnotation(builder, AnnotationConstants.STYLE_FONT_STYLE);
break;
case STYLE_TEXT_DECORATION_START:
startAnnotation(builder, AnnotationConstants.STYLE_TEXT_DECORATION, tokenizer.getData());
break;
case STYLE_TEXT_DECORATION_END:
endAnnotation(builder, AnnotationConstants.STYLE_TEXT_DECORATION);
break;
case STYLE_COLOR_START:
startAnnotation(builder, AnnotationConstants.STYLE_COLOR, tokenizer.getData());
break;
case STYLE_COLOR_END:
endAnnotation(builder, AnnotationConstants.STYLE_COLOR);
break;
case STYLE_BG_COLOR_START:
startAnnotation(builder, AnnotationConstants.STYLE_BG_COLOR, tokenizer.getData());
break;
case STYLE_BG_COLOR_END:
endAnnotation(builder, AnnotationConstants.STYLE_BG_COLOR);
break;
case STYLE_FONT_FAMILY_START:
startAnnotation(builder, AnnotationConstants.STYLE_FONT_FAMILY, tokenizer.getData());
break;
case STYLE_FONT_FAMILY_END:
endAnnotation(builder, AnnotationConstants.STYLE_FONT_FAMILY);
break;
case LINK_START:
startAnnotation(builder, AnnotationConstants.LINK_MANUAL, tokenizer.getData());
break;
case LINK_END:
endAnnotation(builder, AnnotationConstants.LINK_MANUAL);
break;
case UNORDERED_LIST_START:
case ORDERED_LIST_START:
push(currentType);
break;
case UNORDERED_LIST_END:
case ORDERED_LIST_END:
pop();
break;
default:
throw new IllegalStateException("Unhandled token: " +
currentType.toString());
}
}