MCPcopy Create free account
hub / github.com/androrm/androrm / getFieldInstance

Method getFieldInstance

src/src/com/orm/androrm/QueryBuilder.java:170–192  ·  view source on GitHub ↗
(
			
			Class<T> 	clazz, 
			T 			instance, 
			String 		fieldName
	
	)

Source from the content-addressed store, hash-verified

168 }
169
170 private static final <T extends Model> Object getFieldInstance(
171
172 Class<T> clazz,
173 T instance,
174 String fieldName
175
176 ) {
177 Field field = Model.getField(clazz, instance, fieldName);
178 Object fieldInstance = null;
179
180 if(field != null) {
181 try {
182 fieldInstance = field.get(instance);
183 } catch(IllegalAccessException e) {
184 Log.e(TAG, "exception thrown while trying to create representation of "
185 + clazz.getSimpleName()
186 + " and fetching field object for field "
187 + fieldName, e);
188 }
189 }
190
191 return fieldInstance;
192 }
193
194 @SuppressWarnings("unchecked")
195 private static final <T extends Model> SelectStatement getRelationSelection(

Callers 2

buildJoinMethod · 0.95
buildQueryMethod · 0.95

Calls 2

getFieldMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected