| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.android.internal.util; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
|
| 21 |
import org.xmlpull.v1.XmlPullParser; |
| 22 |
import org.xmlpull.v1.XmlPullParserException; |
| 23 |
|
| 24 |
import java.io.IOException; |
| 25 |
import java.io.InputStream; |
| 26 |
import java.io.Reader; |
| 27 |
import java.util.Objects; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
public class XmlPullParserWrapper implements XmlPullParser { |
| 33 |
private final XmlPullParser mWrapped; |
| 34 |
|
| 35 |
public XmlPullParserWrapper(@NonNull XmlPullParser wrapped) { |
| 36 |
mWrapped = Objects.requireNonNull(wrapped); |
| 37 |
} |
| 38 |
|
| 39 |
public void setFeature(String name, boolean state) throws XmlPullParserException { |
| 40 |
mWrapped.setFeature(name, state); |
| 41 |
} |
| 42 |
|
| 43 |
public boolean getFeature(String name) { |
| 44 |
return mWrapped.getFeature(name); |
| 45 |
} |
| 46 |
|
| 47 |
public void setProperty(String name, Object value) throws XmlPullParserException { |
| 48 |
mWrapped.setProperty(name, value); |
| 49 |
} |
| 50 |
|
| 51 |
public Object getProperty(String name) { |
| 52 |
return mWrapped.getProperty(name); |
| 53 |
} |
| 54 |
|
| 55 |
public void setInput(Reader in) throws XmlPullParserException { |
| 56 |
mWrapped.setInput(in); |
| 57 |
} |
| 58 |
|
| 59 |
public void setInput(InputStream inputStream, String inputEncoding) |
| 60 |
throws XmlPullParserException { |
| 61 |
mWrapped.setInput(inputStream, inputEncoding); |
| 62 |
} |
| 63 |
|
| 64 |
public String getInputEncoding() { |
| 65 |
return mWrapped.getInputEncoding(); |
| 66 |
} |
| 67 |
|
| 68 |
public void defineEntityReplacementText(String entityName, String replacementText) |
| 69 |
throws XmlPullParserException { |
| 70 |
mWrapped.defineEntityReplacementText(entityName, replacementText); |
| 71 |
} |
| 72 |
|
| 73 |
public int getNamespaceCount(int depth) throws XmlPullParserException { |
| 74 |
return mWrapped.getNamespaceCount(depth); |
| 75 |
} |
| 76 |
|
| 77 |
public String getNamespacePrefix(int pos) throws XmlPullParserException { |
| 78 |
return mWrapped.getNamespacePrefix(pos); |
| 79 |
} |
| 80 |
|
| 81 |
public String getNamespaceUri(int pos) throws XmlPullParserException { |
| 82 |
return mWrapped.getNamespaceUri(pos); |
| 83 |
} |
| 84 |
|
| 85 |
public String getNamespace(String prefix) { |
| 86 |
return mWrapped.getNamespace(prefix); |
| 87 |
} |
| 88 |
|
| 89 |
public int getDepth() { |
| 90 |
return mWrapped.getDepth(); |
| 91 |
} |
| 92 |
|
| 93 |
public String getPositionDescription() { |
| 94 |
return mWrapped.getPositionDescription(); |
| 95 |
} |
| 96 |
|
| 97 |
public int getLineNumber() { |
| 98 |
return mWrapped.getLineNumber(); |
| 99 |
} |
| 100 |
|
| 101 |
public int getColumnNumber() { |
| 102 |
return mWrapped.getColumnNumber(); |
| 103 |
} |
| 104 |
|
| 105 |
public boolean isWhitespace() throws XmlPullParserException { |
| 106 |
return mWrapped.isWhitespace(); |
| 107 |
} |
| 108 |
|
| 109 |
public String getText() { |
| 110 |
return mWrapped.getText(); |
| 111 |
} |
| 112 |
|
| 113 |
public char[] getTextCharacters(int[] holderForStartAndLength) { |
| 114 |
return mWrapped.getTextCharacters(holderForStartAndLength); |
| 115 |
} |
| 116 |
|
| 117 |
public String getNamespace() { |
| 118 |
return mWrapped.getNamespace(); |
| 119 |
} |
| 120 |
|
| 121 |
public String getName() { |
| 122 |
return mWrapped.getName(); |
| 123 |
} |
| 124 |
|
| 125 |
public String getPrefix() { |
| 126 |
return mWrapped.getPrefix(); |
| 127 |
} |
| 128 |
|
| 129 |
public boolean isEmptyElementTag() throws XmlPullParserException { |
| 130 |
return mWrapped.isEmptyElementTag(); |
| 131 |
} |
| 132 |
|
| 133 |
public int getAttributeCount() { |
| 134 |
return mWrapped.getAttributeCount(); |
| 135 |
} |
| 136 |
|
| 137 |
public String getAttributeNamespace(int index) { |
| 138 |
return mWrapped.getAttributeNamespace(index); |
| 139 |
} |
| 140 |
|
| 141 |
public String getAttributeName(int index) { |
| 142 |
return mWrapped.getAttributeName(index); |
| 143 |
} |
| 144 |
|
| 145 |
public String getAttributePrefix(int index) { |
| 146 |
return mWrapped.getAttributePrefix(index); |
| 147 |
} |
| 148 |
|
| 149 |
public String getAttributeType(int index) { |
| 150 |
return mWrapped.getAttributeType(index); |
| 151 |
} |
| 152 |
|
| 153 |
public boolean isAttributeDefault(int index) { |
| 154 |
return mWrapped.isAttributeDefault(index); |
| 155 |
} |
| 156 |
|
| 157 |
public String getAttributeValue(int index) { |
| 158 |
return mWrapped.getAttributeValue(index); |
| 159 |
} |
| 160 |
|
| 161 |
public String getAttributeValue(String namespace, String name) { |
| 162 |
return mWrapped.getAttributeValue(namespace, name); |
| 163 |
} |
| 164 |
|
| 165 |
public int getEventType() throws XmlPullParserException { |
| 166 |
return mWrapped.getEventType(); |
| 167 |
} |
| 168 |
|
| 169 |
public int next() throws XmlPullParserException, IOException { |
| 170 |
return mWrapped.next(); |
| 171 |
} |
| 172 |
|
| 173 |
public int nextToken() throws XmlPullParserException, IOException { |
| 174 |
return mWrapped.nextToken(); |
| 175 |
} |
| 176 |
|
| 177 |
public void require(int type, String namespace, String name) |
| 178 |
throws XmlPullParserException, IOException { |
| 179 |
mWrapped.require(type, namespace, name); |
| 180 |
} |
| 181 |
|
| 182 |
public String nextText() throws XmlPullParserException, IOException { |
| 183 |
return mWrapped.nextText(); |
| 184 |
} |
| 185 |
|
| 186 |
public int nextTag() throws XmlPullParserException, IOException { |
| 187 |
return mWrapped.nextTag(); |
| 188 |
} |
| 189 |
} |