Package org.springsource.loaded

Examples of org.springsource.loaded.FieldMember


    TypeRegistry registry = getTypeRegistry("");
    byte[] bytes = loadBytesForClass("data.SomeFields");
    TypeDescriptor typeDescriptor = new TypeDescriptorExtractor(registry).extract(bytes, false);
    FieldMember[] fields = typeDescriptor.getFields();
    assertEquals(4, fields.length);
    FieldMember privateField = fields[0];
    assertEquals(Modifier.PRIVATE, privateField.getModifiers());
    assertEquals("privateField", privateField.getName());
    assertEquals("I", privateField.getDescriptor());
    assertNull(privateField.getGenericSignature());
    assertEquals("0x2 I privateField", privateField.toString());

    FieldMember publicField = fields[1];
    assertEquals(Modifier.PUBLIC, publicField.getModifiers());
    assertEquals("publicField", publicField.getName());
    assertEquals("Ljava/lang/String;", publicField.getDescriptor());
    assertNull(publicField.getGenericSignature());
    assertEquals("0x1 Ljava/lang/String; publicField", publicField.toString());

    FieldMember defaultField = fields[2];
    assertEquals(0, defaultField.getModifiers());
    assertEquals("defaultField", defaultField.getName());
    assertEquals("Ljava/util/List;", defaultField.getDescriptor());
    assertEquals("Ljava/util/List<Ljava/lang/String;>;", defaultField.getGenericSignature());
    assertEquals("0x0 Ljava/util/List; defaultField [Ljava/util/List<Ljava/lang/String;>;]", defaultField.toString());

    FieldMember protectedField = fields[3];
    assertEquals(Modifier.PROTECTED, protectedField.getModifiers());
    assertEquals("protectedField", protectedField.getName());
    assertEquals("Ljava/util/Map;", protectedField.getDescriptor());
    assertEquals("Ljava/util/Map<Ljava/lang/String;Ljava/util/List<Ljava/lang/Integer;>;>;",
        protectedField.getGenericSignature());
    assertEquals(
        "0x4 Ljava/util/Map; protectedField [Ljava/util/Map<Ljava/lang/String;Ljava/util/List<Ljava/lang/Integer;>;>;]",
        protectedField.toString());
  }
View Full Code Here


    ReloadableType rtype = getReloadableTypeIfHasBeenReloaded(field.getDeclaringClass());
    if (rtype == null) {
      return false;
    } else {
      TypeDescriptor desc = rtype.getLatestTypeDescriptor();
      FieldMember currentField = desc.getField(field.getName());
      if (currentField == null) {
        return true; // Method not there, consider it deleted
      } else {
        return false;
      }
View Full Code Here

TOP

Related Classes of org.springsource.loaded.FieldMember

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.