congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ClassNode.redirect
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.codehaus.groovy/groovy

public OptimizingBooleanExpression(final Expression expression, final ClassNode type) {
  super(expression);
  this.expression = expression;
  // we must use the redirect node, otherwise InnerClassNode would not have the "correct" type
  this.type = type.redirect();
}
origin: org.codehaus.groovy/groovy

/**
 * Sets the superclass of this ClassNode
 */
public void setSuperClass(ClassNode superClass) {
  redirect().superClass = superClass;
}
origin: org.codehaus.groovy/groovy

public List<PropertyNode> getProperties() {
  final ClassNode r = redirect();
  if (r.properties == null)
    r.properties = new ArrayList<PropertyNode> ();
  return r.properties;
}
origin: org.codehaus.groovy/groovy

public static ClassNode getUnwrapper(ClassNode cn) {
  cn = cn.redirect();
  if (isPrimitiveType(cn)) return cn;
  ClassNode result = WRAPPER_TYPE_TO_PRIMITIVE_TYPE_MAP.get(cn);
  if (null != result) {
    return result;
  }
  return cn;
}
origin: org.codehaus.groovy/groovy

private ClassNode(ClassNode componentType) {
  this(componentType.getName()+"[]", ACC_PUBLIC, ClassHelper.OBJECT_TYPE);
  this.componentType = componentType.redirect();
  isPrimaryNode=false;
}
origin: org.codehaus.groovy/groovy

public void setInterfaces(ClassNode[] interfaces) {
  if (redirect!=null) {
    redirect().setInterfaces(interfaces);
  } else {
    this.interfaces = interfaces;
  }
}
origin: org.codehaus.groovy/groovy

private boolean helperClassNotCreatedYet(final ClassNode traitReceiver) {
  return !traitReceiver.redirect().getInnerClasses().hasNext()
      && this.unit.getAST().getClasses().contains(traitReceiver.redirect());
}
private boolean isTraitSuperPropertyExpression(Expression exp) {
origin: org.codehaus.groovy/groovy

public List<ConstructorNode> getDeclaredConstructors() {
  if (redirect != null) return redirect().getDeclaredConstructors();
  lazyClassInit();
  if (constructors == null)
    constructors = new ArrayList<ConstructorNode> ();
  return constructors;
}
origin: org.codehaus.groovy/groovy

/**
 * Finds a field matching the given name in this class.
 *
 * @param name the name of the field of interest
 * @return the method matching the given name and parameters or null
 */
public FieldNode getDeclaredField(String name) {
  if (redirect != null) return redirect().getDeclaredField(name);
  lazyClassInit();
  return fieldIndex == null ? null : fieldIndex.get(name);
}
origin: org.codehaus.groovy/groovy

/**
 * Detect whether a given ClassNode is a inner class (non-static).
 *
 * @param cNode the ClassNode of interest
 * @return true if the given node is a (non-static) inner class, else false
 */
public static boolean isInnerClass(ClassNode cNode) {
  return cNode.redirect().getOuterClass() != null
      && !Modifier.isStatic(cNode.getModifiers());
}
origin: org.codehaus.groovy/groovy

public void addMethod(MethodNode node) {
  node.setDeclaringClass(this);
  ClassNode base = redirect();
  if (base.methodsList.isEmpty()) {
    base.methodsList = new ArrayList<MethodNode>();
  }
  base.methodsList.add(node);
  base.methods.put(node.getName(), node);
}
origin: org.codehaus.groovy/groovy

/**
 * @return the array of interfaces which this ClassNode implements
 */
public ClassNode[] getInterfaces() {
  if (redirect!=null) return redirect().getInterfaces();
  lazyClassInit();
  return interfaces;
}
origin: org.codehaus.groovy/groovy

public FieldNode addField(String name, int modifiers, ClassNode type, Expression initialValue) {
  FieldNode node = new FieldNode(name, modifiers, type, redirect(), initialValue);
  addField(node);
  return node;
}
origin: org.codehaus.groovy/groovy

/**
 * @return the ClassNode of the super class of this type
 */
public ClassNode getSuperClass() {
  if (!lazyInitDone && !isResolved()) {
    throw new GroovyBugError("ClassNode#getSuperClass for "+getName()+" called before class resolving");
  }
  ClassNode sn = redirect().getUnresolvedSuperClass();
  if (sn!=null) sn=sn.redirect();
  return sn;
}
origin: org.codehaus.groovy/groovy

public boolean equals(Object o) {
  if (redirect!=null) return redirect().equals(o);
  if (!(o instanceof ClassNode)) return false;
  ClassNode cn = (ClassNode) o;
  return (cn.getText().equals(getText()));
}
origin: org.codehaus.groovy/groovy

public ClassNode getPlainNodeReference() {
  if (ClassHelper.isPrimitiveType(this)) return this;
  ClassNode n = new ClassNode(name, modifiers, superClass,null,null);
  n.isPrimaryNode = false;
  n.setRedirect(redirect());
  if (isArray()) {
    n.componentType = redirect().getComponentType();
  } 
  return n;
}
origin: org.codehaus.groovy/groovy

public static ClassNode resolveClassNodeGenerics(Map<GenericsTypeName, GenericsType> resolvedPlaceholders, final Map<GenericsTypeName, GenericsType> placeholdersFromContext, ClassNode currentType) {
  ClassNode target = currentType.redirect();
  resolvedPlaceholders = new HashMap<GenericsTypeName, GenericsType>(resolvedPlaceholders);
  applyContextGenerics(resolvedPlaceholders, placeholdersFromContext);
  Map<GenericsTypeName, GenericsType> connections = new HashMap<GenericsTypeName, GenericsType>();
  extractGenericsConnections(connections, currentType, target);
  applyGenericsConnections(connections, resolvedPlaceholders);
  currentType = applyGenericsContext(resolvedPlaceholders, currentType);
  return currentType;
}
origin: org.codehaus.groovy/groovy

private static List<AnnotationNode> getStoredTargetList(AnnotationNode aliasAnnotationUsage, SourceUnit source) {
  ClassNode alias = aliasAnnotationUsage.getClassNode().redirect();
  List<AnnotationNode> ret = getMeta(alias);
  return copy(ret, aliasAnnotationUsage);
}
origin: org.codehaus.groovy/groovy

static Map<GenericsTypeName, GenericsType> applyGenericsContextToParameterClass(
    Map<GenericsTypeName, GenericsType> spec, ClassNode parameterUsage
) {
  GenericsType[] gts = parameterUsage.getGenericsTypes();
  if (gts == null) return Collections.EMPTY_MAP;
  GenericsType[] newGTs = applyGenericsContext(spec, gts);
  ClassNode newTarget = parameterUsage.redirect().getPlainNodeReference();
  newTarget.setGenericsTypes(newGTs);
  return GenericsUtils.extractPlaceholders(newTarget);
}
origin: org.codehaus.groovy/groovy

public static boolean missesGenericsTypes(ClassNode cn) {
  if (cn.isArray()) return missesGenericsTypes(cn.getComponentType());
  GenericsType[] cnTypes = cn.getGenericsTypes();
  GenericsType[] rnTypes = cn.redirect().getGenericsTypes();
  if (rnTypes != null && cnTypes == null) return true;
  if (cnTypes != null) {
    for (GenericsType genericsType : cnTypes) {
      if (genericsType.isPlaceholder()) return true;
    }
  }
  return false;
}
org.codehaus.groovy.astClassNoderedirect

Javadoc

Returns the ClassNode this ClassNode is redirecting to.

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

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
  • getResourceAsStream (ClassLoader)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Notification (javax.management)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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