1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.apache.xmlrpc.parser; |
17 |
|
|
18 |
|
import org.apache.xmlrpc.XmlRpcException; |
19 |
|
import org.xml.sax.Locator; |
20 |
|
import org.xml.sax.SAXException; |
21 |
|
import org.xml.sax.SAXParseException; |
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
1200 |
public abstract class TypeParserImpl implements TypeParser { |
28 |
|
private Object result; |
29 |
|
private Locator locator; |
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
920 |
public void setResult(Object pResult) { result = pResult; } |
35 |
920 |
public Object getResult() throws XmlRpcException { return result; } |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
648 |
public Locator getDocumentLocator() { return locator; } |
42 |
1200 |
public void setDocumentLocator(Locator pLocator) { locator = pLocator; } |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
public void processingInstruction(String pTarget, String pData) throws SAXException { |
47 |
0 |
} |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
public void skippedEntity(String pName) throws SAXException { |
52 |
0 |
throw new SAXParseException("Don't know how to handle entity " + pName, |
53 |
0 |
getDocumentLocator()); |
54 |
|
} |
55 |
|
|
56 |
|
public void startPrefixMapping(String pPrefix, String pURI) throws SAXException { |
57 |
461 |
} |
58 |
|
|
59 |
|
public void endPrefixMapping(String pPrefix) throws SAXException { |
60 |
461 |
} |
61 |
|
|
62 |
|
public void endDocument() throws SAXException { |
63 |
1200 |
} |
64 |
|
|
65 |
|
public void startDocument() throws SAXException { |
66 |
0 |
} |
67 |
|
|
68 |
|
protected static boolean isEmpty(char[] pChars, int pStart, int pLength) { |
69 |
0 |
for (int i = 0; i < pLength; i++) { |
70 |
0 |
if (!Character.isWhitespace(pChars[pStart+i])) { |
71 |
0 |
return false; |
72 |
|
} |
73 |
|
} |
74 |
0 |
return true; |
75 |
|
} |
76 |
|
|
77 |
|
public void characters(char[] pChars, int pOffset, int pLength) throws SAXException { |
78 |
0 |
if (!isEmpty(pChars, pOffset, pLength)) { |
79 |
0 |
throw new SAXParseException("Unexpected non-whitespace character data", |
80 |
0 |
getDocumentLocator()); |
81 |
|
} |
82 |
0 |
} |
83 |
|
|
84 |
|
public void ignorableWhitespace(char[] pChars, int pOffset, int pLength) throws SAXException { |
85 |
0 |
} |
86 |
|
} |