Codota Logo
libcore.reflect
Code IndexAdd Codota to your IDE (free)

How to use libcore.reflect

Best Java code snippets using libcore.reflect (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: robovm/robovm

TypeVariableImpl<GenericDeclaration> parseTypeVariableSignature() {
  // TypeVariableSignature ::= "T" Ident ";".
  expect('T');
  scanIdentifier();
  expect(';');
  // Reference to type variable:
  // Note: we don't know the declaring GenericDeclaration yet.
  return new TypeVariableImpl<GenericDeclaration>(genericDecl, identifier);
}
origin: robovm/robovm

void parseClassSignature() {
  // ClassSignature ::=
  // OptFormalTypeParameters SuperclassSignature {SuperinterfaceSignature}.
  parseOptFormalTypeParameters();
  // SuperclassSignature ::= ClassTypeSignature.
  this.superclassType = parseClassTypeSignature();
  interfaceTypes = new ListOfTypes(16);
  while (symbol > 0) {
    // SuperinterfaceSignature ::= ClassTypeSignature.
    interfaceTypes.add(parseClassTypeSignature());
  }
}
origin: robovm/robovm

Type getResolvedType() {
  if (args.getResolvedTypes().length == 0) {
    return getRawType();
  } else {
    return this;
  }
}
origin: robovm/robovm

TypeVariableImpl<GenericDeclaration> parseFormalTypeParameter() {
  // FormalTypeParameter ::= Ident ClassBound {InterfaceBound}.
  scanIdentifier();
  String name = identifier.intern(); // FIXME: is this o.k.?
  ListOfTypes bounds = new ListOfTypes(8);
  // ClassBound ::= ":" [FieldTypeSignature].
  expect(':');
  if (symbol == 'L' || symbol == '[' || symbol == 'T') {
    bounds.add(parseFieldTypeSignature());
  }
  while (symbol == ':') {
    // InterfaceBound ::= ":" FieldTypeSignature.
    scanSymbol();
    bounds.add(parseFieldTypeSignature());
  }
  return new TypeVariableImpl<GenericDeclaration>(genericDecl, name, bounds);
}
origin: robovm/robovm

void parseOptFormalTypeParameters() {
  // OptFormalTypeParameters ::=
  // ["<" FormalTypeParameter {FormalTypeParameter} ">"].
  ListOfVariables typeParams = new ListOfVariables();
  if (symbol == '<') {
    scanSymbol();
    typeParams.add(parseFormalTypeParameter());
    while ((symbol != '>') && (symbol > 0)) {
      typeParams.add(parseFormalTypeParameter());
    }
    expect('>');
  }
  this.formalTypeParameters = typeParams.getArray();
}
origin: robovm/robovm

ListOfTypes parseOptTypeArguments() {
  // OptTypeArguments ::= "<" TypeArgument {TypeArgument} ">".
  ListOfTypes typeArgs = new ListOfTypes(8);
  if (symbol == '<') {
    scanSymbol();
    typeArgs.add(parseTypeArgument());
    while ((symbol != '>') && (symbol > 0)) {
      typeArgs.add(parseTypeArgument());
    }
    expect('>');
  }
  return typeArgs;
}
origin: robovm/robovm

Type parseTypeArgument() {
  // TypeArgument ::= (["+" | "-"] FieldTypeSignature) | "*".
  ListOfTypes extendsBound = new ListOfTypes(1);
  ListOfTypes superBound = new ListOfTypes(1);
  if (symbol == '*') {
    scanSymbol();
    extendsBound.add(Object.class);
    return new WildcardTypeImpl(extendsBound, superBound);
  }
  else if (symbol == '+') {
    scanSymbol();
    extendsBound.add(parseFieldTypeSignature());
    return new WildcardTypeImpl(extendsBound, superBound);
  }
  else if (symbol == '-') {
    scanSymbol();
    superBound.add(parseFieldTypeSignature());
    extendsBound.add(Object.class);
    return new WildcardTypeImpl(extendsBound, superBound);
  }
  else {
    return parseFieldTypeSignature();
  }
}
origin: robovm/robovm

Type parseFieldTypeSignature() {
  // FieldTypeSignature ::= ClassTypeSignature | ArrayTypeSignature
  //         | TypeVariableSignature.
  switch (symbol) {
  case 'L':
    return parseClassTypeSignature();
  case '[':
    // ArrayTypeSignature ::= "[" TypSignature.
    scanSymbol();
    return new GenericArrayTypeImpl(parseTypeSignature());
  case 'T':
    return parseTypeVariableSignature();
  default:
    throw new GenericSignatureFormatError();
  }
}
origin: robovm/robovm

/**
 * Returns the {@code Type} that represents the superclass of this {@code
 * class}.
 */
public Type getGenericSuperclass() {
  GenericSignatureParser parser = new GenericSignatureParser(getClassLoader());
  parser.parseForClass(this, getSignatureAttribute());
  return Types.getType(parser.superclassType);
}
origin: robovm/robovm

/**
 * Returns the {@link Type}s of the interfaces that this {@code Class} directly
 * implements. If the {@code Class} represents a primitive type or {@code
 * void} then an empty array is returned.
 */
public Type[] getGenericInterfaces() {
  GenericSignatureParser parser = new GenericSignatureParser(getClassLoader());
  parser.parseForClass(this, getSignatureAttribute());
  return Types.getTypeArray(parser.interfaceTypes, true);
}
origin: robovm/robovm

Type parseReturnType() {
  // ReturnType ::= TypeSignature | "V".
  if (symbol != 'V') { return parseTypeSignature(); }
  else { scanSymbol(); return void.class; }
}
origin: robovm/robovm

/**
 * Parses the generic signature of a field and creates the data structure
 * representing the signature.
 *
 * @param genericDecl the GenericDeclaration calling this method
 * @param signature the generic signature of the class
 */
public void parseForField(GenericDeclaration genericDecl,
    String signature) {
  setInput(genericDecl, signature);
  if (!eof) {
    this.fieldType = parseFieldTypeSignature();
  }
}
origin: robovm/robovm

Type parseTypeSignature() {
  switch (symbol) {
  case 'B': scanSymbol(); return byte.class;
  case 'C': scanSymbol(); return char.class;
  case 'D': scanSymbol(); return double.class;
  case 'F': scanSymbol(); return float.class;
  case 'I': scanSymbol(); return int.class;
  case 'J': scanSymbol(); return long.class;
  case 'S': scanSymbol(); return short.class;
  case 'Z': scanSymbol(); return boolean.class;
  default:
    // Not an elementary type, but a FieldTypeSignature.
    return parseFieldTypeSignature();
  }
}
origin: robovm/robovm

public Type[] getBounds() {
  resolve();
  return bounds.getResolvedTypes().clone();
}
origin: robovm/robovm

public Type getGenericComponentType() {
  try {
    return ((ParameterizedTypeImpl)componentType).getResolvedType();
  } catch (ClassCastException e) {
    return componentType;
  }
}
origin: robovm/robovm

/**
 * Returns a hash code composed as a sum of hash codes of member elements,
 * including elements with default values.
 * @see AnnotationMember#hashCode()
 */
public int hashCode() {
  int hash = 0;
  for (AnnotationMember element : elements) {
    hash += element.hashCode();
  }
  return hash;
}
origin: robovm/robovm

public Type[] getResolvedTypes() {
  Type[] result = resolvedTypes;
  if (result == null) {
    result = resolveTypes(types);
    resolvedTypes = result;
  }
  return result;
}
origin: robovm/robovm

public D getGenericDeclaration() {
  resolve();
  return genericDeclaration;
}
origin: robovm/robovm

void setInput(GenericDeclaration genericDecl, String input) {
  if (input != null) {
    this.genericDecl = genericDecl;
    this.buffer = input.toCharArray();
    this.eof = false;
    scanSymbol();
  }
  else {
    this.eof = true;
  }
}
origin: robovm/robovm

public static Type getType(Type type) {
  if (type instanceof ParameterizedTypeImpl) {
    return ((ParameterizedTypeImpl)type).getResolvedType();
  }
  return type;
}
libcore.reflect

Most used classes

  • AnnotationFactory
    The annotation implementation based on dynamically generated proxy instances. It conforms to all req
  • AnnotationMember
    This class represents member element of an annotation. It consists of name and value, supplemented w
  • GenericArrayTypeImpl
  • GenericSignatureParser
    Implements a parser for the generics signature attribute. Uses a top-down, recursive descent parsing
  • InternalNames
    Work with a type's internal name like "V" or "Ljava/lang/String;".
  • ListOfVariables,
  • ParameterizedTypeImpl,
  • TypeVariableImpl,
  • Types,
  • WildcardTypeImpl
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now