Package software.amazon.smithy.syntax
Class Formatter
- java.lang.Object
- 
- software.amazon.smithy.syntax.Formatter
 
- 
 public final class Formatter extends java.lang.ObjectFormats valid Smithy IDL models.This formatter will by default sort use statements, remove unused use statements, and fix documentation comments that should be normal comments. 
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringformat(TokenTree root)Formats the given token tree, wrapping lines at 120 characters.static java.lang.Stringformat(TokenTree root, int maxWidth)Formats the given token tree.
 
- 
- 
- 
Method Detail- 
formatpublic static java.lang.String format(TokenTree root) Formats the given token tree, wrapping lines at 120 characters.- Parameters:
- root- Root- TreeType.IDLtree node to format.
- Returns:
- Returns the formatted model as a string.
- Throws:
- ModelSyntaxException- if the model contains errors.
 
 - 
formatpublic static java.lang.String format(TokenTree root, int maxWidth) Formats the given token tree.- Parameters:
- root- Root- TreeType.IDLtree node to format.
- maxWidth- Maximum line width.
- Returns:
- Returns the formatted model as a string.
- Throws:
- ModelSyntaxException- if the model contains errors.
 
 
- 
 
-