/// <summary> /// 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. /// </summary> /// <param name="context"> /// this is the context object for the serialization /// </param> /// <returns> /// this returns the string to use for default values /// </returns> public Object GetEmpty(Context context) { Type list = new ClassType(type); Factory factory = new CollectionFactory(context, list); if(!label.empty()) { return factory.getInstance(); } return null; }
/// <summary> /// 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. /// </summary> /// <param name="context"> /// this is the context object for the serialization /// </param> /// <returns> /// this returns the string to use for default values /// </returns> public Object GetEmpty(Context context) { Type array = new ClassType(type); Factory factory = new ArrayFactory(context, array); if(!label.empty()) { return factory.getInstance(); } return null; }
/// <summary> /// 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. /// </summary> /// <param name="context"> /// this is the context object for the serialization /// </param> /// <returns> /// this returns the string to use for default values /// </returns> public Object GetEmpty(Context context) { Type map = new ClassType(type); Factory factory = new MapFactory(context, map); if(!label.empty()) { return factory.getInstance(); } return null; }