-
-
Notifications
You must be signed in to change notification settings - Fork 72
/
SAXParserImpl.java
920 lines (801 loc) · 26.5 KB
/
SAXParserImpl.java
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
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
/* Woodstox Lite ("wool") XML processor
*
* Copyright (c) 2006- Tatu Saloranta, tatu.saloranta@iki.fi
*
* Licensed under the License specified in the file LICENSE which is
* included with the source code.
* You may not use this file except in compliance with the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.fasterxml.aalto.sax;
import java.io.*;
import java.net.URL;
import javax.xml.parsers.SAXParser;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import com.fasterxml.aalto.AaltoInputProperties;
import org.xml.sax.*;
import org.xml.sax.ext.Attributes2;
import org.xml.sax.ext.DeclHandler;
import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.ext.Locator2;
import org.xml.sax.helpers.DefaultHandler;
import com.fasterxml.aalto.in.*;
import com.fasterxml.aalto.stax.InputFactoryImpl;
import com.fasterxml.aalto.util.URLUtil;
@SuppressWarnings("deprecation")
class SAXParserImpl
extends SAXParser
implements Parser // SAX1
,XMLReader // SAX2
,Attributes2 // SAX2
,Locator2 // SAX2
{
final InputFactoryImpl _staxFactory;
/**
* Since the stream reader would mostly be just a wrapper around
* the underlying scanner (its main job is to implement Stax
* interface), we can and should just use the scanner. In effect,
* this class is then a replacement of StreamReaderImpl, when
* using SAX interfaces.
*/
protected XmlScanner _scanner;
protected AttributeCollector _attrCollector;
// // // Listeners attached:
protected ContentHandler _contentHandler;
protected DTDHandler _dtdHandler;
private EntityResolver _entityResolver;
private ErrorHandler _errorHandler;
private LexicalHandler _lexicalHandler;
private DeclHandler _declHandler;
// // // State:
private int _attrCount;
/*
/**********************************************************************
/* Life-cycle
/**********************************************************************
*/
SAXParserImpl(InputFactoryImpl sf)
{
_staxFactory = sf;
}
@Override
public final Parser getParser()
{
return this;
}
@Override
public final XMLReader getXMLReader()
{
return this;
}
/*
/**********************************************************************
/* Configuration, SAXParser
/**********************************************************************
*/
@Override
public boolean isNamespaceAware() {
return true;
}
@Override
public boolean isValidating() {
return false;
}
@Override
public Object getProperty(String name)
throws SAXNotRecognizedException, SAXNotSupportedException
{
SAXProperty stdProp = SAXUtil.findStdProperty(name);
if (stdProp != null) {
switch (stdProp) {
case DECLARATION_HANDLER:
return _declHandler;
case DOCUMENT_XML_VERSION:
// as per [Issue 9], provide version info (is it ok to return potentially null?)
return _scanner.getConfig().getXmlDeclVersion();
case DOM_NODE: // not implemented, won't be
return null;
case LEXICAL_HANDLER:
return _lexicalHandler;
case XML_STRING: // not implemented, won't be
return null;
}
}
SAXUtil.reportUnknownProperty(name);
return null;
}
@Override
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException
{
SAXProperty stdProp = SAXUtil.findStdProperty(name);
if (stdProp != null) {
switch (stdProp) {
case DECLARATION_HANDLER:
_declHandler = (DeclHandler) value;
return;
case DOCUMENT_XML_VERSION:
// as per [Issue 9]:
_scanner.getConfig().setXmlVersion((value == null) ? null : String.valueOf(value));
return;
case DOM_NODE: // not implemented, won't be
return;
case LEXICAL_HANDLER:
_lexicalHandler = (LexicalHandler) value;
return;
case XML_STRING: // not implemented, won't be
return;
}
}
SAXUtil.reportUnknownFeature(name);
}
/*
/**********************************************************************
/* Overrides, SAXParser
/**********************************************************************
*/
/* Have to override some methods from SAXParser; JDK
* implementation is sucky, as it tries to override
* many things it really should not...
*/
@Override
public void parse(InputSource is, HandlerBase hb)
throws SAXException, IOException
{
if (hb != null) {
/* Ok: let's ONLY set if there are no explicit sets... not
* extremely clear, but JDK tries to set them always so
* let's at least do damage control.
*/
if (_contentHandler == null) {
setDocumentHandler(hb);
}
if (_entityResolver == null) {
setEntityResolver(hb);
}
if (_errorHandler == null) {
setErrorHandler(hb);
}
if (_dtdHandler == null) {
setDTDHandler(hb);
}
}
parse(is);
}
@Override
public void parse(InputSource is, DefaultHandler dh)
throws SAXException, IOException
{
if (dh != null) {
/* Ok: let's ONLY set if there are no explicit sets... not
* extremely clear, but JDK tries to set them always so
* let's at least do damage control.
*/
if (_contentHandler == null) {
setContentHandler(dh);
}
if (_entityResolver == null) {
setEntityResolver(dh);
}
if (_errorHandler == null) {
setErrorHandler(dh);
}
if (_dtdHandler == null) {
setDTDHandler(dh);
}
}
parse(is);
}
/*
/**********************************************************************
/* XLMReader (SAX2) implementation: cfg access
/**********************************************************************
*/
@Override
public ContentHandler getContentHandler() {
return _contentHandler;
}
@Override
public DTDHandler getDTDHandler() {
return _dtdHandler;
}
@Override
public EntityResolver getEntityResolver() {
return _entityResolver;
}
@Override
public ErrorHandler getErrorHandler() {
return _errorHandler;
}
@Override
public boolean getFeature(String name)
throws SAXNotRecognizedException
{
// Standard feature?
SAXFeature stdFeat = SAXUtil.findStdFeature(name);
if (stdFeat != null) {
// fixed?
Boolean b = SAXUtil.getFixedStdFeatureValue(stdFeat);
if (b != null) {
return b.booleanValue();
}
// ok, may change:
switch (stdFeat) {
case IS_STANDALONE: // read-only, but only during parsing
// !!! TBI
return true;
case EXTERNAL_GENERAL_ENTITIES:
return Boolean.FALSE.equals(_staxFactory.getProperty(AaltoInputProperties.P_RETAIN_ATTRIBUTE_GENERAL_ENTITIES));
default:
}
} else {
// any non-standard one we may support?
}
// nope, not recognized:
SAXUtil.reportUnknownFeature(name);
return false; // never gets here
}
// Already implemented for SAXParser
//public Object getProperty(String name)
/*
/**********************************************************************
/* XLMReader (SAX2) implementation: cfg changing
/**********************************************************************
*/
@Override
public void setContentHandler(ContentHandler handler) {
_contentHandler = handler;
}
@Override
public void setDTDHandler(DTDHandler handler) {
_dtdHandler = handler;
}
@Override
public void setEntityResolver(EntityResolver resolver) {
_entityResolver = resolver;
}
@Override
public void setErrorHandler(ErrorHandler handler) {
_errorHandler = handler;
}
@Override
public void setFeature(String name, boolean value)
throws SAXNotRecognizedException
{
// Standard feature?
SAXFeature stdFeat = SAXUtil.findStdFeature(name);
if (stdFeat != null) {
//boolean ok;
// !!! TBI
/*
switch (stdFeat) {
}
*/
} else {
SAXUtil.reportUnknownFeature(name);
}
}
// Already implemented for SAXParser
//public void setProperty(String name, Object value)
/*
/**********************************************************************
/* XLMReader (SAX2) implementation: parsing
/**********************************************************************
*/
@Override
public void parse(InputSource input) throws SAXException
{
String enc = input.getEncoding();
String systemId = input.getSystemId();
/* Let's ask for default (non-event-reader-bound) reader
* first. One open question: whether auto-closing needs to be
* forced? For now, let's assume not (second false, first is for
* 'isForEventReader')
*/
ReaderConfig cfg = _staxFactory.getNonSharedConfig
(systemId, input.getPublicId(), enc, false, false);
/* But let's disable lazy parsing: with SAX there's no good
* way to make use of it (similar to why it's disabled for
* event readers)
*/
cfg.doParseLazily(false);
// Let's figure out input, first, before sending start-doc event
InputStream is = null;
Reader r = input.getCharacterStream();
if (r == null) {
is = input.getByteStream();
if (is == null) {
if (systemId == null) {
throw new SAXException("Invalid InputSource passed: neither character or byte stream passed, nor system id specified");
}
try {
URL url = URLUtil.urlFromSystemId(systemId);
is = URLUtil.inputStreamFromURL(url);
} catch (IOException ioe) {
SAXException saxe = new SAXException(ioe);
if (saxe.getCause() == null) {
saxe.initCause(ioe);
}
throw saxe;
}
}
}
if (_contentHandler != null) {
_contentHandler.setDocumentLocator(this);
_contentHandler.startDocument();
}
try {
if (r != null) {
_scanner = CharSourceBootstrapper.construct(cfg, r).bootstrap();
} else {
_scanner = ByteSourceBootstrapper.construct(cfg, is).bootstrap();
}
_attrCollector = _scanner.getAttrCollector();
fireEvents();
} catch (XMLStreamException strex) {
throwSaxException(strex);
} finally {
if (_contentHandler != null) {
_contentHandler.endDocument();
}
/* Could try holding onto the buffers, too... but
* maybe it's better to allow them to be reclaimed, if
* needed by GC
*/
if (_scanner != null) {
try {
_scanner.close(false); // false -> no forced closing of source
} catch (XMLStreamException strex) {
/* Hmmh. Should we bother trying to throw it? Should
* never really happen as it can only occur from
* stream.close() failing... which is a useless exception
* if it can occur. So, for once, let's just supress it.
*/
; // intentional no-action
}
_scanner = null;
}
if (r != null) {
try {
r.close();
} catch (IOException ioe) { /* whatever */ }
}
if (is != null) {
try {
is.close();
} catch (IOException ioe) { /* whatever */ }
}
}
}
@Override
public void parse(String systemId) throws SAXException
{
InputSource src = new InputSource(systemId);
parse(src);
}
/*
/**********************************************************************
/* Parsing loop, helper methods
/**********************************************************************
*/
/**
* This is the actual "tight event loop" that will send all events
* between start and end document events. Although we could
* use the stream reader here, there's not much as it mostly
* just forwards requests to the scanner: and so we can as well
* just copy the little code stream reader's next() method has.
*/
private final void fireEvents()
throws SAXException, XMLStreamException
{
// First we are in prolog:
int type;
while ((type = _scanner.nextFromProlog(true)) != XMLStreamConstants.START_ELEMENT) {
fireAuxEvent(type, false);
}
// Now just starting the tree, need to process the START_ELEMENT
fireStartTag();
int depth = 1;
while (true) {
type = _scanner.nextFromTree();
if (type == XMLStreamConstants.START_ELEMENT) {
fireStartTag();
++depth;
} else if (type == XMLStreamConstants.END_ELEMENT) {
fireEndTag();
if (--depth < 1) {
break;
}
} else if (type == XMLStreamConstants.CHARACTERS) {
_scanner.fireSaxCharacterEvents(_contentHandler);
} else {
fireAuxEvent(type, true);
}
}
// And then epilog:
while (true) {
type = _scanner.nextFromProlog(false);
if (type == XmlScanner.TOKEN_EOI) {
break;
}
if (type == XmlScanner.SPACE) {
/* Not to be reported via SAX interface (which may or may not
* be different from Stax)
*/
continue;
}
fireAuxEvent(type, false);
}
}
private final void fireAuxEvent(int type, boolean inTree)
throws SAXException, XMLStreamException
{
switch (type) {
case XMLStreamConstants.COMMENT:
_scanner.fireSaxCommentEvent(_lexicalHandler);
break;
case XMLStreamConstants.CDATA:
if (_lexicalHandler != null) {
_lexicalHandler.startCDATA();
_scanner.fireSaxCharacterEvents(_contentHandler);
_lexicalHandler.endCDATA();
} else {
_scanner.fireSaxCharacterEvents(_contentHandler);
}
break;
case XMLStreamConstants.DTD:
if (_lexicalHandler != null) {
PName n = _scanner.getName();
_lexicalHandler.startDTD(n.getPrefixedName(), _scanner.getDTDPublicId(),
_scanner.getDTDSystemId());
_lexicalHandler.endDTD();
}
break;
case XMLStreamConstants.PROCESSING_INSTRUCTION:
_scanner.fireSaxPIEvent(_contentHandler);
break;
case XMLStreamConstants.SPACE:
/* With SAX, only to be sent as an event if inside the
* tree, not from within prolog/epilog
*/
if (inTree) {
_scanner.fireSaxSpaceEvents(_contentHandler);
}
break;
default:
if (type == XmlScanner.TOKEN_EOI) {
throwSaxException("Unexpected end-of-input in "+(inTree ? "tree" : "prolog"));
}
throw new RuntimeException("Internal error: unexpected type, "+type);
}
}
private final void fireStartTag()
throws SAXException
{
_attrCount = _scanner.getAttrCount();
_scanner.fireSaxStartElement(_contentHandler, this);
}
private final void fireEndTag()
throws SAXException
{
_scanner.fireSaxEndElement(_contentHandler);
}
/*
/**********************************************************************
/* Parser (SAX1) implementation
/**********************************************************************
*/
// Already implemented for XMLReader:
//public void parse(InputSource source)
//public void parse(String systemId)
//public void setEntityResolver(EntityResolver resolver)
//public void setErrorHandler(ErrorHandler handler)
@Override
public void setDocumentHandler(DocumentHandler handler)
{
setContentHandler(new DocHandlerWrapper(handler));
}
@Override
public void setLocale(java.util.Locale locale)
{
// Not supported, let's just ignore
}
/*
/**********************************************************************
/* Attributes (SAX2) implementation
/**********************************************************************
*/
@Override
public int getIndex(String qName)
{
return (_attrCollector == null) ? -1 :
_attrCollector.findIndex(null, qName);
}
@Override
public int getIndex(String uri, String localName)
{
return (_attrCollector == null) ? -1 :
_attrCollector.findIndex(uri, localName);
}
@Override
public int getLength()
{
return _attrCount;
}
@Override
public String getLocalName(int index)
{
return (index < 0 || index >= _attrCount) ? null :
_attrCollector.getName(index).getLocalName();
}
@Override
public String getQName(int index)
{
return (index < 0 || index >= _attrCount) ? null :
_attrCollector.getName(index).getPrefixedName();
}
@Override
public String getType(int index)
{
/* 13-Sep-2006, tatus: Note: not yet really implemented, will
* just return "CDATA".
*/
return (index < 0 || index >= _attrCount) ? null :
_scanner.getAttrType(index);
}
@Override
public String getType(String qName)
{
int ix = getIndex(qName);
return (ix < 0) ? null : _scanner.getAttrType(ix);
}
@Override
public String getType(String uri, String localName)
{
int ix = getIndex(uri, localName);
return (ix < 0) ? null : _scanner.getAttrType(ix);
}
@Override
public String getURI(int index)
{
if (index < 0 || index >= _attrCount) {
return null;
}
String uri = _attrCollector.getName(index).getNsUri();
return (uri == null) ? "" : uri;
}
@Override
public String getValue(int index)
{
return (index < 0 || index >= _attrCount) ? null :
_attrCollector.getValue(index);
}
@Override
public String getValue(String qName)
{
int ix = getIndex(qName);
return (ix < 0) ? null : _attrCollector.getValue(ix);
}
@Override
public String getValue(String uri, String localName)
{
int ix = getIndex(uri, localName);
return (ix < 0) ? null : _attrCollector.getValue(ix);
}
/*
/**********************************************************************
/* Attributes2 (SAX2) implementation
/**********************************************************************
*/
/* Note: for now (in absence of DTD processing), none of attributes
* are declared, and all are specified (can not default without
* a DTD)
*/
@Override
public boolean isDeclared(int index) {
return false;
}
@Override
public boolean isDeclared(String qName) {
return false;
}
@Override
public boolean isDeclared(String uri, String localName) {
return false;
}
@Override
public boolean isSpecified(int index) {
return true;
}
@Override
public boolean isSpecified(String qName) {
return true;
}
@Override
public boolean isSpecified(String uri, String localName) {
return true;
}
/*
/**********************************************************************
/* Locator (SAX1) implementation
/**********************************************************************
*/
@Override
public int getColumnNumber() {
return (_scanner != null) ? _scanner.getCurrentColumnNr() : -1;
}
@Override
public int getLineNumber() {
return (_scanner != null) ? _scanner.getCurrentLineNr() : -1;
}
@Override
public String getPublicId() {
return (_scanner != null) ? _scanner.getInputPublicId() : null;
}
@Override
public String getSystemId() {
return (_scanner != null) ? _scanner.getInputSystemId() : null;
}
/*
/**********************************************************************
/* Locator2 (SAX2) implementation
/**********************************************************************
*/
@Override
public String getEncoding()
{
ReaderConfig cfg = _scanner.getConfig();
String enc = cfg.getActualEncoding();
if (enc == null) {
enc = cfg.getXmlDeclEncoding();
if (enc == null) {
enc = cfg.getExternalEncoding();
}
}
return enc;
}
@Override
public String getXMLVersion() {
return _scanner.getConfig().getXmlDeclVersion();
}
/*
/**********************************************************************
/* Internal methods
/**********************************************************************
*/
private void throwSaxException(Exception e)
throws SAXException
{
SAXParseException se = new SAXParseException(e.getMessage(), (Locator) this, e);
if (se.getCause() == null) {
se.initCause(e);
}
if (_errorHandler != null) {
_errorHandler.fatalError(se);
}
throw se;
}
private void throwSaxException(String msg)
throws SAXException
{
SAXParseException se = new SAXParseException(msg, (Locator) this);
if (_errorHandler != null) {
_errorHandler.fatalError(se);
}
throw se;
}
/*
/**********************************************************************
/* Helper classes for SAX1 support
/**********************************************************************
*/
final static class DocHandlerWrapper
implements ContentHandler
{
final DocumentHandler mDocHandler;
final AttributesWrapper mAttrWrapper = new AttributesWrapper();
DocHandlerWrapper(DocumentHandler h)
{
mDocHandler = h;
}
@Override
public void characters(char[] ch, int start, int length) throws SAXException {
mDocHandler.characters(ch, start, length);
}
@Override
public void endDocument() throws SAXException {
mDocHandler.endDocument();
}
@Override
public void endElement(String uri, String localName, String qName) throws SAXException
{
if (qName == null) {
qName = localName;
}
mDocHandler.endElement(qName);
}
@Override
public void endPrefixMapping(String prefix) {
// no equivalent in SAX1, ignore
}
@Override
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
{
mDocHandler.ignorableWhitespace(ch, start, length);
}
@Override
public void processingInstruction(String target, String data)
throws SAXException {
mDocHandler.processingInstruction(target, data);
}
@Override
public void setDocumentLocator(Locator locator) {
mDocHandler.setDocumentLocator(locator);
}
@Override
public void skippedEntity(String name) {
// no equivalent in SAX1, ignore
}
@Override
public void startDocument() throws SAXException
{
mDocHandler.startDocument();
}
@Override
public void startElement(String uri, String localName, String qName,
Attributes attrs)
throws SAXException
{
if (qName == null) {
qName = localName;
}
// Also, need to wrap Attributes to look like AttributeLost
mAttrWrapper.setAttributes(attrs);
mDocHandler.startElement(qName, mAttrWrapper);
}
@Override
public void startPrefixMapping(String prefix, String uri) {
// no equivalent in SAX1, ignore
}
}
final static class AttributesWrapper
implements AttributeList
{
Attributes mAttrs;
public AttributesWrapper() { }
public void setAttributes(Attributes a) {
mAttrs = a;
}
@Override
public int getLength() {
return mAttrs.getLength();
}
@Override
public String getName(int i) {
String n = mAttrs.getQName(i);
return (n == null) ? mAttrs.getLocalName(i) : n;
}
@Override
public String getType(int i) {
return mAttrs.getType(i);
}
@Override
public String getType(String name) {
return mAttrs.getType(name);
}
@Override
public String getValue(int i) {
return mAttrs.getValue(i);
}
@Override
public String getValue(String name) {
return mAttrs.getValue(name);
}
}
}