Skip to main content
summaryrefslogtreecommitdiffstats
blob: 4d089d8d897b3d29bdb7e13a622a9d93560a942b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
/*******************************************************************************
 * Copyright (c) 2001, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Jens Lukowski/Innoopract - initial renaming/restructuring
 *     
 *******************************************************************************/
package org.eclipse.wst.sse.ui.internal;



import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.dnd.TransferData;
import org.eclipse.wst.sse.ui.internal.extension.DropActionProxy;
import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
import org.osgi.framework.Bundle;


/**
 * Builds drop target transfers, drag source transfers, and drop actions
 */
public class TransferBuilder extends RegistryReader {

	public static final String ATT_CLASS = "class"; //$NON-NLS-1$
	public static final String ATT_ID = "id"; //$NON-NLS-1$
	public static final String ATT_METHOD = "method"; //$NON-NLS-1$
	public static final String ATT_PRIORITY = "priority"; //$NON-NLS-1$
	public static final String ATT_SINGLETON = "singleton"; //$NON-NLS-1$
	public static final String ATT_TARGET_ID = "targetID"; //$NON-NLS-1$
	public static final String ATT_TRANSFER_ID = "transferID"; //$NON-NLS-1$

	private final static boolean debugTime = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/transferbuilder/time")); //$NON-NLS-1$  //$NON-NLS-2$

	public static final String PL_DRAG_SOURCE_TRANSFERS = "dragSourceTransfers"; //$NON-NLS-1$
	public static final String PL_DROP_TARGET_TRANSFERS = "dropTargetTransfers"; //$NON-NLS-1$

	public static final String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$

