Package org.sonar.python.tree
Class StringElementImpl
- java.lang.Object
-
- org.sonar.python.tree.PyTree
-
- org.sonar.python.tree.StringElementImpl
-
- All Implemented Interfaces:
StringElement,Tree
public class StringElementImpl extends PyTree implements StringElement
-
-
Field Summary
-
Fields inherited from class org.sonar.python.tree.PyTree
firstToken, lastToken
-
-
Constructor Summary
Constructors Constructor Description StringElementImpl(Token token)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(TreeVisitor visitor)List<Tree>computeChildren()intcontentStartIndex()TokenfirstToken()List<FormattedExpression>formattedExpressions()Tree.KindgetKind()List<Expression>interpolatedExpressions()booleanisInterpolated()booleanisTripleQuoted()TokenlastToken()Stringprefix()StringtrimmedQuotesValue()Stringvalue()
-
-
-
Constructor Detail
-
StringElementImpl
public StringElementImpl(Token token)
-
-
Method Detail
-
firstToken
public Token firstToken()
- Specified by:
firstTokenin interfaceTree- Overrides:
firstTokenin classPyTree
-
lastToken
public Token lastToken()
-
accept
public void accept(TreeVisitor visitor)
-
value
public String value()
- Specified by:
valuein interfaceStringElement- Returns:
- the token value of this literal.
-
trimmedQuotesValue
public String trimmedQuotesValue()
- Specified by:
trimmedQuotesValuein interfaceStringElement
-
prefix
public String prefix()
- Specified by:
prefixin interfaceStringElement
-
isTripleQuoted
public boolean isTripleQuoted()
- Specified by:
isTripleQuotedin interfaceStringElement
-
isInterpolated
public boolean isInterpolated()
- Specified by:
isInterpolatedin interfaceStringElement
-
interpolatedExpressions
public List<Expression> interpolatedExpressions()
- Specified by:
interpolatedExpressionsin interfaceStringElement
-
formattedExpressions
public List<FormattedExpression> formattedExpressions()
- Specified by:
formattedExpressionsin interfaceStringElement- Returns:
- Formatted expressions of an f-string. Empty list if the string element is not an f-string.
-
contentStartIndex
public int contentStartIndex()
-
-