summaryrefslogtreecommitdiffstats
path: root/xml
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2010-05-13 11:32:57 -0700
committerElliott Hughes <enh@google.com>2010-05-13 11:32:57 -0700
commitd21d78fd49a2d798218e8c8aefbddb26a0e71bbb (patch)
tree8bcbbf13d8a98cdb15d320d18ac86a581c38cb01 /xml
parentfd6bb3510c2f94d636f3572dcf5f7f4dcd1a2726 (diff)
downloadlibcore-d21d78fd49a2d798218e8c8aefbddb26a0e71bbb.zip
libcore-d21d78fd49a2d798218e8c8aefbddb26a0e71bbb.tar.gz
libcore-d21d78fd49a2d798218e8c8aefbddb26a0e71bbb.tar.bz2
Convert tabs to spaces.
Change-Id: I16cfbd2faac6b565b78b5dd97e2345323a36f652
Diffstat (limited to 'xml')
-rw-r--r--xml/src/main/java/org/kxml2/io/KXmlParser.java116
1 files changed, 55 insertions, 61 deletions
diff --git a/xml/src/main/java/org/kxml2/io/KXmlParser.java b/xml/src/main/java/org/kxml2/io/KXmlParser.java
index 99eb03b..af97e9f 100644
--- a/xml/src/main/java/org/kxml2/io/KXmlParser.java
+++ b/xml/src/main/java/org/kxml2/io/KXmlParser.java
@@ -33,7 +33,7 @@ import org.xmlpull.v1.*;
public class KXmlParser implements XmlPullParser {
private Object location;
- static final private String UNEXPECTED_EOF = "Unexpected EOF";
+ static final private String UNEXPECTED_EOF = "Unexpected EOF";
static final private String ILLEGAL_TYPE = "Wrong event type";
static final private int LEGACY = 999;
static final private int XML_DECL = 998;
@@ -291,20 +291,20 @@ public class KXmlParser implements XmlPullParser {
while (true) {
attributeCount = -1;
- // degenerated needs to be handled before error because of possible
- // processor expectations(!)
+ // degenerated needs to be handled before error because of possible
+ // processor expectations(!)
- if (degenerated) {
- degenerated = false;
- type = END_TAG;
- return;
- }
+ if (degenerated) {
+ degenerated = false;
+ type = END_TAG;
+ return;
+ }
if (error != null) {
for (int i = 0; i < error.length(); i++)
push(error.charAt(i));
- // text = error;
+ //text = error;
error = null;
type = COMMENT;
return;
@@ -357,7 +357,7 @@ public class KXmlParser implements XmlPullParser {
if (isWhitespace)
type = IGNORABLE_WHITESPACE;
// make exception switchable for instances.chg... !!!!
- // else
+ // else
// exception ("text '"+getText ()+"' not allowed outside root element");
}
return;
@@ -563,7 +563,7 @@ public class KXmlParser implements XmlPullParser {
if (!name.equals(elementStack[sp + 3])) {
error("expected: /" + elementStack[sp + 3] + " read: " + name);
- // become case insensitive in relaxed mode
+ // become case insensitive in relaxed mode
// int probe = sp;
// while (probe >= 0 && !name.toLowerCase().equals(elementStack[probe + 3].toLowerCase())) {
@@ -573,7 +573,7 @@ public class KXmlParser implements XmlPullParser {
//
// if (probe < 0) {
// stackMismatch = 0;
-// // text = "unexpected end tag ignored";
+// // text = "unexpected end tag ignored";
// type = COMMENT;
// return;
// }
@@ -693,25 +693,24 @@ public class KXmlParser implements XmlPullParser {
skip();
if (peek(0) != '=') {
- if(!relaxed){
- error("Attr.value missing f. "+attrName);
- }
+ if(!relaxed){
+ error("Attr.value missing f. "+attrName);
+ }
attributes[i] = attrName;
- }
- else {
+ } else {
read('=');
skip();
int delimiter = peek(0);
if (delimiter != '\'' && delimiter != '"') {
- if(!relaxed){
- error("attr value delimiter missing!");
- }
+ if(!relaxed){
+ error("attr value delimiter missing!");
+ }
delimiter = ' ';
+ } else {
+ read();
}
- else
- read();
-
+
int p = txtPos;
// BEGIN android-changed: distinguish attribute values from normal text.
pushText(delimiter, true, true);
@@ -739,14 +738,14 @@ public class KXmlParser implements XmlPullParser {
nspCounts[depth] = nspCounts[depth - 1];
/*
- if(!relaxed){
+ if(!relaxed){
for (int i = attributeCount - 1; i > 0; i--) {
for (int j = 0; j < i; j++) {
if (getAttributeName(i).equals(getAttributeName(j)))
exception("Duplicate Attribute: " + getAttributeName(i));
}
}
- }
+ }
*/
if (processNsp)
adjustNsp();
@@ -776,21 +775,16 @@ public class KXmlParser implements XmlPullParser {
read();
break;
}
- if (c < 128
- && (c < '0' || c > '9')
- && (c < 'a' || c > 'z')
- && (c < 'A' || c > 'Z')
- && c != '_'
- && c != '-'
- && c != '#') {
- if(!relaxed){
- error("unterminated entity ref");
- }
-
- // BEGIN android-removed: avoid log spam.
- // System.out.println("broken entitiy: "+get(pos-1));
- // END android-removed
-
+ if (c < 128 && (c < '0' || c > '9') && (c < 'a' || c > 'z') && (c < 'A' || c > 'Z')
+ && c != '_' && c != '-' && c != '#') {
+ if(!relaxed){
+ error("unterminated entity ref");
+ }
+
+ // BEGIN android-removed: avoid log spam.
+ // System.out.println("broken entitiy: "+get(pos-1));
+ // END android-removed
+
//; ends with:"+(char)c);
// if (c != -1)
// push(c);
@@ -898,10 +892,10 @@ public class KXmlParser implements XmlPullParser {
result = peek[0];
peek[0] = peek[1];
}
- // else {
- // result = peek[0];
- // System.arraycopy (peek, 1, peek, 0, peekCount-1);
- // }
+ // else {
+ // result = peek[0];
+ // System.arraycopy (peek, 1, peek, 0, peekCount-1);
+ // }
peekCount--;
column++;
@@ -1176,8 +1170,8 @@ public class KXmlParser implements XmlPullParser {
return version;
if (isProp(property, true, "xmldecl-standalone"))
return standalone;
- if (isProp(property, true, "location"))
- return location != null ? location : reader.toString();
+ if (isProp(property, true, "location"))
+ return location != null ? location : reader.toString();
return null;
}
@@ -1257,15 +1251,14 @@ public class KXmlParser implements XmlPullParser {
buf.append(text);
}
- buf.append("@"+line + ":" + column);
- if(location != null){
- buf.append(" in ");
- buf.append(location);
- }
- else if(reader != null){
- buf.append(" in ");
- buf.append(reader.toString());
- }
+ buf.append("@"+line + ":" + column);
+ if(location != null){
+ buf.append(" in ");
+ buf.append(location);
+ } else if(reader != null){
+ buf.append(" in ");
+ buf.append(reader.toString());
+ }
return buf.toString();
}
@@ -1385,7 +1378,7 @@ public class KXmlParser implements XmlPullParser {
nextImpl();
if (type < minType)
minType = type;
- // if (curr <= TEXT) type = curr;
+ // if (curr <= TEXT) type = curr;
}
while (minType > ENTITY_REF // ignorable
|| (minType >= TEXT && peekType() >= TEXT));
@@ -1465,10 +1458,11 @@ public class KXmlParser implements XmlPullParser {
public void setProperty(String property, Object value)
throws XmlPullParserException {
- if(isProp(property, true, "location"))
- location = value;
- else
- throw new XmlPullParserException("unsupported property: " + property);
+ if(isProp(property, true, "location")) {
+ location = value;
+ } else {
+ throw new XmlPullParserException("unsupported property: " + property);
+ }
}
/**
@@ -1477,7 +1471,7 @@ public class KXmlParser implements XmlPullParser {
* parser will be positioned on corresponding END_TAG.
*/
- // Implementation copied from Alek's mail...
+ // Implementation copied from Alek's mail...
public void skipSubTree() throws XmlPullParserException, IOException {
require(START_TAG, null, null);