Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 package org.apache.xmlrpc.parser;
00020
00021 import org.apache.xmlrpc.XmlRpcException;
00022 import org.xml.sax.Locator;
00023 import org.xml.sax.SAXException;
00024 import org.xml.sax.SAXParseException;
00025
00026
00030 public abstract class TypeParserImpl implements TypeParser {
00031 private Object result;
00032 private Locator locator;
00033
00037 public void setResult(Object pResult) { result = pResult; }
00038 public Object getResult() throws XmlRpcException { return result; }
00039
00044 public Locator getDocumentLocator() { return locator; }
00045 public void setDocumentLocator(Locator pLocator) { locator = pLocator; }
00046
00049 public void processingInstruction(String pTarget, String pData) throws SAXException {
00050 }
00051
00054 public void skippedEntity(String pName) throws SAXException {
00055 throw new SAXParseException("Don't know how to handle entity " + pName,
00056 getDocumentLocator());
00057 }
00058
00059 public void startPrefixMapping(String pPrefix, String pURI) throws SAXException {
00060 }
00061
00062 public void endPrefixMapping(String pPrefix) throws SAXException {
00063 }
00064
00065 public void endDocument() throws SAXException {
00066 }
00067
00068 public void startDocument() throws SAXException {
00069 }
00070
00071 protected static boolean isEmpty(char[] pChars, int pStart, int pLength) {
00072 for (int i = 0; i < pLength; i++) {
00073 if (!Character.isWhitespace(pChars[pStart+i])) {
00074 return false;
00075 }
00076 }
00077 return true;
00078 }
00079
00080 public void characters(char[] pChars, int pOffset, int pLength) throws SAXException {
00081 if (!isEmpty(pChars, pOffset, pLength)) {
00082 throw new SAXParseException("Unexpected non-whitespace character data",
00083 getDocumentLocator());
00084 }
00085 }
00086
00087 public void ignorableWhitespace(char[] pChars, int pOffset, int pLength) throws SAXException {
00088 }
00089 }