Tabnine Logo
ClassNode.setLastLineNumber
Code IndexAdd Tabnine to your IDE (free)

How to use
setLastLineNumber
method
in
org.codehaus.groovy.ast.ClassNode

Best Java code snippets using org.codehaus.groovy.ast.ClassNode.setLastLineNumber (Showing top 5 results out of 315)

origin: org.codehaus.groovy/groovy

  @Override
  public void setLastLineNumber(final int lineNumber) {
    super.setLastLineNumber(lineNumber);
    innerClass.setLastLineNumber(lineNumber);
  }
}
origin: org.codehaus.groovy/groovy

public ModuleNode buildAST(SourceUnit sourceUnit, ClassLoader classLoader, Reduction cst) throws ParserException {
  setClassLoader(classLoader);
  makeModule();
  try {
    convertGroovy(ast);
    if (output.getStatementBlock().isEmpty() && output.getMethods().isEmpty() && output.getClasses().isEmpty()) {
      output.addStatement(ReturnStatement.RETURN_NULL_OR_VOID);
    }
    // set the script source position
    ClassNode scriptClassNode = output.getScriptClassDummy();
    if (scriptClassNode != null) {
      List<Statement> statements = output.getStatementBlock().getStatements();
      if (!statements.isEmpty()) {
        Statement firstStatement = statements.get(0);
        Statement lastStatement = statements.get(statements.size() - 1);
        scriptClassNode.setSourcePosition(firstStatement);
        scriptClassNode.setLastColumnNumber(lastStatement.getLastColumnNumber());
        scriptClassNode.setLastLineNumber(lastStatement.getLastLineNumber());
      }
    }
  }
  catch (ASTRuntimeException e) {
    throw new ASTParserException(e.getMessage() + ". File: " + sourceUnit.getName(), e);
  }
  return output;
}
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

  @Override
  public void setLastLineNumber(final int lineNumber) {
    super.setLastLineNumber(lineNumber);
    innerClass.setLastLineNumber(lineNumber);
  }
}
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public ModuleNode buildAST(SourceUnit sourceUnit, ClassLoader classLoader, Reduction cst) throws ParserException {
  setClassLoader(classLoader);
  makeModule();
  try {
    convertGroovy(ast);
    if (output.getStatementBlock().isEmpty() && output.getMethods().isEmpty() && output.getClasses().isEmpty()) {
      output.addStatement(ReturnStatement.RETURN_NULL_OR_VOID);
    }
    // set the script source position
    ClassNode scriptClassNode = output.getScriptClassDummy();
    if (scriptClassNode != null) {
      List<Statement> statements = output.getStatementBlock().getStatements();
      if (statements.size() > 0) {
        Statement firstStatement = statements.get(0);
        Statement lastStatement = statements.get(statements.size() - 1);
        scriptClassNode.setSourcePosition(firstStatement);
        scriptClassNode.setLastColumnNumber(lastStatement.getLastColumnNumber());
        scriptClassNode.setLastLineNumber(lastStatement.getLastLineNumber());
      }
    }
  }
  catch (ASTRuntimeException e) {
    throw new ASTParserException(e.getMessage() + ". File: " + sourceUnit.getName(), e);
  }
  return output;
}
origin: org.netbeans.modules/org-netbeans-modules-groovy-editor

private void addAnnotationOccurrences(AnnotationNode annotation, ClassNode findingNode) {
  ClassNode classNode = annotation.getClassNode();
  classNode.setLineNumber(annotation.getLineNumber());
  classNode.setColumnNumber(annotation.getColumnNumber());
  classNode.setLastLineNumber(annotation.getLastLineNumber());
  classNode.setLastColumnNumber(annotation.getLastColumnNumber());
  addOccurrences(classNode, findingNode);
}
org.codehaus.groovy.astClassNodesetLastLineNumber

Popular methods of ClassNode

  • getName
  • getMethods
    This methods creates a list of all methods with this name of the current class and of all super clas
  • <init>
    Constructor used by makeArray() if no real class is available
  • getSuperClass
  • equals
  • addMethod
  • getAnnotations
  • addField
  • getFields
    Returns a list containing FieldNode objects for each field in the class represented by this ClassNod
  • getPlainNodeReference
  • getField
    Finds a field matching the given name in this class or a parent class.
  • getMethod
    Finds a method matching the given name and parameters in this class or any parent class.
  • getField,
  • getMethod,
  • isInterface,
  • getNameWithoutPackage,
  • isScript,
  • getDeclaredMethod,
  • getGenericsTypes,
  • getDeclaredConstructors,
  • getModifiers,
  • getTypeClass

Popular in Java

  • Creating JSON documents from java classes using gson
  • getContentResolver (Context)
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Runner (org.openjdk.jmh.runner)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now