Class WideningCategories.LowestUpperBoundClassNode

java.lang.Object
org.codehaus.groovy.ast.ASTNode
org.codehaus.groovy.ast.AnnotatedNode
org.codehaus.groovy.ast.ClassNode
org.codehaus.groovy.ast.tools.WideningCategories.LowestUpperBoundClassNode
All Implemented Interfaces:
GroovydocHolder<AnnotatedNode>, NodeMetaDataHandler
Enclosing class:
WideningCategories

public static class WideningCategories.LowestUpperBoundClassNode extends ClassNode
This ClassNode specialization is used when the lowest upper bound of two types cannot be represented by an existing type. For example, if B extends A, C extends A and both C and B implement a common interface not implemented by A, then we use this class to represent the bound.

At compile time, some classes like AsmClassGenerator need to know about a real class node, so we compute a "compile time" node which will be used to return a name and a type class.

  • Constructor Details

  • Method Details

    • getLubName

      public String getLubName()
    • getText

      public String getText()
      Description copied from class: ASTNode
      Returns a human-readable text representation of this AST node. Used for debugging and error messages. Default implementation returns a message indicating the representation is not yet implemented for this node type.
      Overrides:
      getText in class ClassNode
      Returns:
      text representation of this node, or placeholder for unimplemented types
    • getName

      public String getName()
      Description copied from class: ClassNode
      Returns the fully-qualified name of this class after following any redirects. If this ClassNode is a proxy for another ClassNode, the name of the target is returned. The name remains consistent across all compilation phases for the redirected type.
      Overrides:
      getName in class ClassNode
      Returns:
      the fully-qualified class name (e.g., "com.example.MyClass" or "int[]")
    • getTypeClass

      public Class getTypeClass()
      Description copied from class: ClassNode
      Returns the concrete class this classnode relates to. However, this method is inherently unsafe as it may return null depending on the compile phase you are using. AST transformations should never use this method directly, but rather obtain a new class node using ClassNode.getPlainNodeReference().
      Overrides:
      getTypeClass in class ClassNode
      Returns:
      the class this classnode relates to. May return null.
    • toString

      public String toString(boolean x)
      Description copied from class: ClassNode
      Returns a string representation of this ClassNode with optional redirect information. For array types, appends "[]" to the component type's string representation. For generic types, includes generic type parameters (e.g., "List"). If showRedirect is true and this is a redirect node, includes arrow notation showing the redirect target; otherwise the redirect information is omitted.
      Overrides:
      toString in class ClassNode
      Parameters:
      x - if true, includes redirect information in the output; if false, omits it
      Returns:
      a string representation of this ClassNode
    • asGenericsType

      public GenericsType asGenericsType()
      Overrides:
      asGenericsType in class ClassNode
    • getPlainNodeReference

      public ClassNode getPlainNodeReference()
      Overrides:
      getPlainNodeReference in class ClassNode