congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ParameterizedType
Code IndexAdd Tabnine to your IDE (free)

How to use
ParameterizedType
in
org.jboss.jandex

Best Java code snippets using org.jboss.jandex.ParameterizedType (Showing top 19 results out of 315)

origin: spring-projects/sts4

private static String getBindingKey(ParameterizedType type) {
  StringBuilder sb = new StringBuilder();
  sb.append(type.owner() == null ? "L" + type.name().toString().replace('.', '/') : getGeneralTypeBindingKey(type.owner()));
  sb.append('<');
  for (Type argument : type.arguments()) {
    sb.append(getGeneralTypeBindingKey(argument));
  }
  sb.append('>');
  if (type.owner() == null) {
    sb.append(';');
  }
  return sb.toString();
}
origin: wildfly/jandex

ParameterizedType copyType(Type[] parameters) {
  return new ParameterizedType(name(), parameters, owner, annotationArray());
}
origin: wildfly/jandex

public String toString() {
  StringBuilder builder = new StringBuilder();
  if (owner != null) {
    builder.append(owner);
    builder.append('.');
    appendAnnotations(builder);
    builder.append(name().local());
  } else {
    appendAnnotations(builder);
    builder.append(name());
  }
  if (arguments.length > 0) {
    builder.append('<');
    builder.append(arguments[0]);
    for (int i = 1; i < arguments.length; i++) {
      builder.append(", ").append(arguments[i]);
    }
    builder.append('>');
  }
  return builder.toString();
}
origin: wildfly/jandex

@Override
ParameterizedType copyType(AnnotationInstance[] newAnnotations) {
  return new ParameterizedType(name(), arguments, owner, newAnnotations);
}
origin: wildfly/jandex

case PARAMETERIZED_TYPE:
  ParameterizedType parameterizedType = type.asParameterizedType();
  addClassName(parameterizedType.name());
  addType(parameterizedType.owner());
  addTypeList(parameterizedType.argumentsArray());
  break;
case PRIMITIVE:
origin: spring-projects/sts4

@Override
public String name() {
  return getType().name().toString();
}
origin: wildfly/jandex

