|
Eclipse JDT Release 3.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jdt.core.dom.ASTNode
org.eclipse.jdt.core.dom.Expression
org.eclipse.jdt.core.dom.StringLiteral
public class StringLiteral
String literal nodes.
| Field Summary | |
|---|---|
static SimplePropertyDescriptor |
ESCAPED_VALUE_PROPERTY
The "escapedValue" structural property of this node type. |
| Method Summary | |
|---|---|
String |
getEscapedValue()
Returns the string value of this literal node to the given string literal token. |
String |
getLiteralValue()
Returns the value of this literal node. |
static List |
propertyDescriptors(int apiLevel)
Returns a list of structural property descriptors for this node type. |
void |
setEscapedValue(String token)
Sets the string value of this literal node to the given string literal token. |
void |
setLiteralValue(String value)
Sets the value of this literal node. |
| Methods inherited from class org.eclipse.jdt.core.dom.Expression |
|---|
resolveBoxing, resolveConstantExpressionValue, resolveTypeBinding, resolveUnboxing |
| Methods inherited from class org.eclipse.jdt.core.dom.ASTNode |
|---|
accept, copySubtree, copySubtrees, delete, equals, getAST, getFlags, getLength, getLocationInParent, getNodeType, getParent, getProperty, getRoot, getStartPosition, getStructuralProperty, nodeClassForType, properties, setFlags, setProperty, setSourceRange, setStructuralProperty, structuralPropertiesForType, subtreeBytes, subtreeMatch, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final SimplePropertyDescriptor ESCAPED_VALUE_PROPERTY
| Method Detail |
|---|
public static List propertyDescriptors(int apiLevel)
apiLevel - the API level; one of the
AST.JLS* constants
StructuralPropertyDescriptor)public String getEscapedValue()
public void setEscapedValue(String token)
"" setLiteral("\"\"")"hello world" setLiteral("\"hello world\"")"boo\nhoo" setLiteral("\"boo\\nhoo\"")
token - the string literal token, including enclosing double
quotes and embedded escapes
IllegalArgumentException - if the argument is incorrectpublic String getLiteralValue()
For example,
StringLiteral s;
s.setEscapedValue("\"hello\\nworld\"");
assert s.getLiteralValue().equals("hello\nworld");
Note that this is a convenience method that converts from the stored
string literal token returned by getEscapedLiteral.
IllegalArgumentException - if the literal value cannot be convertedpublic void setLiteralValue(String value)
For example,
StringLiteral s;
s.setLiteralValue("hello\nworld");
assert s.getEscapedValue("\"hello\\nworld\"");
assert s.getLiteralValue().equals("hello\nworld");
Note that this is a convenience method that converts to the stored
string literal token acceptable to setEscapedLiteral.
value - the string value without enclosing double quotes and
embedded escapes
IllegalArgumentException - if the argument is incorrect
|
Eclipse JDT Release 3.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||