public class ThrowStatement extends Statement
ThrowStatement:
throw Expression ;
ASTNode.NodeList| Modifier and Type | Field and Description |
|---|---|
static ChildPropertyDescriptor |
EXPRESSION_PROPERTY
The "expression" structural property of this node type.
|
ANNOTATION_TYPE_DECLARATION, ANNOTATION_TYPE_MEMBER_DECLARATION, ANONYMOUS_CLASS_DECLARATION, ARRAY_ACCESS, ARRAY_CREATION, ARRAY_INITIALIZER, ARRAY_TYPE, ASSERT_STATEMENT, ASSIGNMENT, ast, BASE_NODE_SIZE, BLOCK, BLOCK_COMMENT, BOOLEAN_LITERAL, BREAK_STATEMENT, CAST_EXPRESSION, CATCH_CLAUSE, CHARACTER_LITERAL, CLASS_INSTANCE_CREATION, COMPILATION_UNIT, CONDITIONAL_EXPRESSION, CONSTRUCTOR_INVOCATION, CONTINUE_STATEMENT, CYCLE_RISK, DO_STATEMENT, EMPTY_STATEMENT, ENHANCED_FOR_STATEMENT, ENUM_CONSTANT_DECLARATION, ENUM_DECLARATION, EXPRESSION_STATEMENT, FIELD_ACCESS, FIELD_DECLARATION, FOR_STATEMENT, HEADERS, IF_STATEMENT, IMPORT_DECLARATION, INFIX_EXPRESSION, INITIALIZER, INSTANCEOF_EXPRESSION, JAVADOC, LABELED_STATEMENT, LINE_COMMENT, MALFORMED, MANDATORY, MARKER_ANNOTATION, MEMBER_REF, MEMBER_VALUE_PAIR, METHOD_DECLARATION, METHOD_INVOCATION, METHOD_REF, METHOD_REF_PARAMETER, MODIFIER, NO_CYCLE_RISK, NORMAL_ANNOTATION, NULL_LITERAL, NUMBER_LITERAL, OPTIONAL, ORIGINAL, PACKAGE_DECLARATION, PARAMETERIZED_TYPE, PARENTHESIZED_EXPRESSION, POSTFIX_EXPRESSION, PREFIX_EXPRESSION, PRIMITIVE_TYPE, PROTECT, QUALIFIED_NAME, QUALIFIED_TYPE, RECOVERED, RETURN_STATEMENT, SIMPLE_NAME, SIMPLE_TYPE, SINGLE_MEMBER_ANNOTATION, SINGLE_VARIABLE_DECLARATION, STRING_LITERAL, SUPER_CONSTRUCTOR_INVOCATION, SUPER_FIELD_ACCESS, SUPER_METHOD_INVOCATION, SWITCH_CASE, SWITCH_STATEMENT, SYNCHRONIZED_STATEMENT, TAG_ELEMENT, TEXT_ELEMENT, THIS_EXPRESSION, THROW_STATEMENT, TRY_STATEMENT, TYPE_DECLARATION, TYPE_DECLARATION_STATEMENT, TYPE_LITERAL, TYPE_PARAMETER, typeAndFlags, VARIABLE_DECLARATION_EXPRESSION, VARIABLE_DECLARATION_FRAGMENT, VARIABLE_DECLARATION_STATEMENT, WHILE_STATEMENT, WILDCARD_TYPE| Constructor and Description |
|---|
ThrowStatement(AST ast)
Creates a new unparented throw statement node owned by the given
AST.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
accept0(ASTVisitor visitor)
Accepts the given visitor on a type-specific visit of the current node.
|
(package private) ASTNode |
clone0(AST target)
Returns a deep copy of the subtree of AST nodes rooted at this node.
|
Expression |
getExpression()
Returns the expression of this throw statement.
|
(package private) int |
getNodeType0()
Returns an integer value identifying the type of this concrete AST node.
|
(package private) ASTNode |
internalGetSetChildProperty(ChildPropertyDescriptor property,
boolean get,
ASTNode child)
Sets the child value of the given property for this node.
|
(package private) List |
internalStructuralPropertiesForType(int apiLevel)
Returns a list of property descriptors for this node type.
|
(package private) int |
memSize()
Returns an estimate of the memory footprint of this node in bytes.
|
static List |
propertyDescriptors(int apiLevel)
Returns a list of structural property descriptors for this node type.
|
void |
setExpression(Expression expression)
Sets the expression of this throw statement.
|
(package private) boolean |
subtreeMatch0(ASTMatcher matcher,
Object other)
Returns whether the subtree rooted at the given node matches the
given other object as decided by the given matcher.
|
(package private) int |
treeSize()
Returns an estimate of the memory footprint in bytes of the entire
subtree rooted at this node.
|
copyLeadingComment, getLeadingComment, setLeadingCommentaccept, acceptChild, acceptChildren, addProperty, appendDebugString, appendPrintString, checkModifiable, checkNewChild, clone, copySubtree, copySubtrees, createPropertyList, delete, equals, getAST, getFlags, getLength, getLocationInParent, getNodeType, getParent, getProperty, getRoot, getStartPosition, getStructuralProperty, hashCode, internalGetChildListProperty, internalGetSetBooleanProperty, internalGetSetIntProperty, internalGetSetObjectProperty, nodeClassForType, postLazyInit, postReplaceChild, postValueChange, preLazyInit, preReplaceChild, preValueChange, properties, reapPropertyList, setFlags, setParent, setProperty, setSourceRange, setStructuralProperty, standardToString, stringSize, structuralPropertiesForType, subtreeBytes, subtreeMatch, supportedOnlyIn2, toString, unsupportedIn2public static final ChildPropertyDescriptor EXPRESSION_PROPERTY
ThrowStatement(AST ast)
N.B. This constructor is package-private.
ast - the AST that is to own this nodepublic static List propertyDescriptors(int apiLevel)
apiLevel - the API level; one of the
AST.JLS* constantsStructuralPropertyDescriptor)final List internalStructuralPropertiesForType(int apiLevel)
ASTNodeN.B. This method is package-private, so that the implementations of this method in each of the concrete AST node types do not clutter up the API doc.
internalStructuralPropertiesForType in class ASTNodeapiLevel - the API level; one of the AST.JLS* constantsStructuralPropertyDescriptor)final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child)
ASTNodeinternalGetSetChildProperty in class ASTNodeproperty - the propertyget - true for a get operation, and
false for a set operationchild - the new child value, or null if none;
always null for get operationsnull if none; always returns
null for set operationsfinal int getNodeType0()
ASTNodeThis internal method is implemented in each of the concrete node subclasses.
getNodeType0 in class ASTNodeASTNode clone0(AST target)
ASTNodeThis method must be implemented in subclasses.
This method does not report pre- and post-clone events.
All callers should instead call clone(AST)
to ensure that pre- and post-clone events are reported.
N.B. This method is package-private, so that the implementations of this method in each of the concrete AST node types do not clutter up the API doc.
final boolean subtreeMatch0(ASTMatcher matcher, Object other)
ASTNodeThis internal method is implemented in each of the concrete node subclasses.
subtreeMatch0 in class ASTNodematcher - the matcherother - the other object, or nulltrue if the subtree matches, or
false if they do not matchvoid accept0(ASTVisitor visitor)
ASTNodeGeneral template for implementation on each concrete ASTNode class:
boolean visitChildren = visitor.visit(this);
if (visitChildren) {
// visit children in normal left to right reading order
acceptChild(visitor, getProperty1());
acceptChildren(visitor, rawListProperty);
acceptChild(visitor, getProperty2());
}
visitor.endVisit(this);
Note that the caller (accept) take cares of invoking
visitor.preVisit(this) and visitor.postVisit(this).
public Expression getExpression()
public void setExpression(Expression expression)
expression - the new expression nodeIllegalArgumentException - if:
int memSize()
ASTNodeint treeSize()
ASTNodeN.B. This method is package-private, so that the implementations of this method in each of the concrete AST node types do not clutter up the API doc.