test_class.file: code/src/test/java/com/googlecode/cqengine/attribute/ReflectiveAttributeTest.java
test_class.identifier: ReflectiveAttributeTest
test_case.body: @Test
      public void testReflectiveAttribute() {
          // Create an indexed collection (note: could alternatively use CQEngine.copyFrom() existing collection)...
          IndexedCollection<Car> cars = new ConcurrentIndexedCollection<Car>();
  
          // Define an attribute which will use reflection...
          Attribute<Car, String> NAME = ReflectiveAttribute.forField(Car.class, String.class, "name");
  
          cars.addIndex(HashIndex.onAttribute(NAME));
          // Add some objects to the collection...
          cars.add(new Car(1, "ford focus", "great condition, low mileage", Arrays.asList("spare tyre", "sunroof")));
          cars.add(new Car(2, "ford taurus", "dirty and unreliable, flat tyre", Arrays.asList("spare tyre", "radio")));
          cars.add(new Car(3, "honda civic", "has a flat tyre and high mileage", Arrays.asList("radio")));
  
          Assert.assertEquals(cars.retrieve(equal(NAME, "honda civic")).size(), 1);
      }
test_case.class_method_signature: ReflectiveAttributeTest.testReflectiveAttribute()
test_case.full_signature: @Test public void testReflectiveAttribute()
test_case.identifier: testReflectiveAttribute
test_case.invocations: forField addIndex onAttribute add asList add asList add asList assertEquals size retrieve equal
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testReflectiveAttribute()
focal_class.declarator: field
focal_class.modifier: final
focal_class.original_string: final Field field;
focal_class.type: Field
focal_class.var_name: field
focal_class.file: code/src/main/java/com/googlecode/cqengine/attribute/ReflectiveAttribute.java
focal_class.identifier: ReflectiveAttribute
focal_class.class_method_signature: ReflectiveAttribute.ReflectiveAttribute(Class<O> objectType, Class<A> fieldType, String fieldName)
focal_class.full_signature: public  ReflectiveAttribute(Class<O> objectType, Class<A> fieldType, String fieldName)
focal_class.identifier: ReflectiveAttribute
focal_class.modifiers: public
focal_class.parameters: (Class<O> objectType, Class<A> fieldType, String fieldName)
focal_class.signature:  ReflectiveAttribute(Class<O> objectType, Class<A> fieldType, String fieldName)
focal_class.class_method_signature: ReflectiveAttribute.getField(Class<?> cls, String fieldName)
focal_class.full_signature: static Field getField(Class<?> cls, String fieldName)
focal_class.identifier: getField
focal_class.modifiers: static
focal_class.parameters: (Class<?> cls, String fieldName)
focal_class.return: Field
focal_class.signature: Field getField(Class<?> cls, String fieldName)
focal_class.class_method_signature: ReflectiveAttribute.getValue(O object, QueryOptions queryOptions)
focal_class.full_signature: @Override public A getValue(O object, QueryOptions queryOptions)
focal_class.identifier: getValue
focal_class.modifiers: @Override public
focal_class.parameters: (O object, QueryOptions queryOptions)
focal_class.return: A
focal_class.signature: A getValue(O object, QueryOptions queryOptions)
focal_class.class_method_signature: ReflectiveAttribute.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: ReflectiveAttribute.canEqual(Object other)
focal_class.full_signature: @Override public boolean canEqual(Object other)
focal_class.identifier: canEqual
focal_class.modifiers: @Override public
focal_class.parameters: (Object other)
focal_class.return: boolean
focal_class.signature: boolean canEqual(Object other)
focal_class.class_method_signature: ReflectiveAttribute.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: ReflectiveAttribute.forField(Class<O> objectType, Class<A> fieldType, String fieldName)
focal_class.full_signature: public static ReflectiveAttribute<O, A> forField(Class<O> objectType, Class<A> fieldType, String fieldName)
focal_class.identifier: forField
focal_class.modifiers: public static
focal_class.parameters: (Class<O> objectType, Class<A> fieldType, String fieldName)
focal_class.return: ReflectiveAttribute<O, A>
focal_class.signature: ReflectiveAttribute<O, A> forField(Class<O> objectType, Class<A> fieldType, String fieldName)
focal_class.superclass: extends SimpleAttribute<O, A>
focal_method.body: public ReflectiveAttribute(Class<O> objectType, Class<A> fieldType, String fieldName) {
          super(objectType, fieldType, fieldName);
          Field field;
          try {
              field = getField(objectType, fieldName);
              if (!field.isAccessible()) {
                  field.setAccessible(true);
              }
          }
          catch (Exception e) {
              throw new IllegalStateException("Invalid attribute definition: No such field '" + fieldName + "' in object '" + objectType.getName() + "'");
          }
          if (!fieldType.isAssignableFrom(field.getType())) {
              throw new IllegalStateException("Invalid attribute definition: The type of field '" + fieldName + "', type '" + field.getType() + "', in object '" + objectType.getName() + "', is not assignable to the type indicated: " + fieldType.getName());
          }
          this.field = field;
      }
focal_method.class_method_signature: ReflectiveAttribute.ReflectiveAttribute(Class<O> objectType, Class<A> fieldType, String fieldName)
focal_method.full_signature: public  ReflectiveAttribute(Class<O> objectType, Class<A> fieldType, String fieldName)
focal_method.identifier: ReflectiveAttribute
focal_method.modifiers: public
focal_method.parameters: (Class<O> objectType, Class<A> fieldType, String fieldName)
focal_method.signature:  ReflectiveAttribute(Class<O> objectType, Class<A> fieldType, String fieldName)