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

How to use
ArrayType
in
org.jboss.jandex

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

origin: spring-projects/sts4

private static String getBindingKey(ArrayType type) {
  StringBuilder sb = new StringBuilder();
  for (int i = 0; i < type.dimensions(); i++) {
    sb.append('[');
  }
  sb.append(getGeneralTypeBindingKey(type.component()));
  return null;
}
origin: wildfly/jandex

  Type copyType(Type component, int dimensions) {
    return new ArrayType(component, dimensions, annotationArray());
  }
}
origin: wildfly/jandex

private void appendArraySyntax(StringBuilder builder) {
  if (annotationArray().length > 0) {
    builder.append(' ');
    appendAnnotations(builder);
  }
  for (int i = 0; i < dimensions; i++) {
    builder.append("[]");
  }
  if (component.kind() == Kind.ARRAY) {
    component.asArrayType().appendArraySyntax(builder);
  }
}
origin: wildfly/jandex

public String toString() {
  StringBuilder builder = new StringBuilder();
  appendRootComponent(builder);
  appendArraySyntax(builder);
  return builder.toString();
}
origin: wildfly/jandex

case ARRAY: {
  ArrayType arrayType = type.asArrayType();
  int dimensions = arrayType.dimensions();
  while (--dimensions > 0 && elements.size() > 0 && elements.peek().kind == PathElement.Kind.ARRAY) {
    elements.pop();
  Type nested = dimensions > 0 ? new ArrayType(arrayType.component(), dimensions) : arrayType.component();
  nested = resolveTypePath(nested, typeAnnotationState);
  return intern(arrayType.copyType(nested, arrayType.dimensions() - dimensions));
origin: spring-projects/sts4

@Override
public IJavaType component() {
  return wrap(getType().component());
}

origin: wildfly/jandex

@Override
Type copyType(AnnotationInstance[] newAnnotations) {
  return new ArrayType(component, dimensions, newAnnotations);
}
origin: spring-projects/sts4

@Override
public int dimensions() {
  return getType().dimensions();
}
origin: wildfly/jandex

private void appendRootComponent(StringBuilder builder) {
  if (component.kind() == Kind.ARRAY) {
    component.asArrayType().appendRootComponent(builder);
  } else {
    builder.append(component);
  }
}
origin: spring-projects/sts4

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

return "[" + toString( ( (ArrayType) p ).component()); //$NON-NLS-1$
origin: wildfly/jandex

/**
 * Create a new mock array type instance with the specified component
 * and dimensions.
 *
 * @param component the array component
 * @param dimensions the number of dimensions of this array
 * @return the new mock array type instance
 * @since 2.1
 */
public static ArrayType create(Type component, int dimensions) {
  return new ArrayType(component, dimensions);
}
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

  break;
case ARRAY:
  addType(type.asArrayType().component());
  break;
case TYPE_VARIABLE: {
origin: wildfly/jandex

private Type parseArrayType() {
  int mark = this.pos;
  int last = advanceNot('[');
  return new ArrayType(parseJavaType(), last - mark);
}
origin: wildfly/jandex

case ARRAY:
  ArrayType arrayType = type.asArrayType();
  stream.writePackedU32(arrayType.dimensions());
  writeReference(stream, arrayType.component(), false);  // TODO - full should not be necessary
  break;
case PRIMITIVE:
origin: wildfly/jandex

private Type parseType(String descriptor, IntegerHolder pos) {
  int start = pos.i;
  char c = descriptor.charAt(start);
  Type type = PrimitiveType.decode(c);
  if (type != null) {
    return type;
  }
  DotName name;
  switch (c) {
    case 'V': return VoidType.VOID;
    case 'L': {
      int end = start;
      while (descriptor.charAt(++end) != ';');
      name = names.convertToName(descriptor.substring(start + 1, end), '/');
      pos.i = end;
      return names.intern(new ClassType(name));
    }
    case '[': {
      int end = start;
      while (descriptor.charAt(++end) == '[');
      int depth = end - start;
      pos.i = end;
      type = parseType(descriptor, pos);
      return names.intern(new ArrayType(type, depth));
    }
    default: throw new IllegalArgumentException("Invalid descriptor: " + descriptor + " pos " + start);
  }
}
origin: wildfly/jandex

    return new ArrayType(type, depth);
  return new ArrayType(type, depth);
case CLASS:
  return new ClassType(name);
origin: wildfly/jandex

Type component = typeTable[stream.readPackedU32()];
AnnotationInstance[] annotations = readAnnotations(stream, null);
return new ArrayType(component, dimensions, annotations);
org.jboss.jandexArrayType

Javadoc

Represents a Java array type declaration.

Most used methods

  • component
    Returns the component type of the array. As an example, String[] has a component type of String
  • dimensions
    The number of dimensions this array type has. For example, String[][], would return a value of 2.
  • <init>
  • annotationArray
  • appendAnnotations
  • appendArraySyntax
  • appendRootComponent
  • copyType
  • name

Popular in Java

  • Reactive rest calls using spring rest template
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • JFileChooser (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top Sublime Text plugins
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