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

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

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

origin: org.codehaus.groovy/groovy

@Override
public void setSourcePosition(final ASTNode node) {
  super.setSourcePosition(node);
  innerClass.setSourcePosition(node);
}
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 setSourcePosition(final ASTNode node) {
  super.setSourcePosition(node);
  innerClass.setSourcePosition(node);
}
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.gcontracts/gcontracts-core

answer.setSourcePosition(expression);
org.codehaus.groovy.astClassNodesetSourcePosition

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

  • Running tasks concurrently on multiple threads
  • onRequestPermissionsResult (Fragment)
  • getSupportFragmentManager (FragmentActivity)
  • getSharedPreferences (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top plugins for Android Studio
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