/** * Constructor for the <code>CompositeArray</code> 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. * * @param context this is the context object used for serialization * @param type this is the field type for the array being used * @param entry this is the entry type for the array elements * @param parent this is the name to wrap the array element with */ 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; this.type = type; }
/** * Constructor for the <code>PrimitiveArray</code> 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. * * @param context this is the context object used for serialization * @param type this is the actual field type from the schema * @param entry the entry type to be stored within the array * @param parent this is the name to wrap the array element with */ 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; this.type = type; }
/** * Constructor for the <code>PrimitiveArray</code> 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. * * @param context this is the context object used for serialization * @param type this is the actual field type from the schema * @param entry the entry type to be stored within the array * @param parent this is the name to wrap the array element with */ 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; this.type = type; }
/** * Constructor for the <code>CompositeArray</code> 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. * * @param context this is the context object used for serialization * @param type this is the field type for the array being used * @param entry this is the entry type for the array elements * @param parent this is the name to wrap the array element with */ 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; this.type = type; }
/** * Constructor for the <code>CompositeArray</code> 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. * * @param context this is the context object used for serialization * @param type this is the field type for the array being used * @param entry this is the entry type for the array elements * @param parent this is the name to wrap the array element with */ 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; this.type = type; }
/** * Constructor for the <code>PrimitiveArray</code> 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. * * @param context this is the context object used for serialization * @param type this is the actual field type from the schema * @param entry the entry type to be stored within the array * @param parent this is the name to wrap the array element with */ 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; this.type = type; }
/** * 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 array = new ClassType(type); Factory factory = new ArrayFactory(context, array); 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 array = new ClassType(type); Factory factory = new ArrayFactory(context, array); 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 array = new ClassType(type); Factory factory = new ArrayFactory(context, array); if(!label.empty()) { return factory.getInstance(); } return null; }