final String fieldName = "skaFieldOrder";
try {
Field field = type.getDeclaredField(fieldName);
field.setAccessible(true);
if (!String[].class.equals(field.getType())) {
throw new SerializerException(fieldName + " of class: "
+ type.getName() + " must be of type String[]");
}
return new SkaFieldOrderComparator((String[]) field.get(null));
} catch (NoSuchFieldException e) {
return null;
} catch (IllegalAccessException e) {
throw new SerializerException("can't access field " + fieldName
+ " of class: " + type.getName());
} catch (NullPointerException e) {
throw new SerializerException(fieldName + " of class: " + type.getName()
+ " must be static");
}
}