Klasse ASTRewriteFormatter
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interfacestatic classstatic classstatic interface -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final ASTRewriteFormatter.Prefixstatic final ASTRewriteFormatter.Prefixstatic final ASTRewriteFormatter.Prefix -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungASTRewriteFormatter(NodeInfoStore placeholders, RewriteEventStore eventStore, Map options, String lineDelimiter) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungchangeIndent(String code, int codeIndentLevel, String newIndent) intcomputeIndentUnits(String line) createIndentString(int indentationUnits) static StringevaluateFormatterEdit(String string, org.eclipse.text.edits.TextEdit edit, org.eclipse.jface.text.Position[] positions) Evaluates the edit on the given string.org.eclipse.text.edits.TextEditformatString(int kind, String string, int offset, int length, int indentationLevel) getFormattedResult(ASTNode node, int initialIndentationLevel, Collection resultingMarkers) Returns the string accumulated in the visit formatted using the default formatter.getIndentString(String currentLine) intint
-
Felddetails
-
NONE
-
SPACE
-
ASSERT_COMMENT
-
VAR_INITIALIZER
-
METHOD_BODY
-
FINALLY_BLOCK
-
CATCH_BLOCK
-
ANNOT_MEMBER_DEFAULT
-
ENUM_BODY_START
-
ENUM_BODY_END
-
WILDCARD_EXTENDS
-
WILDCARD_SUPER
-
FIRST_ENUM_CONST
-
ANNOTATION_SEPARATION
-
PARAM_ANNOTATION_SEPARATION
-
LOCAL_ANNOTATION_SEPARATION
-
TYPE_ANNOTATION_SEPARATION
-
VARARGS
-
TRY_RESOURCES
-
TRY_RESOURCES_PAREN
-
IF_BLOCK_WITH_ELSE
-
IF_BLOCK_NO_ELSE
-
ELSE_AFTER_STATEMENT
-
ELSE_AFTER_BLOCK
-
CASE_SEPARATION
-
FOR_BLOCK
-
WHILE_BLOCK
-
DO_BLOCK
-
-
Konstruktordetails
-
ASTRewriteFormatter
public ASTRewriteFormatter(NodeInfoStore placeholders, RewriteEventStore eventStore, Map options, String lineDelimiter)
-
-
Methodendetails
-
getPlaceholders
-
getEventStore
-
getTabWidth
public int getTabWidth() -
getIndentWidth
public int getIndentWidth() -
getLineDelimiter
-
getFormattedResult
public String getFormattedResult(ASTNode node, int initialIndentationLevel, Collection resultingMarkers) Returns the string accumulated in the visit formatted using the default formatter. Updates the existing node's positions.- Parameter:
node- The node to flatten.initialIndentationLevel- The initial indentation level.resultingMarkers- Resulting the updated NodeMarkers.- Gibt zurück:
- Returns the serialized and formatted code.
-
createIndentString
-
getIndentString
-
changeIndent
-
computeIndentUnits
-
evaluateFormatterEdit
public static String evaluateFormatterEdit(String string, org.eclipse.text.edits.TextEdit edit, org.eclipse.jface.text.Position[] positions) Evaluates the edit on the given string.- Parameter:
string- The string to formatedit- The edit resulted from the code formatterpositions- Positions to update ornull.- Gibt zurück:
- The formatted string
- Löst aus:
IllegalArgumentException- If the positions are not inside the string, a IllegalArgumentException is thrown.
-
formatString
public org.eclipse.text.edits.TextEdit formatString(int kind, String string, int offset, int length, int indentationLevel)
-