net.sourceforge.pmd.lang.ast.Node
, JavaNode
, TypeNode
, net.sourceforge.pmd.lang.symboltable.ScopedNode
public class ASTLiteral extends AbstractJavaTypeNode
parser
beginColumn, beginLine, childIndex, children, endColumn, endLine, firstToken, id, lastToken, parent
Constructor | Description |
---|---|
ASTLiteral(int id) |
|
ASTLiteral(JavaParser p,
int id) |
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getEscapedStringLiteral() |
Tries to reconstruct the original string literal.
|
double |
getValueAsDouble() |
|
float |
getValueAsFloat() |
|
int |
getValueAsInt() |
|
long |
getValueAsLong() |
|
boolean |
isCharLiteral() |
|
boolean |
isDoubleLiteral() |
Checks whether this literal describes a double.
|
boolean |
isFloatLiteral() |
|
boolean |
isIntLiteral() |
|
boolean |
isLongLiteral() |
Checks whether this literal is a long integer.
|
boolean |
isSingleCharacterStringLiteral() |
Returns true if this is a String literal with only one character.
|
boolean |
isStringLiteral() |
|
java.lang.Object |
jjtAccept(JavaParserVisitor visitor,
java.lang.Object data) |
Accept the visitor.
|
void |
setCharLiteral() |
|
void |
setFloatLiteral() |
|
void |
setIntLiteral() |
|
void |
setStringLiteral() |
childrenAccept, comment, comment, getScope, getXPathNodeName, jjtClose, jjtOpen, setScope
getType, getTypeDefinition, setType, setTypeDefinition
appendElement, findChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfType, getImage, getNthParent, getParentsOfType, getUserData, hasDecendantOfAnyType, hasDescendantMatchingXPath, hasDescendantOfAnyType, hasDescendantOfType, hasImageEqualTo, isFindBoundary, isSingleLine, jjtAddChild, jjtGetChild, jjtGetChildIndex, jjtGetFirstToken, jjtGetId, jjtGetLastToken, jjtGetNumChildren, jjtGetParent, jjtSetChildIndex, jjtSetFirstToken, jjtSetLastToken, jjtSetParent, remove, removeChildAtIndex, setDataFlowNode, setImage, setUserData, testingOnlySetBeginColumn, testingOnlySetBeginLine, testingOnlySetEndColumn, testingOnlySetEndLine, toString
findChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfType, getImage, getNthParent, getParentsOfType, getUserData, getXPathNodeName, hasDescendantMatchingXPath, hasDescendantOfType, hasImageEqualTo, isFindBoundary, jjtAddChild, jjtClose, jjtGetChild, jjtGetChildIndex, jjtGetId, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetChildIndex, jjtSetParent, remove, removeChildAtIndex, setDataFlowNode, setImage, setUserData
public ASTLiteral(int id)
public ASTLiteral(JavaParser p, int id)
public java.lang.Object jjtAccept(JavaParserVisitor visitor, java.lang.Object data)
jjtAccept
in interface JavaNode
jjtAccept
in class AbstractJavaNode
public void setIntLiteral()
public boolean isIntLiteral()
public boolean isLongLiteral()
true
if this literal is a longpublic void setFloatLiteral()
public boolean isFloatLiteral()
public boolean isDoubleLiteral()
true
if this literal is a double.public int getValueAsInt()
public long getValueAsLong()
public float getValueAsFloat()
public double getValueAsDouble()
public void setCharLiteral()
public boolean isCharLiteral()
public void setStringLiteral()
public boolean isStringLiteral()
public java.lang.String getEscapedStringLiteral()
public boolean isSingleCharacterStringLiteral()
Copyright © 2002–2018 PMD. All rights reserved.