Codota Logo
CtLiteral.getParent
Code IndexAdd Codota to your IDE (free)

How to use
getParent
method
in
spoon.reflect.code.CtLiteral

Best Java code snippets using spoon.reflect.code.CtLiteral.getParent (Showing top 6 results out of 315)

  • Common ways to obtain CtLiteral
private void myMethod () {
CtLiteral c =
  • Codota IconCtLiteral ctLiteral;Object value;ctLiteral.setValue(value)
  • Smart code suggestions by Codota
}
origin: STAMP-project/dspot

public static boolean isCase(CtLiteral literal) {
  return literal.getParent(CtCase.class) != null;
}
origin: STAMP-project/dspot

  @Override
  public boolean matches(CtLiteral literal) {
    return literal.getParent(CtAnnotation.class) == null && super.matches(literal);
  }
}
origin: SpoonLabs/nopol

@Override
public boolean isToBeProcessed(CtLiteral candidate) {
  CtMethod parent = candidate.getParent(CtMethod.class);
  Object value = candidate.getValue();
  if (parent == null) {
    return false;
  } else if (value instanceof Boolean || value == null) {
    return false;
  }
  return (this.buggyMethod == null || parent.getSimpleName().equals(this.buggyMethod)) &&
      Number.class.isAssignableFrom(value.getClass());
}
origin: STAMP-project/dspot

try {
  Class<?> clazzOfLiteral = null;
  if ((literal.getParent() instanceof CtInvocation &&
      TestFramework.get().isAssert((CtInvocation) literal.getParent()))
      || isConcatenationOfLiteral(literal)
      || literal.getParent(CtAnnotation.class) != null) {
    return false;
  } else if (literal.getValue() == null) {
    if (literal.getParent() instanceof CtInvocation<?>) {
      final CtInvocation<?> parent = (CtInvocation<?>) literal.getParent();
      clazzOfLiteral = parent.getExecutable()
          .getDeclaration()
          .getType()
    } else if (literal.getParent() instanceof CtAssignment) {
      clazzOfLiteral = ((CtAssignment) literal.getParent())
          .getAssigned()
          .getType()
    } else if (literal.getParent() instanceof CtLocalVariable) {
      clazzOfLiteral = ((CtLocalVariable) literal.getParent())
          .getType()
origin: STAMP-project/dspot

  private boolean isConcatenationOfLiteral(CtLiteral<T> literal) {
    CtElement currentElement = literal;
    while (currentElement.getParent() instanceof CtBinaryOperator) {
      currentElement = currentElement.getParent();
    }
    return currentElement.getParent() instanceof CtInvocation &&
        TestFramework.get().isAssert((CtInvocation) literal.getParent());
  }
};
origin: STAMP-project/dspot

  newLiteral.setValue(newValue.byteValue());
if (newLiteral.getParent() instanceof CtUnaryOperator) {
  CtUnaryOperator parent = (CtUnaryOperator) newLiteral.getParent();
  if (parent.getKind().equals(UnaryOperatorKind.NEG)) {
    toReplace = parent;
spoon.reflect.codeCtLiteralgetParent

Popular methods of CtLiteral

  • getValue
    Gets the actual value of the literal (statically known).
  • setValue
    Sets the actual value of the literal.
  • getType
  • getTypeCasts
  • replace
  • getAnnotations
  • getFactory
  • setFactory
  • setType
  • setTypeCasts
  • addTypeCast
  • clone
  • addTypeCast,
  • clone,
  • getComments,
  • getPosition,
  • setAnnotations,
  • setComments

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSharedPreferences (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now