public class CtIfImpl extends CtStatementImpl implements CtIf
ERROR_MESSAGE_TO_STRING, LOGGER, parent
Constructor and Description |
---|
CtIfImpl() |
Modifier and Type | Method and Description |
---|---|
void |
accept(CtVisitor visitor)
Accepts a visitor
|
CtIf |
clone()
Clone the element which calls this method in a new object.
|
CtExpression<Boolean> |
getCondition()
Gets the boolean expression that represents the
if 's
condition. |
<S extends CtStatement> |
getElseStatement()
Gets the statement executed when the condition is false.
|
CtCodeElement |
getSubstitution(CtType<?> targetType) |
<S extends CtStatement> |
getThenStatement()
Gets the statement executed when the condition is true.
|
Void |
S()
Gets the type of the template parameter.
|
<T extends CtIf> |
setCondition(CtExpression<Boolean> condition)
Sets the boolean expression that represents the
if 's
condition. |
<T extends CtIf> |
setElseStatement(CtStatement elseStatement)
Sets the statement executed when the condition is false.
|
<T extends CtIf> |
setThenStatement(CtStatement thenStatement)
Sets the statement executed when the condition is true.
|
getLabel, insertAfter, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertBefore, setLabel
partiallyEvaluate
addAnnotation, addComment, asIterable, delete, descendantIterator, emptyList, emptySet, equals, filterChildren, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getFactory, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hashCode, hasParent, isImplicit, isParentInitialized, map, map, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setFactory, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, unmodifiableList, updateAllParentsBelow
finalize, getClass, notify, notifyAll, wait, wait, wait
getLabel, insertAfter, insertAfter, insertBefore, insertBefore, setLabel
partiallyEvaluate
addAnnotation, addComment, asIterable, delete, descendantIterator, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getMetadata, getMetadataKeys, getParent, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hasParent, isImplicit, isParentInitialized, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setImplicit, setParent, setPosition, setPositions, setValueByRole, updateAllParentsBelow
getFactory, setFactory
filterChildren, map, map
getOriginalSourceFragment
public void accept(CtVisitor visitor)
CtVisitable
accept
in interface CtVisitable
public CtExpression<Boolean> getCondition()
CtIf
if
's
condition.getCondition
in interface CtIf
public <S extends CtStatement> S getElseStatement()
CtIf
getElseStatement
in interface CtIf
public <S extends CtStatement> S getThenStatement()
CtIf
getThenStatement
in interface CtIf
public <T extends CtIf> T setCondition(CtExpression<Boolean> condition)
CtIf
if
's
condition.setCondition
in interface CtIf
public <T extends CtIf> T setElseStatement(CtStatement elseStatement)
CtIf
setElseStatement
in interface CtIf
public <T extends CtIf> T setThenStatement(CtStatement thenStatement)
CtIf
setThenStatement
in interface CtIf
public CtIf clone()
CtElement
Refactoring.copyType(CtType)
and Refactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.clone
in interface CtCodeElement
clone
in interface CtIf
clone
in interface CtStatement
clone
in interface CtElement
clone
in class CtStatementImpl
public Void S()
TemplateParameter
null
reference) but is used as a
marker in a template code.S
in interface TemplateParameter<Void>
public CtCodeElement getSubstitution(CtType<?> targetType)
Copyright © 2007–2019 Inria. All rights reserved.