All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xapi.source.api.IsGeneric Maven / Gradle / Ivy

package xapi.source.api;


public interface IsGeneric extends IsType{

  /**
   * Default bounds of opaque means "just print the name in the <>".
   */
  int OPAQUE = 0;
  /**
   * Bounds of 
   */
  int EXTENDS = 1;
  /**
   * Bounds of 
   * It is illegal to specify more than one generic type
   */
  int SUPER = 2;
  /**
   * A flag for generics that can be erased if we are targetting java 7.
   */
  int NILLABLE = 4;

  /**
   * @return The arbitrary name of this generic; defaults to ?
   *
   * If it is a fully qualified classname, it will be imported;
   * if the writer has access to a TypePool, it will attempt to shorten the
   * generic signature automatically.
   */
  String genericName();

  /**
   * @return The bounds strategy to use.
   * 0 = print: name == "?" ? genericTypes[0] : name
   * 1 = print: name extends join(genericTypes, "&")
   * 2 = print: name super genericTypes[0]
   * 4 = can print <> in java7 compilations
   */
  int genericBounds();

  /**
   * @return any extra types that should be added to an extends bound.
   *
   * This will be null or length == 0 unless you want  signatures.
   * The Y type is represented by this object's IsType declaration.
   * Z ... types will be returned by extended types.
   *
   * Note that using other generic names for types is possibly valid,
   * so we support it blindly and leave it up to the developer to ensure that
   * their generate signatures are valid.
   *
   * These types will identify as isPrimitive() as they will lack a package.
   */
  IsType[] extendedTypes();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy