/** * Gets the default value specified by the annotation. * * @return The default value. */ private String getDefault() { return mAnnotation.defaultValue(); } }
/** * Gets the default value as an int. * * @param instance The object instance. * @return The default int value. * @throws IllegalAccessException If the field cannot be read. */ private int getDefaultInt(Object instance) throws IllegalAccessException { String defaultValue = mAnnotation.defaultValue(); if (defaultValue.isEmpty()) { return mField.getInt(instance); } return Integer.parseInt(defaultValue); }
/** * Gets the default value as a string. * * @param instance The object instance. * @return The default string value. * @throws IllegalAccessException If the field cannot be read. */ private String getDefaultString(Object instance) throws IllegalAccessException { String defaultValue = mAnnotation.defaultValue(); if (defaultValue.isEmpty()) { return (String) mField.get(instance); } return defaultValue; } }
/** * Gets the default value as a long. * * @param instance The object instance. * @return The default long value. * @throws IllegalAccessException If the field cannot be read. */ private long getDefaultLong(Object instance) throws IllegalAccessException { String defaultValue = mAnnotation.defaultValue(); if (defaultValue.isEmpty()) { return mField.getLong(instance); } return Long.parseLong(defaultValue); }
/** * Gets the default value as a boolean. * * @param instance The object instance. * @return The default boolean value. * @throws IllegalAccessException If the field cannot be read. */ private boolean getDefaultBoolean(Object instance) throws IllegalAccessException { String defaultValue = mAnnotation.defaultValue(); if (defaultValue.isEmpty()) { return mField.getBoolean(instance); } return Boolean.parseBoolean(defaultValue); }
/** * Gets the default value as a double. * * @param instance The object instance. * @return The default double value. * @throws IllegalAccessException If the field cannot be read. */ private float getDefaultDouble(Object instance) throws IllegalAccessException { String defaultValue = mAnnotation.defaultValue(); if (defaultValue.isEmpty()) { return (float) mField.getDouble(instance); } return Float.parseFloat(defaultValue); }
/** * Gets the default value as a float. * * @param instance The object instance. * @return The default float value. * @throws IllegalAccessException If the field cannot be read. */ private float getDefaultFloat(Object instance) throws IllegalAccessException { String defaultValue = mAnnotation.defaultValue(); if (defaultValue.isEmpty()) { return mField.getFloat(instance); } return Float.parseFloat(defaultValue); }
+ instance.getClass().getName() + "." + mField.getName()); if (null == conf.get(key) && mAnnotation.defaultValue().isEmpty()) {