~ubuntu-branches/ubuntu/trusty/libstruts1.2-java/trusty-proposed

« back to all changes in this revision

Viewing changes to src/share/org/apache/struts/taglib/html/ImgTag.java

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2004-11-19 15:35:25 UTC
  • Revision ID: james.westby@ubuntu.com-20041119153525-mdu08a76z4zo67xt
Tags: upstream-1.2.4
ImportĀ upstreamĀ versionĀ 1.2.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java,v 1.41 2004/08/24 22:53:35 husted Exp $
 
3
 * $Revision: 1.41 $
 
4
 * $Date: 2004/08/24 22:53:35 $
 
5
 *
 
6
 * Copyright 1999-2004 The Apache Software Foundation.
 
7
 * 
 
8
 * Licensed under the Apache License, Version 2.0 (the "License");
 
9
 * you may not use this file except in compliance with the License.
 
10
 * You may obtain a copy of the License at
 
11
 * 
 
12
 *      http://www.apache.org/licenses/LICENSE-2.0
 
13
 * 
 
14
 * Unless required by applicable law or agreed to in writing, software
 
15
 * distributed under the License is distributed on an "AS IS" BASIS,
 
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
17
 * See the License for the specific language governing permissions and
 
18
 * limitations under the License.
 
19
 */
 
20
 
 
21
package org.apache.struts.taglib.html;
 
22
 
 
23
import java.util.Iterator;
 
24
import java.util.Map;
 
25
 
 
26
import javax.servlet.http.HttpServletRequest;
 
27
import javax.servlet.http.HttpServletResponse;
 
28
import javax.servlet.jsp.JspException;
 
29
 
 
30
import org.apache.struts.Globals;
 
31
import org.apache.struts.config.ModuleConfig;
 
32
import org.apache.struts.taglib.TagUtils;
 
33
import org.apache.struts.util.MessageResources;
 
34
import org.apache.struts.util.ModuleUtils;
 
35
 
 
36
/**
 
37
 * Generate an IMG tag to the specified image URI.
 
38
 * <p>
 
39
 * TODO:
 
40
 * <ul>
 
41
 *   <li>Make the <strong>alt</strong>, <strong>src</strong>, and
 
42
 *       <strong>lowsrc</strong> settable from properties (for i18n)</li>
 
43
 * </ul>
 
44
 *
 
45
 * @version $Revision: 1.41 $
 
46
 */
 
47
 
 
48
public class ImgTag extends BaseHandlerTag {
 
49
 
 
50
    // ------------------------------------------------------------- Properties
 
51
 
 
52
     /**
 
53
     * The property to specify where to align the image.
 
54
     */
 
55
    protected String align = null;
 
56
 
 
57
    public String getAlign() {
 
58
        return (this.align);
 
59
    }
 
60
 
 
61
    public void setAlign(String align) {
 
62
        this.align = align;
 
63
    }
 
64
 
 
65
    /**
 
66
     * The border size around the image.
 
67
     */
 
68
    protected String border = null;
 
69
 
 
70
    public String getBorder() {
 
71
        return (this.border);
 
72
    }
 
73
 
 
74
    public void setBorder(String border) {
 
75
        this.border = border;
 
76
    }
 
77
 
 
78
    /**
 
79
      * The property to specify how to root the image.
 
80
      * If 'true' or if there is no current module the image is
 
81
      * rooted to the application context path
 
82
      * If 'false' or absent the image is rooted to the current
 
83
      * module's context path.
 
84
      * @deprecated Use module property instead; will be removed in a release after 1.2.0.
 
85
      */
 
86
     protected String contextRelative = null;
 
87
 
 
88
     /** @deprecated Use module property instead; will be removed in a release after 1.2.0.
 
89
      */
 
90
     public String getContextRelative() {
 
91
         return (this.contextRelative);
 
92
     }
 
93
 
 
94
    /** @deprecated Use module property instead; will be removed in a release after 1.2.0.
 
95
     */
 
96
     public void setContextRelative(String contextRelative) {
 
97
         this.contextRelative = contextRelative;
 
98
     }
 
99
 
 
100
 
 
101
    /**
 
102
     * Convenience method to return true if contextRelative set to "true".
 
103
     * @return True if contextRelative set to "true"
 
104
     * @deprecated Use module property instead; will be removed in a release after 1.2.0.
 
105
     */
 
106
    public boolean isContextRelativeSet() {
 
107
        return Boolean.valueOf(this.contextRelative).booleanValue();
 
108
    }
 
109
 
 
110
    /**
 
111
     * The image height.
 
112
     */
 
113
    protected String height = null;
 
114
 
 
115
    public String getHeight() {
 
116
        return (this.height);
 
117
    }
 
118
 
 
119
    public void setHeight(String height) {
 
120
        this.height = height;
 
121
    }
 
122
 
 
123
    /**
 
124
     * The horizontal spacing around the image.
 
125
     */
 
126
    protected String hspace = null;
 
127
 
 
128
    public String getHspace() {
 
129
        return (this.hspace);
 
130
    }
 
131
 
 
132
    public void setHspace(String hspace) {
 
133
        this.hspace = hspace;
 
134
    }
 
135
 
 
136
    /**
 
137
     * The image name for named images.
 
138
     */
 
139
    protected String imageName = null;
 
140
 
 
141
    public String getImageName() {
 
142
        return (this.imageName);
 
143
    }
 
144
 
 
145
    public void setImageName(String imageName) {
 
146
        this.imageName = imageName;
 
147
    }
 
148
 
 
149
    /**
 
150
     * Server-side image map declaration.
 
151
     */
 
152
    protected String ismap = null;
 
153
 
 
154
    public String getIsmap() {
 
155
        return (this.ismap);
 
156
    }
 
157
 
 
158
    public void setIsmap(String ismap) {
 
159
        this.ismap = ismap;
 
160
    }
 
161
 
 
162
    /**
 
163
     * The low resolution image source URI.
 
164
     * @deprecated This is not defined in the HTML 4.01 spec and will be removed in a
 
165
     * future version of Struts.
 
166
     */
 
167
    protected String lowsrc = null;
 
168
 
 
169
    /**
 
170
     * @deprecated This is not defined in the HTML 4.01 spec and will be removed in a
 
171
     * future version of Struts.
 
172
     */
 
173
    public String getLowsrc() {
 
174
        return (this.lowsrc);
 
175
    }
 
176
 
 
177
    public void setLowsrc(String lowsrc) {
 
178
        this.lowsrc = lowsrc;
 
179
    }
 
180
 
 
181
    /**
 
182
     * The message resources for this package.
 
183
     */
 
184
    protected static MessageResources messages =
 
185
        MessageResources.getMessageResources(Constants.Package + ".LocalStrings");
 
186
 
 
187
    /**
 
188
     * The JSP bean name for query parameters.
 
189
     */
 
190
    protected String name = null;
 
191
 
 
192
    public String getName() {
 
193
        return (this.name);
 
194
    }
 
195
 
 
196
    public void setName(String name) {
 
197
        this.name = name;
 
198
    }
 
199
 
 
200
    /**
 
201
     * The module-relative path, starting with a slash character, of the
 
202
     * image to be displayed by this rendered tag.
 
203
     */
 
204
    protected String page = null;
 
205
 
 
206
    public String getPage() {
 
207
        return (this.page);
 
208
    }
 
209
 
 
210
    public void setPage(String page) {
 
211
        this.page = page;
 
212
    }
 
213
 
 
214
    /**
 
215
     * The message resources key under which we should look up the
 
216
     * <code>page</code> attribute for this generated tag, if any.
 
217
     */
 
218
    protected String pageKey = null;
 
219
 
 
220
    public String getPageKey() {
 
221
        return (this.pageKey);
 
222
    }
 
223
 
 
224
    public void setPageKey(String pageKey) {
 
225
        this.pageKey = pageKey;
 
226
    }
 
227
 
 
228
    /**
 
229
     * The module-relative action (beginning with a slash) which will be
 
230
     * used as the source for this image.
 
231
     */
 
232
    protected String action = null;
 
233
 
 
234
    public String getAction() {
 
235
        return (this.action);
 
236
    }
 
237
 
 
238
    public void setAction(String action) {
 
239
        this.action = action;
 
240
    }
 
241
 
 
242
        /**
 
243
         * The module prefix (beginning with a slash) which will be
 
244
         * used to find the action for this link.
 
245
         */
 
246
        protected String module = null;
 
247
 
 
248
        public String getModule() {
 
249
                return (this.module);
 
250
        }
 
251
 
 
252
        public void setModule(String module) {
 
253
                this.module = module;
 
254
        }
 
255
 
 
256
    /**
 
257
     * In situations where an image is dynamically generated (such as to create
 
258
     * a chart graph), this specifies the single-parameter request parameter
 
259
     * name to generate.
 
260
     */
 
261
    protected String paramId = null;
 
262
 
 
263
    public String getParamId() {
 
264
        return (this.paramId);
 
265
    }
 
266
 
 
267
    public void setParamId(String paramId) {
 
268
        this.paramId = paramId;
 
269
    }
 
270
 
 
271
    /**
 
272
     * The single-parameter JSP bean name.
 
273
     */
 
274
    protected String paramName = null;
 
275
 
 
276
    public String getParamName() {
 
277
        return (this.paramName);
 
278
    }
 
279
 
 
280
    public void setParamName(String paramName) {
 
281
        this.paramName = paramName;
 
282
    }
 
283
 
 
284
    /**
 
285
     * The single-parameter JSP bean property.
 
286
     */
 
287
    protected String paramProperty = null;
 
288
 
 
289
    public String getParamProperty() {
 
290
        return (this.paramProperty);
 
291
    }
 
292
 
 
293
    public void setParamProperty(String paramProperty) {
 
294
        this.paramProperty = paramProperty;
 
295
    }
 
296
 
 
297
    /**
 
298
     * The single-parameter JSP bean scope.
 
299
     */
 
300
    protected String paramScope = null;
 
301
 
 
302
    public String getParamScope() {
 
303
        return (this.paramScope);
 
304
    }
 
305
 
 
306
    public void setParamScope(String paramScope) {
 
307
        this.paramScope = paramScope;
 
308
    }
 
309
 
 
310
    /**
 
311
     * The JSP bean property name for query parameters.
 
312
     */
 
313
    protected String property = null;
 
314
 
 
315
    public String getProperty() {
 
316
        return (this.property);
 
317
    }
 
318
 
 
319
    public void setProperty(String property) {
 
320
        this.property = property;
 
321
    }
 
322
 
 
323
    /**
 
324
     * The scope of the bean specified by the name property, if any.
 
325
     */
 
326
    protected String scope = null;
 
327
 
 
328
    public String getScope() {
 
329
        return (this.scope);
 
330
    }
 
331
 
 
332
    public void setScope(String scope) {
 
333
        this.scope = scope;
 
334
    }
 
335
 
 
336
    /**
 
337
     * The image source URI.
 
338
     */
 
339
    protected String src = null;
 
340
 
 
341
    public String getSrc() {
 
342
        return (this.src);
 
343
    }
 
344
 
 
345
    public void setSrc(String src) {
 
346
        this.src = src;
 
347
    }
 
348
 
 
349
    /**
 
350
     * The message resources key under which we should look up the
 
351
     * <code>src</code> attribute for this generated tag, if any.
 
352
     */
 
353
    protected String srcKey = null;
 
354
 
 
355
    public String getSrcKey() {
 
356
        return (this.srcKey);
 
357
    }
 
358
 
 
359
    public void setSrcKey(String srcKey) {
 
360
        this.srcKey = srcKey;
 
361
    }
 
362
 
 
363
    /**
 
364
     * Client-side image map declaration.
 
365
     */
 
366
    protected String usemap = null;
 
367
 
 
368
    public String getUsemap() {
 
369
        return (this.usemap);
 
370
    }
 
371
 
 
372
    public void setUsemap(String usemap) {
 
373
        this.usemap = usemap;
 
374
    }
 
375
 
 
376
    /**
 
377
     * The vertical spacing around the image.
 
378
     */
 
379
    protected String vspace = null;
 
380
 
 
381
    public String getVspace() {
 
382
        return (this.vspace);
 
383
    }
 
384
 
 
385
    public void setVspace(String vspace) {
 
386
        this.vspace = vspace;
 
387
    }
 
388
 
 
389
    /**
 
390
     * The image width.
 
391
     */
 
392
    protected String width = null;
 
393
 
 
394
    public String getWidth() {
 
395
        return (this.width);
 
396
    }
 
397
 
 
398
    public void setWidth(String width) {
 
399
        this.width = width;
 
400
    }
 
401
 
 
402
        protected boolean useLocalEncoding = false;
 
403
    
 
404
    public boolean isUseLocalEncoding() {
 
405
           return useLocalEncoding;
 
406
    }
 
407
 
 
408
    public void setUseLocalEncoding(boolean b) {
 
409
           useLocalEncoding = b;
 
410
    }
 
411
   
 
412
   // --------------------------------------------------------- Public Methods
 
413
 
 
414
    /**
 
415
     * Render the beginning of the IMG tag.
 
416
     *
 
417
     * @exception JspException if a JSP exception has occurred
 
418
     */
 
419
    public int doStartTag() throws JspException {
 
420
 
 
421
        // Evaluate the body of this tag
 
422
        return (EVAL_BODY_TAG);
 
423
 
 
424
    }
 
425
 
 
426
    /**
 
427
     * Render the end of the IMG tag.
 
428
     *
 
429
     * @exception JspException if a JSP exception has occurred
 
430
     */
 
431
    public int doEndTag() throws JspException {
 
432
 
 
433
        // Generate the name definition or image element
 
434
        HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
 
435
        StringBuffer results = new StringBuffer("<img");
 
436
        String tmp = src();
 
437
        String srcurl = url(tmp);
 
438
        if (srcurl != null) {
 
439
            results.append(" src=\"");
 
440
            results.append(response.encodeURL(srcurl));
 
441
            results.append("\"");
 
442
        }
 
443
        String lowsrcurl = url(this.lowsrc);
 
444
        if (lowsrcurl != null) {
 
445
            results.append(" lowsrc=\"");
 
446
            results.append(response.encodeURL(lowsrcurl));
 
447
            results.append("\"");
 
448
        }
 
449
        if (imageName != null) {
 
450
            results.append(" name=\"");
 
451
            results.append(imageName);
 
452
            results.append("\"");
 
453
        }
 
454
        if (height != null) {
 
455
            results.append(" height=\"");
 
456
            results.append(height);
 
457
            results.append("\"");
 
458
        }
 
459
        if (width != null) {
 
460
            results.append(" width=\"");
 
461
            results.append(width);
 
462
            results.append("\"");
 
463
        }
 
464
        if (align != null) {
 
465
            results.append(" align=\"");
 
466
            results.append(align);
 
467
            results.append("\"");
 
468
        }
 
469
        if (border != null) {
 
470
            results.append(" border=\"");
 
471
            results.append(border);
 
472
            results.append("\"");
 
473
        }
 
474
        if (hspace != null) {
 
475
            results.append(" hspace=\"");
 
476
            results.append(hspace);
 
477
            results.append("\"");
 
478
        }
 
479
        if (vspace != null) {
 
480
            results.append(" vspace=\"");
 
481
            results.append(vspace);
 
482
            results.append("\"");
 
483
        }
 
484
        if (ismap != null) {
 
485
            results.append(" ismap=\"");
 
486
            results.append(ismap);
 
487
            results.append("\"");
 
488
        }
 
489
        if (usemap != null) {
 
490
            results.append(" usemap=\"");
 
491
            results.append(usemap);
 
492
            results.append("\"");
 
493
        }
 
494
        results.append(prepareStyles());
 
495
        results.append(prepareEventHandlers());
 
496
        results.append(getElementClose());
 
497
 
 
498
        TagUtils.getInstance().write(pageContext, results.toString());
 
499
 
 
500
        return (EVAL_PAGE);
 
501
 
 
502
    }
 
503
 
 
504
    /**
 
505
     * Release any acquired resources.
 
506
     */
 
507
    public void release() {
 
508
 
 
509
        super.release();
 
510
 
 
511
        border = null;
 
512
        height = null;
 
513
        hspace = null;
 
514
        imageName = null;
 
515
        ismap = null;
 
516
        lowsrc = null;
 
517
        name = null;
 
518
        page = null;
 
519
        pageKey = null;
 
520
        action = null;
 
521
        paramId = null;
 
522
        paramName = null;
 
523
        paramProperty = null;
 
524
        paramScope = null;
 
525
        property = null;
 
526
        scope = null;
 
527
        src = null;
 
528
        srcKey = null;
 
529
        usemap = null;
 
530
        vspace = null;
 
531
        width = null;
 
532
 
 
533
    }
 
534
 
 
535
    // ------------------------------------------------------ Protected Methods
 
536
 
 
537
    /**
 
538
     * Convenience method to throw a "imgTag.src" exception.
 
539
     * @throws JspException
 
540
     */
 
541
    private void throwImgTagSrcException() throws JspException {
 
542
        JspException e = new JspException(messages.getMessage("imgTag.src"));
 
543
        TagUtils.getInstance().saveException(pageContext, e);
 
544
        throw e;
 
545
    }
 
546
 
 
547
    /**
 
548
     * Convenience method to test whether this is the default module
 
549
     * or if contestRelative has been set.
 
550
     * @param config Our Moduleconfig
 
551
     * @return True if this is the default module or contextRelative is set
 
552
     */
 
553
    private boolean srcDefaultReference(ModuleConfig config) {
 
554
       return (config == null || isContextRelativeSet());
 
555
    }
 
556
 
 
557
    /**
 
558
     * Return the base source URL that will be rendered in the <code>src</code>
 
559
     * property for this generated element, or <code>null</code> if there is
 
560
     * no such URL.
 
561
     *
 
562
     * @exception JspException if an error occurs
 
563
     */
 
564
    protected String src() throws JspException {
 
565
 
 
566
        // Deal with a direct context-relative page that has been specified
 
567
        if (this.page != null) {
 
568
            if ((this.src != null) || (this.srcKey != null) || (this.pageKey != null)) {
 
569
                throwImgTagSrcException();
 
570
            }
 
571
            ModuleConfig config = 
 
572
                ModuleUtils.getInstance().getModuleConfig(
 
573
                        this.module,
 
574
                        (HttpServletRequest) pageContext.getRequest(),
 
575
                        pageContext.getServletContext());                
 
576
            
 
577
            HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
 
578
            if (srcDefaultReference(config)) {
 
579
                return (request.getContextPath() + this.page);
 
580
            } else {
 
581
                return (request.getContextPath() + config.getPrefix() + this.page);
 
582
            }
 
583
        }
 
584
 
 
585
        // Deal with an indirect context-relative page that has been specified
 
586
        if (this.pageKey != null) {
 
587
            if ((this.src != null) || (this.srcKey != null)) {
 
588
                throwImgTagSrcException();
 
589
            }
 
590
            ModuleConfig config =
 
591
                ModuleUtils.getInstance().getModuleConfig(
 
592
                        this.module,
 
593
                        (HttpServletRequest) pageContext.getRequest(),
 
594
                        pageContext.getServletContext());
 
595
            
 
596
            HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
 
597
            if (srcDefaultReference(config)) {
 
598
                return (
 
599
                    request.getContextPath()
 
600
                        + TagUtils.getInstance().message(
 
601
                            pageContext,
 
602
                            getBundle(),
 
603
                            getLocale(),
 
604
                            this.pageKey));
 
605
            } else {
 
606
                return (
 
607
                    request.getContextPath()
 
608
                        + config.getPrefix()
 
609
                        + TagUtils.getInstance().message(
 
610
                            pageContext,
 
611
                            getBundle(),
 
612
                            getLocale(),
 
613
                            this.pageKey));
 
614
            }
 
615
        }
 
616
 
 
617
        if (this.action != null) {
 
618
            if ((this.src != null) || (this.srcKey != null)) {
 
619
                throwImgTagSrcException();
 
620
            }
 
621
            return TagUtils.getInstance().getActionMappingURL(action, module, pageContext, isContextRelativeSet());
 
622
        }
 
623
 
 
624
        // Deal with an absolute source that has been specified
 
625
        if (this.src != null) {
 
626
            if (this.srcKey != null) {
 
627
                throwImgTagSrcException();
 
628
            }
 
629
            return (this.src);
 
630
        }
 
631
 
 
632
        // Deal with an indirect source that has been specified
 
633
        if (this.srcKey == null) {
 
634
            throwImgTagSrcException();
 
635
        }
 
636
        
 
637
        return TagUtils.getInstance().message(
 
638
            pageContext,
 
639
            getBundle(),
 
640
            getLocale(),
 
641
            this.srcKey);
 
642
 
 
643
    }
 
644
 
 
645
    /**
 
646
     * Return the specified src URL, modified as necessary with optional
 
647
     * request parameters.
 
648
     *
 
649
     * @param url The URL to be modified (or null if this url will not be used)
 
650
     *
 
651
     * @exception JspException if an error occurs preparing the URL
 
652
     */
 
653
    protected String url(String url) throws JspException {
 
654
 
 
655
        if (url == null) {
 
656
            return (url);
 
657
        }
 
658
 
 
659
                String charEncoding = "UTF-8";
 
660
                if(useLocalEncoding){
 
661
                        charEncoding = pageContext.getResponse().getCharacterEncoding();
 
662
                }
 
663
                
 
664
        // Start with an unadorned URL as specified
 
665
        StringBuffer src = new StringBuffer(url);
 
666
 
 
667
        // Append a single-parameter name and value, if requested
 
668
        if ((paramId != null) && (paramName != null)) {
 
669
            if (src.toString().indexOf('?') < 0) {
 
670
                src.append('?');
 
671
            } else {
 
672
                src.append("&amp;");
 
673
            }
 
674
            src.append(paramId);
 
675
            src.append('=');
 
676
            Object value = TagUtils.getInstance().lookup(pageContext, paramName, paramProperty, paramScope);
 
677
            if (value != null)
 
678
                src.append(TagUtils.getInstance().encodeURL(value.toString(), charEncoding));
 
679
        }
 
680
 
 
681
        // Just return the URL if there is no bean to look up
 
682
        if ((property != null) && (name == null)) {
 
683
            JspException e = new JspException(messages.getMessage("getter.name"));
 
684
            TagUtils.getInstance().saveException(pageContext, e);
 
685
            throw e;
 
686
        }
 
687
 
 
688
        if (name == null) {
 
689
            return (src.toString());
 
690
        }
 
691
 
 
692
        // Look up the map we will be using
 
693
        Object mapObject = TagUtils.getInstance().lookup(pageContext, name, property, scope);
 
694
        Map map = null;
 
695
        try {
 
696
            map = (Map) mapObject;
 
697
        } catch (ClassCastException e) {
 
698
            TagUtils.getInstance().saveException(pageContext, e);
 
699
            throw new JspException(messages.getMessage("imgTag.type"));
 
700
        }
 
701
 
 
702
        // Append the required query parameters
 
703
        boolean question = (src.toString().indexOf("?") >= 0);
 
704
        Iterator keys = map.keySet().iterator();
 
705
        while (keys.hasNext()) {
 
706
            String key = (String) keys.next();
 
707
            Object value = map.get(key);
 
708
            if (value == null) {
 
709
                if (question) {
 
710
                    src.append("&amp;");
 
711
                } else {
 
712
                    src.append('?');
 
713
                    question = true;
 
714
                }
 
715
                src.append(key);
 
716
                src.append('=');
 
717
                // Interpret null as "no value specified"
 
718
            } else if (value instanceof String[]) {
 
719
                String values[] = (String[]) value;
 
720
                for (int i = 0; i < values.length; i++) {
 
721
                    if (question) {
 
722
                        src.append("&amp;");
 
723
                    } else {
 
724
                        src.append('?');
 
725
                        question = true;
 
726
                    }
 
727
                    src.append(key);
 
728
                    src.append('=');
 
729
                    src.append(TagUtils.getInstance().encodeURL(values[i], charEncoding));
 
730
                }
 
731
            } else {
 
732
 
 
733
                if (question) {
 
734
                    src.append("&amp;");
 
735
                } else {
 
736
                    src.append('?');
 
737
                    question = true;
 
738
                }
 
739
                src.append(key);
 
740
                src.append('=');
 
741
                src.append(TagUtils.getInstance().encodeURL(value.toString(), charEncoding));
 
742
            }
 
743
        }
 
744
 
 
745
        // Return the final result
 
746
        return (src.toString());
 
747
 
 
748
    }
 
749
 
 
750
}