/// <summary> /// Constructor for the <c>CompositeArray</c> object. This is /// given the array type for the contact that is to be converted. An /// array of the specified type is used to hold the deserialized /// elements and will be the same length as the number of elements. /// </summary> /// <param name="context"> /// this is the context object used for serialization /// </param> /// <param name="type"> /// this is the field type for the array being used /// </param> /// <param name="entry"> /// this is the entry type for the array elements /// </param> /// <param name="parent"> /// this is the name to wrap the array element with /// </param> public CompositeArray(Context context, Type type, Type entry, String parent) { this.factory = new ArrayFactory(context, type); this.root = new Traverser(context); this.parent = parent; this.entry = entry; }
/// <summary> /// Constructor for the <c>PrimitiveArray</c> object. This is /// given the array type for the contact that is to be converted. An /// array of the specified type is used to hold the deserialized /// elements and will be the same length as the number of elements. /// </summary> /// <param name="context"> /// this is the context object used for serialization /// </param> /// <param name="type"> /// this is the actual field type from the schema /// </param> /// <param name="entry"> /// the entry type to be stored within the array /// </param> /// <param name="parent"> /// this is the name to wrap the array element with /// </param> public PrimitiveArray(Context context, Type type, Type entry, String parent) { this.factory = new ArrayFactory(context, type); this.root = new Primitive(context, entry); this.parent = parent; this.entry = entry; }
/// <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 array = new ClassType(type); Factory factory = new ArrayFactory(context, array); if(!label.empty()) { return factory.getInstance(); } return null; }
/// <summary> /// Constructor for the <c>CompositeArray</c> object. This is /// given the array type for the contact that is to be converted. An /// array of the specified type is used to hold the deserialized /// elements and will be the same length as the number of elements. /// </summary> /// <param name="context"> /// this is the context object used for serialization /// </param> /// <param name="type"> /// this is the field type for the array being used /// </param> /// <param name="entry"> /// this is the entry type for the array elements /// </param> /// <param name="parent"> /// this is the name to wrap the array element with /// </param> public CompositeArray(Context context, Type type, Type entry, String parent) { this.factory = new ArrayFactory(context, type); this.root = new Traverser(context); this.parent = parent; this.entry = entry; }
/// <summary> /// Constructor for the <c>PrimitiveArray</c> object. This is /// given the array type for the contact that is to be converted. An /// array of the specified type is used to hold the deserialized /// elements and will be the same length as the number of elements. /// </summary> /// <param name="context"> /// this is the context object used for serialization /// </param> /// <param name="type"> /// this is the actual field type from the schema /// </param> /// <param name="entry"> /// the entry type to be stored within the array /// </param> /// <param name="parent"> /// this is the name to wrap the array element with /// </param> public PrimitiveArray(Context context, Type type, Type entry, String parent) { this.factory = new ArrayFactory(context, type); this.root = new Primitive(context, entry); this.parent = parent; this.entry = entry; }