private Map<DotName, Type> buildOwnerMap(Type type) {
  Map<DotName, Type> pTypeTree = new HashMap<DotName, Type>();
  Type nextType = type;
  do {
    pTypeTree.put(nextType.name(), nextType);
    nextType = nextType instanceof ParameterizedType ? nextType.asParameterizedType().owner() : null;
  } while (nextType != null);
  return pTypeTree;
}
origin: wildfly/jandex

  last = intern(oType != null ? convertParameterized(oType).copyType(last)
                : new ParameterizedType(currentName, null, last));
} else if (oType != null) {
  last = oType;
origin: wildfly/jandex

Type[] arguments = parameterizedType.argumentsArray().clone();
int pos = element.pos;
if (pos >= arguments.length) {
return intern(parameterizedType.copyType(arguments));
origin: wildfly/jandex

/**
 * Create a new mock instance.
 *
 * @param name the name of this type
 * @param arguments an array of types representing arguments to this type
 * @param owner the enclosing type if annotated or parameterized, otherwise null
 * @return the mock instance
 * @since 2.1
 */
public static ParameterizedType create(DotName name, Type[] arguments, Type owner) {
  return new ParameterizedType(name, arguments, owner);
}
origin: spring-projects/sts4

@Override
public Stream<IJavaType> arguments() {
  return getType().arguments().stream().map(Wrappers::wrap);
}

origin: wildfly/jandex

private Type searchTypePath(Type type, TypeAnnotationState typeAnnotationState) {
  PathElementStack elements = typeAnnotationState.pathElements;
  PathElement element = elements.pop();
  if (element == null) {
    return type;
  }
  switch (element.kind) {
    case ARRAY: {
      ArrayType arrayType = type.asArrayType();
      int dimensions = arrayType.dimensions();
      while (--dimensions > 0 && elements.size() > 0 && elements.peek().kind == PathElement.Kind.ARRAY) {
        elements.pop();
      }
      assert dimensions == 0;
      return searchTypePath(arrayType.component(), typeAnnotationState);
    }
    case PARAMETERIZED: {
      ParameterizedType parameterizedType = type.asParameterizedType();
      return searchTypePath(parameterizedType.argumentsArray()[element.pos], typeAnnotationState);
    }
    case WILDCARD_BOUND: {
      return searchTypePath(type.asWildcardType().bound(), typeAnnotationState);
    }
    case NESTED: {
      int depth = popNestedDepth(elements);
      return searchNestedType(type, depth, typeAnnotationState);
    }
  }
  throw new IllegalStateException("Unknown path element");
}
origin: wildfly/jandex

case PARAMETERIZED_TYPE:
  ParameterizedType parameterizedType = type.asParameterizedType();
  Type owner = parameterizedType.owner();
  stream.writePackedU32(positionOf(parameterizedType.name()));
  writeReference(stream, owner, true);
  writeReferenceOrFull(stream, parameterizedType.argumentsArray());
  break;
origin: mbechler/serianalyzer

return "L" + ( (ParameterizedType) p ).name().toString().replace('.', '/') + ";"; //$NON-NLS-1$ //$NON-NLS-2$
origin: spring-projects/sts4

@Override
public IJavaType owner() {
  return wrap(getType().owner());
}
origin: wildfly/jandex

  ParameterizedType toParameterizedType() {
    return new ParameterizedType(name(), null, null, annotationArray());
  }
}
origin: wildfly/jandex

ParameterizedType copyType(Type owner) {
  return new ParameterizedType(name(), arguments, owner, annotationArray());
}
origin: wildfly/jandex

private Type parseClassTypeSignature() {
  String signature = this.signature;
  DotName name = parseName();
  Type[] types = parseTypeArguments();
  Type type = null;
  if (types.length > 0) {
    type = new ParameterizedType(name, types, null);
  }
  // Suffix
  while (signature.charAt(pos) == '.') {
    int mark = ++pos;
    int suffixEnd = advanceNameEnd();
    name = names.wrap(name, signature.substring(mark, suffixEnd), true);
    types = parseTypeArguments();
    // A suffix is a parameterized type if it has typeParameters or it's owner is a parameterized type
    // The first parameterized type needs a standard class type for the owner
    if (type == null && types.length > 0) {
      type = names.intern(new ClassType(name.prefix()));
    }
    if (type != null) {
      type = names.intern(new ParameterizedType(name, types, type));
    }
  }
  this.pos++; // ;
  return type != null ? type : names.intern(new ClassType(name));
}
origin: wildfly/jandex

Type[] parameters = readTypeListReference(stream);
AnnotationInstance[] annotations = readAnnotations(stream, null);
return new ParameterizedType(name, parameters, owner, annotations);
org.jboss.jandexParameterizedType

Javadoc

Represents a generic parameterized type. The name() corresponds to the raw type, and the arguments list corresponds to a list of type arguments passed to the parameterized type.

Additionally, a parameterized type is used to represent an inner class whose enclosing class is either parameterized or has type annotations. In this case, the owner() method will specify the type for the enclosing class. It is also possible for such a type to be parameterized itself.

For example, the follow declaration would have a name of "java.util.Map", and two ClassType arguments, the first being "java.lang.String", the second "java.lang.Integer":

 
java.util.Map<String, Integer> 

Another example shows the case where a parameterized type is used to represent a non-parameterized class (X), whose owner (Y) is itself parameterized:

 
Y<String>.X 

Most used methods

  • name
  • owner
    Returns the owner (enclosing) type of this parameterized type if the owner is parameterized, or cont
  • <init>
  • annotationArray
  • appendAnnotations
  • arguments
    Returns the list of arguments passed to this Parameterized type.
  • argumentsArray
  • copyType

Popular in Java

  • Updating database using SQL prepared statement
  • findViewById (Activity)
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • JFrame (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • From CI to AI: The AI layer in your organization
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