/** * This is used to provide a configured empty value used when the * annotated value is null. This ensures that XML can be created * with required details regardless of whether values are null or * not. It also provides a means for sensible default values. * * @param context this is the context object for the serialization * * @return this returns the string to use for default values */ public Object getEmpty(Context context) throws Exception { Type map = new ClassType(type); Factory factory = new MapFactory(context, map); if(!label.empty()) { return factory.getInstance(); } return null; }
/** * This is used to provide a configured empty value used when the * annotated value is null. This ensures that XML can be created * with required details regardless of whether values are null or * not. It also provides a means for sensible default values. * * @param context this is the context object for the serialization * * @return this returns the string to use for default values */ public Object getEmpty(Context context) throws Exception { Type map = new ClassType(type); Factory factory = new MapFactory(context, map); if(!label.empty()) { return factory.getInstance(); } return null; }
/** * This is used to provide a configured empty value used when the * annotated value is null. This ensures that XML can be created * with required details regardless of whether values are null or * not. It also provides a means for sensible default values. * * @param context this is the context object for the serialization * * @return this returns the string to use for default values */ public Object getEmpty(Context context) throws Exception { Type map = new ClassType(type); Factory factory = new MapFactory(context, map); if(!label.empty()) { return factory.getInstance(); } return null; }