io.sarl.lang.formatting2
Class FormatterFacade
class FormatterFacade
extends java.lang.Object
Provide a facade for the SARL formatter.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Constructor Summary
Constructor and description
new
Action Summary
Modifier and type Action and description
java.lang.String format(String)
Format the given code.
void format(XtextResource)
Format the code in the given resource.
java.lang.String format(String,ResourceSet)
Format the given code.
void formatRegion(XtextResource,int,int)
Format the code in the given region.
protected java.lang.String formatResource(XtextResource)
Format the code in the given resource.
java.lang.String formatResourceRegion(XtextResource,int,int)
Format the code in the given region.
Constructor Details
new
new
Action Details
format(String)
def format(String) : java.lang.String
Format the given code.
Parameters:
sarlCode - the code to format.
Returns:
the code to format.
format(XtextResource)
def format(XtextResource)
Format the code in the given resource.
Parameters:
resource - the resource of the code to format.
format(String,ResourceSet)
def format(String,ResourceSet) : java.lang.String
Format the given code.
Parameters:
sarlCode - the code to format.
resourceSet - the resource set that sohuld contains the code. This resource set may be used for resolving types by the underlying code.
Returns:
the code to format.
formatRegion(XtextResource,int,int)
def formatRegion(XtextResource,int,int)
Format the code in the given region.
Parameters:
resource - the resource to format.
offset - the offset of the text to format.
length - the length of the text.
formatResource(XtextResource)
protected def formatResource(XtextResource) : java.lang.String
Format the code in the given resource.

This function does not change the resource content.
Parameters:
resource - the resource of the code to format.
Returns:
the result of the formatting.
formatResourceRegion(XtextResource,int,int)
def formatResourceRegion(XtextResource,int,int) : java.lang.String
Format the code in the given region.

This function does not change the resource content.
Parameters:
resource - the resource to format.
offset - the offset of the text to format.
length - the length of the text.
Returns:
the result of the formatting.