	public static final String[] PRIORITIES = {"highest", "high", "mid", "low", "lowest"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$

	public static final String TAG_DRAG_SOURCE_CONTRIBUTION = "dragSourceContribution"; //$NON-NLS-1$
	public static final String TAG_DROP_ACTION = "dropAction"; //$NON-NLS-1$
	public static final String TAG_DROP_TARGET_CONTRIBUTION = "dropTargetContribution"; //$NON-NLS-1$

	public static final String TAG_TRANSFER = "transfer"; //$NON-NLS-1$

	public static final String TRUE = "true"; //$NON-NLS-1$

	private boolean useProxy;

	class TransferProxyForDelayLoading extends Transfer {
	    private IConfigurationElement element;
	    private String classAttribute;
	    private Transfer proxy;
        private Method getTypeIdsMethod, getTypeNamesMethod, javaToNativeMethod, nativeToJavaMethod;

	    TransferProxyForDelayLoading() {
	        super();
	    }

	    TransferProxyForDelayLoading(IConfigurationElement elm, String clsAttr) {
	        super();
	        this.element = elm;
	        this.classAttribute = clsAttr;
	    }
	    
	    private Transfer newInstance() {
	        if ((element != null) && (classAttribute != null)) {
		        Object o = createExtension(element, classAttribute);
		        if (o instanceof Transfer) {
		            element = null;
		            classAttribute = null;
		            return (Transfer)o;
		        }
	        }
	        return null;
	    }

	    public TransferData[] getSupportedTypes() {
	        if (proxy == null) {
	            proxy = newInstance();
	        }
	        if (proxy != null) {
	            return proxy.getSupportedTypes();
	        }
	        return new TransferData[0];
        }
        protected int[] getTypeIds() {
	        if (proxy == null) {
	            proxy = newInstance();
	        }
	        if (proxy != null) {
                if (getTypeIdsMethod == null) {
    	            Class runtimeClass = proxy.getClass();
                    NoSuchMethodException e = null;
                    while (runtimeClass != null) {
        	            try {
        	                getTypeIdsMethod = runtimeClass.getDeclaredMethod("getTypeIds", new Class[0]);//$NON-NLS-1$
                            getTypeIdsMethod.setAccessible(true);
                            break;
        	            } catch (NoSuchMethodException e1) {
                            e = e1;
                            runtimeClass = runtimeClass.getSuperclass();
        	            } catch (SecurityException e2) {
                            runtimeClass = runtimeClass.getSuperclass();
        	            }
                    }
                    if ((getTypeIdsMethod == null) && (e != null)) {
                        Logger.logException(e);
                    }
                }
                if (getTypeIdsMethod != null) {
                    try {
                         // changed Integer[] return type to int[]
                        int[] r = (int[])getTypeIdsMethod.invoke(proxy, new Object[0]);
                        if ((r != null) && (r.length > 0)) {
                            int[] ret = new int[r.length];
                            for(int i = 0; i < r.length; i++) {
                                ret[i] = r[i];
                            }
                            return ret;
                        }
                    } catch (IllegalAccessException e2) {
                        Logger.logException(e2);
                    } catch (InvocationTargetException e3) {
                        Logger.logException(e3);
                    }
                }
	        }
            return new int[0];
        }
        protected String[] getTypeNames() {
	        if (proxy == null) {
	            proxy = newInstance();
	        }
	        if (proxy != null) {
                if (getTypeNamesMethod == null) {
    	            Class runtimeClass = proxy.getClass();
                    NoSuchMethodException e = null;
                    while (runtimeClass != null) {
        	            try {
        	                getTypeNamesMethod = runtimeClass.getDeclaredMethod("getTypeNames", new Class[0]);//$NON-NLS-1$
                            getTypeNamesMethod.setAccessible(true);
                            break;
        	            } catch (NoSuchMethodException e1) {
                            e = e1;
                            runtimeClass = runtimeClass.getSuperclass();
        	            } catch (SecurityException e2) {
                            runtimeClass = runtimeClass.getSuperclass();
        	            }
                    }
                    if ((getTypeNamesMethod == null) && (e != null)) {
                        Logger.logException(e);
                    }
                }
                if (getTypeNamesMethod != null) {
                    try {
                        return (String[])getTypeNamesMethod.invoke(proxy, new Object[0]);
                    } catch (IllegalAccessException e2) {
                        Logger.logException(e2);
                    } catch (InvocationTargetException e3) {
                        Logger.logException(e3);
                    }
                }
	        }
            return new String[0];
        }
        public boolean isSupportedType(TransferData transferData) {
	        if (proxy == null) {
	            proxy = newInstance();
	        }
	        if (proxy != null) {
	            return proxy.isSupportedType(transferData);
	        }
            return false;
        }
        protected void javaToNative(Object object, TransferData transferData) {
	        if (proxy == null) {
	            proxy = newInstance();
	        }
	        if (proxy != null) {
                if (javaToNativeMethod == null) {
                    Class runtimeClass = proxy.getClass();
                    NoSuchMethodException e = null;
                    while (runtimeClass != null) {
        	            try {
        	                javaToNativeMethod = runtimeClass.getDeclaredMethod("javaToNative", new Class[]{object.getClass(), transferData.getClass()});//$NON-NLS-1$
        	                javaToNativeMethod.setAccessible(true);
                            break;
        	            } catch (NoSuchMethodException e1) {
                            e = e1;
                            runtimeClass = runtimeClass.getSuperclass();
        	            } catch (SecurityException e2) {
                            runtimeClass = runtimeClass.getSuperclass();
        	            }
                    }
                    if ((javaToNativeMethod == null) && (e != null)) {
                        Logger.logException(e);
                    }
                }
                if (javaToNativeMethod != null) {
                    try {
                        javaToNativeMethod.invoke(proxy, new Object[]{object, transferData});
                    } catch (IllegalAccessException e2) {
                        Logger.logException(e2);
                    } catch (InvocationTargetException e3) {
                        Logger.logException(e3);
                    }
                }
	        }
        }
        protected Object nativeToJava(TransferData transferData) {
	        if (proxy == null) {
	            proxy = newInstance();
	        }
	        if (proxy != null) {
                if (nativeToJavaMethod == null) {
                    Class runtimeClass = proxy.getClass();
                    NoSuchMethodException e = null;
                    while (runtimeClass != null) {
                        try {
                            nativeToJavaMethod = runtimeClass.getDeclaredMethod("nativeToJava", new Class[]{transferData.getClass()});//$NON-NLS-1$
                            nativeToJavaMethod.setAccessible(true);
                            break;
                        } catch (NoSuchMethodException e1) {
                            e = e1;
                            runtimeClass = runtimeClass.getSuperclass();
        	            } catch (SecurityException e2) {
                            runtimeClass = runtimeClass.getSuperclass();
        	            }
                    }
                    if ((nativeToJavaMethod == null) && (e != null)) {
                        Logger.logException(e);
                    }
                }
                if (nativeToJavaMethod != null) {
                    try {
    	                return nativeToJavaMethod.invoke(proxy, new Object[]{transferData});
    	            } catch (IllegalAccessException e2) {
                   		Logger.logException(e2);
    	            } catch (InvocationTargetException e3) {
                   		Logger.logException(e3);
    	            }
                }
	        }
            return new Object();
        }
        Transfer getTransferClass() {
	        if (proxy == null) {
	            proxy = newInstance();
	        }
	        return proxy;
        }
	}
	/**
	 * @param element
	 * @param classAttribute
	 * @return Object
	 * @throws CoreException
	 */
	static Object createExecutableExtension(final IConfigurationElement element, final String classAttribute) throws CoreException {

		Object obj = null;

		String singleton = element.getAttribute(ATT_SINGLETON);
		String method = element.getAttribute(ATT_METHOD);
		if (TRUE.equalsIgnoreCase(singleton) && method != null) {
			try {
				String name = element.getAttribute(ATT_CLASS);
				String pluginId = element.getDeclaringExtension().getNamespace();
				Class cls = Platform.getBundle(pluginId).loadClass(name);
				Method mtd = cls.getMethod(method, new Class[]{});

				obj = mtd.invoke(null, null);
			} catch (ClassNotFoundException e) {
				obj = null;
			} catch (NoSuchMethodException e) {
				obj = null;
			} catch (IllegalAccessException e) {
				obj = null;
			} catch (InvocationTargetException e) {
				obj = null;
			}
		} else {
			obj = element.createExecutableExtension(classAttribute);
		}

		return obj;
	}

	/**
	 * Creates an extension. If the extension plugin has not been loaded a
	 * busy cursor will be activated during the duration of the load.
	 * 
	 * @param element
	 * @param classAttribute
	 * @return Object
	 * @throws CoreException
	 */
	public static Object createExtension(final IConfigurationElement element, final String classAttribute) {
		// If plugin has been loaded create extension.
		// Otherwise, show busy cursor then create extension.
		final Object[] result = new Object[1];
		String pluginId = element.getDeclaringExtension().getNamespace();
		Bundle bundle = Platform.getBundle(pluginId);
		if (bundle.getState() == Bundle.ACTIVE) {
			try {
				return createExecutableExtension(element, classAttribute);
			} catch (CoreException e) {
				handleCreateExecutableException(result, e);
			}
		} else {
			BusyIndicator.showWhile(null, new Runnable() {
				public void run() {
					try {
						result[0] = createExecutableExtension(element, classAttribute);
					} catch (Exception e) {
						handleCreateExecutableException(result, e);
					}
				}
			});
		}
		return result[0];
	}

	/**
	 * @param result
	 * @param e
	 */
	protected static void handleCreateExecutableException(Object[] result, Throwable e) {
		Logger.logException(e);
		result[0] = null;

	}

	protected List cache;
	protected String targetContributionTag;

	protected List targetIDs;

	/**
	 * @param element
	 * @return IDropAction
	 */
	protected IDropAction createDropAction(IConfigurationElement element) {
		Object obj = null;
		obj = createExtension(element, ATT_CLASS);
		if (obj == null)
			return null;
		return (obj instanceof IDropAction) ? (IDropAction) DropActionProxy.newInstance(obj) : null;
	}

	/**
	 * @param transferId
	 * @return IDropAction[]
	 */
	protected IDropAction[] createDropActions(String transferId) {
		if (cache == null)
			return new IDropAction[0];

		final int num = cache.size();
		if (num == 0)
			return new IDropAction[0];

		IDropAction[] as = new IDropAction[num];
		int j = 0;
		for (int p = 0; p < PRIORITIES.length; p++) {
			for (int i = 0; i < num; i++) {
				Object obj = cache.get(i);
				if (!(obj instanceof IConfigurationElement))
					continue;

				IConfigurationElement element = (IConfigurationElement) obj;
				if (!(TAG_DROP_ACTION.equals(element.getName())) || !(transferId.equals(element.getAttribute(ATT_TRANSFER_ID))))
					continue;

				if (PRIORITIES[p].equals(element.getAttribute(ATT_PRIORITY)) || (p == 2 && element.getAttribute(ATT_PRIORITY) == null)) {
					IDropAction a = createDropAction(element);
					if (a != null) {
						as[j] = a;
						j++;
					}
				}
			}
		}

		if (num == j)
			return as;

		IDropAction[] as2 = new IDropAction[j];
		for (int i = 0; i < j; i++) {
			as2[i] = as[i];
		}

		return as2;
	}

	/**
	 * @param element
	 * @return Transfer
	 */
	protected Transfer createTransfer(IConfigurationElement element) {
	    Object obj = null;
	    if (useProxy) {
	        obj = new TransferProxyForDelayLoading(element, ATT_CLASS);
	    } else {
	        obj = createExtension(element, ATT_CLASS);
	    }
		if (obj == null)
			return null;
		return (obj instanceof Transfer) ? (Transfer) obj : null;
	}

	/**
	 * @return Transfer[]
	 */
	protected Transfer[] createTransfers() {
		if (cache == null)
			return new Transfer[0];

		final int num = cache.size();
		if (num == 0)
			return new Transfer[0];

		Transfer[] ts = new Transfer[num];
		int j = 0;
		for (int p = 0; p < PRIORITIES.length; p++) {
			for (int i = 0; i < num; i++) {
				Object obj = cache.get(i);
				if (!(obj instanceof IConfigurationElement))
					continue;

				IConfigurationElement element = (IConfigurationElement) obj;
				if (!TAG_TRANSFER.equals(element.getName()))
					continue;

				if (PRIORITIES[p].equals(element.getAttribute(ATT_PRIORITY)) || (p == 2 && element.getAttribute(ATT_PRIORITY) == null)) {
					Transfer t = createTransfer(element);
					if (t != null) {
						ts[j] = t;
						j++;
					}
				}
			}
		}

		if (num == j)
			return ts;

		Transfer[] ts2 = new Transfer[j];
		for (int i = 0; i < j; i++) {
			ts2[i] = ts[i];
		}

		return ts2;
	}

	/**
	 * @param editorId
	 * @return Transfer[]
	 */
	public Transfer[] getDragSourceTransfers(String editorId) {
		return getDragSourceTransfers(new String[]{editorId});
	}

	/**
	 * @param editorIds
	 * @return Transfer[]
	 */
	public Transfer[] getDragSourceTransfers(String[] editorIds) {
		long time0 = System.currentTimeMillis();
		readContributions(editorIds, TAG_DRAG_SOURCE_CONTRIBUTION, PL_DRAG_SOURCE_TRANSFERS);
		Transfer[] transfers = createTransfers();
		if (debugTime)
			System.out.println(getClass().getName() + "#getDragSourceTransfers(" + editorIds + "): " + transfers.length + " transfers created in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
		return transfers;
	}

	/**
	 * @deprecated use getDropActions(String editorId, Transfer transfer) for the performance
	 * @param editorId
	 * @param className
	 * @return IDropAction[]
	 */
	public IDropAction[] getDropActions(String editorId, String transferClassName) {
		return getDropActions(new String[]{editorId}, transferClassName);
	}
	
	/**
	 * @param editorId
	 * @param class
	 * @return IDropAction[]
	 */
	public IDropAction[] getDropActions(String editorId, Transfer transfer) {
		return getDropActions(new String[]{editorId}, transfer);
	}
	/**
	 * @deprecated use getDropActions(String[] editorIds, Transfer transfer) for the performance
	 * @param editorId
	 * @param className
	 * @return IDropAction[]
	 */
	public IDropAction[] getDropActions(String[] editorIds, String transferClassName) {
		long time0 = System.currentTimeMillis();
		readContributions(editorIds, TAG_DROP_TARGET_CONTRIBUTION, PL_DROP_TARGET_TRANSFERS);
		String transferId = getTransferIdOfClassName(transferClassName);
		IDropAction[] actions = createDropActions(transferId);
		if (debugTime)
			System.out.println(getClass().getName() + "#getDropActions(" + editorIds + "): " + actions.length + " drop actions created in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
		return actions;
	}

	/**
	 * @param editorId
	 * @param class
	 * @return IDropAction[]
	 */
	public IDropAction[] getDropActions(String[] editorIds, Transfer transfer) {
	    String transferClassName;
	    if (transfer instanceof TransferProxyForDelayLoading) {
	        transferClassName = ((TransferProxyForDelayLoading)transfer).getTransferClass().getClass().getName();
	    } else {
	        transferClassName = transfer.getClass().getName();
	    }
	    return getDropActions(editorIds, transferClassName);
	}
	/**
	 * @param editorId
	 * @return Transfer[]
	 */
	public Transfer[] getDropTargetTransfers(String editorId) {
		return getDropTargetTransfers(new String[]{editorId});
	}

	/**
	 * @param editorIds
	 * @return Transfer[]
	 */
	public Transfer[] getDropTargetTransfers(String[] editorIds) {
		long time0 = System.currentTimeMillis();
		readContributions(editorIds, TAG_DROP_TARGET_CONTRIBUTION, PL_DROP_TARGET_TRANSFERS);
		Transfer[] transfers = createTransfers();
		if (debugTime) {
			String idlist = ""; //$NON-NLS-1$
			if (editorIds.length > 0) {
				for (int i = 0; i < editorIds.length; i++) {
					idlist += editorIds[i];
					if (i < editorIds.length - 1)
						idlist += ","; //$NON-NLS-1$
				}
			}
			System.out.println(getClass().getName() + "#getDropTargetTransfers(" + idlist + "): " + transfers.length + " transfers created in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
		}
		return transfers;
	}

	/**
	 * Returns the name of the part ID attribute that is expected in the
	 * target extension.
	 * 
	 * @param element
	 * @return String
	 */
	protected String getTargetID(IConfigurationElement element) {
		String value = element.getAttribute(ATT_TARGET_ID);
		return value != null ? value : "???"; //$NON-NLS-1$
	}

	/**
	 * @param className
	 * @return String
	 */
	private String getTransferIdOfClassName(String className) {
		String id = ""; //$NON-NLS-1$
		final int num = cache.size();
		if (className == null || cache == null || num == 0)
			return id;

		for (int i = 0; i < num; i++) {
			Object obj = cache.get(i);
			if (obj instanceof IConfigurationElement) {
				IConfigurationElement element = (IConfigurationElement) obj;
				if (className.equals(element.getAttribute(ATT_CLASS))) {
					id = element.getAttribute(ATT_ID);
					break;
				}
			}
		}

		return (id.length() != 0 ? id : className);
	}

	/**
	 * Reads the contributions from the registry for the provided workbench
	 * part and the provided extension point ID.
	 * 
	 * @param id
	 * @param tag
	 * @param extensionPoint
	 */
	protected void readContributions(String[] ids, String tag, String extensionPoint) {
		cache = null;
		targetIDs = Arrays.asList(ids);
		targetContributionTag = tag;
		IExtensionRegistry registry = Platform.getExtensionRegistry();
		readRegistry(registry, PLUGIN_ID, extensionPoint);
	}

	protected boolean readElement(IConfigurationElement element) {
		String tag = element.getName();
		if (tag.equals(targetContributionTag)) {
			String id = getTargetID(element);
			if (id == null || !targetIDs.contains(id)) {
				// This is not of interest to us - don't go deeper
				return true;
			}
		} else if (tag.equals(TAG_TRANSFER)) {
			if (cache == null)
				cache = new ArrayList();
			cache.add(element);
			return true; // just cache the element - don't go into it
		} else if (tag.equals(TAG_DROP_ACTION)) {
			if (cache == null)
				cache = new ArrayList();
			//cache.add(createActionDescriptor(element));
			cache.add(element);
			return true; // just cache the action - don't go into
		} else {
			return false;
		}

		readElementChildren(element);
		return true;
	}
	/**
	 * @deprecated - use TransferBuilder(boolean useProxy) for the performance
	 */
	public TransferBuilder() {
        this(false);
    }

    public TransferBuilder(boolean useProxy) {
        super();
        this.useProxy = useProxy;
    }
}

Back to the top