Klasse Token
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.formatter.Token
Stores a token's type, position and all its properties like surrounding whitespace, wrapping behavior and so on.
-
Verschachtelte Klassen - Übersicht
-
Feldübersicht
Modifizierer und TypFeldBeschreibungfinal int
Position in source of the last character (this position is included in the token).final int
Position in source of the first character.final int
Type of this token. -
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
void
void
void
void
Removes space after this tokenvoid
Removes space before this tokenint
static Token
fromCurrent
(Scanner scanner, int currentToken) int
getAlign()
int
int
int
int
boolean
void
indent()
Increases this token's indentation by one positionboolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
putLineBreaksAfter
(int lineBreaks) void
putLineBreaksBefore
(int lineBreaks) void
setAlign
(int align) void
setEmptyLineIndentAdjustment
(int adjustment) void
setIndent
(int indent) void
setInternalStructure
(List<Token> internalStructure) void
void
void
setPreserveLineBreaksAfter
(boolean preserveLineBreaksAfter) void
setPreserveLineBreaksBefore
(boolean preserveLineBreaksBefore) void
setToEscape
(boolean shouldEscape) void
setWrapped
(boolean wrapped) Can be used to temporarily force preceding line break without losing the original number of line breaks.void
setWrapPolicy
(Token.WrapPolicy wrapPolicy) void
Adds space after this tokenvoid
Adds space before this tokentoString()
void
unindent()
Decreses this token's indentation by one position
-
Felddetails
-
originalStart
public final int originalStartPosition in source of the first character. -
originalEnd
public final int originalEndPosition in source of the last character (this position is included in the token). -
tokenType
public final int tokenTypeType of this token. SeeTerminalTokens
for constants definition.
-
-
Konstruktordetails
-
Token
public Token(int sourceStart, int sourceEnd, int tokenType) -
Token
-
Token
-
-
Methodendetails
-
fromCurrent
-
spaceBefore
public void spaceBefore()Adds space before this token -
clearSpaceBefore
public void clearSpaceBefore()Removes space before this token -
isSpaceBefore
public boolean isSpaceBefore() -
spaceAfter
public void spaceAfter()Adds space after this token -
clearSpaceAfter
public void clearSpaceAfter()Removes space after this token -
isSpaceAfter
public boolean isSpaceAfter() -
breakBefore
public void breakBefore() -
putLineBreaksBefore
public void putLineBreaksBefore(int lineBreaks) -
getLineBreaksBefore
public int getLineBreaksBefore() -
setWrapped
public void setWrapped(boolean wrapped) Can be used to temporarily force preceding line break without losing the original number of line breaks. -
clearLineBreaksBefore
public void clearLineBreaksBefore() -
breakAfter
public void breakAfter() -
putLineBreaksAfter
public void putLineBreaksAfter(int lineBreaks) -
getLineBreaksAfter
public int getLineBreaksAfter() -
clearLineBreaksAfter
public void clearLineBreaksAfter() -
setPreserveLineBreaksBefore
public void setPreserveLineBreaksBefore(boolean preserveLineBreaksBefore) -
isPreserveLineBreaksBefore
public boolean isPreserveLineBreaksBefore() -
setPreserveLineBreaksAfter
public void setPreserveLineBreaksAfter(boolean preserveLineBreaksAfter) -
isPreserveLineBreaksAfter
public boolean isPreserveLineBreaksAfter() -
indent
public void indent()Increases this token's indentation by one position -
unindent
public void unindent()Decreses this token's indentation by one position -
setIndent
public void setIndent(int indent) -
getIndent
public int getIndent() -
setEmptyLineIndentAdjustment
public void setEmptyLineIndentAdjustment(int adjustment) -
getEmptyLineIndentAdjustment
public int getEmptyLineIndentAdjustment() -
setAlign
public void setAlign(int align) -
getAlign
public int getAlign() -
setToEscape
public void setToEscape(boolean shouldEscape) -
isToEscape
public boolean isToEscape() -
setNextLineOnWrap
public void setNextLineOnWrap() -
isNextLineOnWrap
public boolean isNextLineOnWrap() -
setWrapPolicy
-
getWrapPolicy
-
isWrappable
public boolean isWrappable() -
setNLSTag
-
hasNLSTag
public boolean hasNLSTag() -
getNLSTag
-
setInternalStructure
-
getInternalStructure
-
isComment
public boolean isComment() -
toString
-
countChars
public int countChars() -
toString
-