Search in sources :

Example 1 with TextRegionAccessBuilder

use of org.eclipse.xtext.formatting2.regionaccess.TextRegionAccessBuilder in project xtext-core by eclipse.

the class Serializer method serializeToRegions.

public ITextRegionAccess serializeToRegions(EObject obj) {
    checkNotNull(obj, "obj must not be null.");
    ISerializationContext context = getIContext(obj);
    TextRegionAccessBuilder builder = textRegionBuilderProvider.get();
    ISerializationDiagnostic.Acceptor errors = ISerializationDiagnostic.EXCEPTION_THROWING_ACCEPTOR;
    serialize(context, obj, builder.forSequence(context, obj), errors);
    ITextRegionAccess regionAccess = builder.create();
    return regionAccess;
}
Also used : ITextRegionAccess(org.eclipse.xtext.formatting2.regionaccess.ITextRegionAccess) ISerializationDiagnostic(org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic) TextRegionAccessBuilder(org.eclipse.xtext.formatting2.regionaccess.TextRegionAccessBuilder) ISerializationContext(org.eclipse.xtext.serializer.ISerializationContext)

Aggregations

ITextRegionAccess (org.eclipse.xtext.formatting2.regionaccess.ITextRegionAccess)1 TextRegionAccessBuilder (org.eclipse.xtext.formatting2.regionaccess.TextRegionAccessBuilder)1 ISerializationContext (org.eclipse.xtext.serializer.ISerializationContext)1 ISerializationDiagnostic (org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic)1