private VPackCache.FieldInfo createFieldInfo(java.lang.reflect.Field field) { string fieldName = field.getName(); if (this.fieldNamingStrategy != null) { fieldName = this.fieldNamingStrategy.translateName(field); } com.arangodb.velocypack.annotations.SerializedName annotationName = field.getAnnotation <com.arangodb.velocypack.annotations.SerializedName>(); if (annotationName != null) { fieldName = annotationName.value(); } com.arangodb.velocypack.annotations.Expose expose = field.getAnnotation <com.arangodb.velocypack.annotations.Expose >(); bool serialize = expose != null?expose.serialize() : true; bool deserialize = expose != null?expose.deserialize() : true; java.lang.Class clazz = field.getType(); global::System.Type type; if (typeof(System.Collections.ICollection).isAssignableFrom (clazz) || typeof(System.Collections.IDictionary ).isAssignableFrom(clazz)) { type = (java.lang.reflect.ParameterizedType)field.getGenericType(); } else { type = clazz; } return(new _FieldInfo_153(field, type, fieldName, serialize, deserialize)); }
public string translateName(java.lang.reflect.Field field) { com.arangodb.entity.DocumentFieldAttribute annotation = field.getAnnotation <com.arangodb.entity.DocumentFieldAttribute >(); if (annotation != null) { return(annotation.value().getSerializeName()); } return(field.getName()); }
private void findAnnotation(System.Collections.Generic.ICollection <com.arangodb.entity.DocumentFieldAttribute.Type > values, System.Collections.Generic.IDictionary <com.arangodb.entity.DocumentFieldAttribute.Type , java.lang.reflect.Field> fields, java.lang.reflect.Field field) { com.arangodb.entity.DocumentFieldAttribute annotation = field.getAnnotation <com.arangodb.entity.DocumentFieldAttribute >(); if (annotation != null && !field.isSynthetic() && !java.lang.reflect.Modifier.isStatic (field.getModifiers()) && typeof(string).isAssignableFrom (field.getType())) { com.arangodb.entity.DocumentFieldAttribute.Type value = annotation.value(); if (values.contains(value)) { field.setAccessible(true); fields[value] = field; values.remove(value); } } }