Package org.apache.xmlrpc.parser

Examples of org.apache.xmlrpc.parser.DateParser


    /**
     * Test for XMLRPC-140.
     */
    public void testXMLRPC140() throws Exception {
        DateParser parser = new DateParser(new XmlRpcDateTimeFormat(){
            private static final long serialVersionUID = 0L;
            protected TimeZone getTimeZone() {
                return TimeZone.getDefault();
            }
        }){
            public void setResult(Object pObject){
                try {
                    super.setResult((String) pObject);
                } catch (SAXException e) {
                    throw new UndeclaredThrowableException(e);
                }
            }
        };
        try {
            parser.setResult("20070316T162808Z");
            fail("Expected exception");
        } catch (UndeclaredThrowableException e) {
            SAXParseException spe = (SAXParseException) e.getUndeclaredThrowable();
            ParseException pe = (ParseException) spe.getException();
            assertEquals(11, pe.getErrorOffset());
View Full Code Here


        return new TypeFactoryImpl(pController){
            private TypeSerializer dateSerializer = new DateSerializer(pFormat);

            public TypeParser getParser(XmlRpcStreamConfig pConfig, NamespaceContextImpl pContext, String pURI, String pLocalName) {
                if (DateSerializer.DATE_TAG.equals(pLocalName)) {
                    return new DateParser(pFormat);
                } else {
                    return super.getParser(pConfig, pContext, pURI, pLocalName);
                }
            }
View Full Code Here

      } else if (BooleanSerializer.BOOLEAN_TAG.equals(pLocalName)) {
        return new BooleanParser();
      } else if (DoubleSerializer.DOUBLE_TAG.equals(pLocalName)) {
        return new DoubleParser();
      } else if (DateSerializer.DATE_TAG.equals(pLocalName)) {
        return new DateParser(new XmlRpcDateTimeDateFormat(){
                    private static final long serialVersionUID = 7585237706442299067L;
                    protected TimeZone getTimeZone() {
                        return controller.getConfig().getTimeZone();
                    }
                });
View Full Code Here

    /**
     * Test for XMLRPC-140.
     */
    public void testXMLRPC140() throws Exception {
        DateParser parser = new DateParser(new XmlRpcDateTimeFormat(){
            private static final long serialVersionUID = 0L;
            protected TimeZone getTimeZone() {
                return TimeZone.getDefault();
            }
        }){
            public void setResult(Object pObject){
                try {
                    super.setResult((String) pObject);
                } catch (SAXException e) {
                    throw new UndeclaredThrowableException(e);
                }
            }
        };
        try {
            parser.setResult("20070316T162808Z");
            fail("Expected exception");
        } catch (UndeclaredThrowableException e) {
            SAXParseException spe = (SAXParseException) e.getUndeclaredThrowable();
            ParseException pe = (ParseException) spe.getException();
            assertEquals(11, pe.getErrorOffset());
View Full Code Here

        return new TypeFactoryImpl(pController){
            private TypeSerializer dateSerializer = new DateSerializer(pFormat);

            public TypeParser getParser(XmlRpcStreamConfig pConfig, NamespaceContextImpl pContext, String pURI, String pLocalName) {
                if (DateSerializer.DATE_TAG.equals(pLocalName)) {
                    return new DateParser(pFormat);
                } else {
                    return super.getParser(pConfig, pContext, pURI, pLocalName);
                }
            }
View Full Code Here

      } else if (BooleanSerializer.BOOLEAN_TAG.equals(pLocalName)) {
        return new BooleanParser();
      } else if (DoubleSerializer.DOUBLE_TAG.equals(pLocalName)) {
        return new DoubleParser();
      } else if (DateSerializer.DATE_TAG.equals(pLocalName)) {
        return new DateParser(new XmlRpcDateTimeDateFormat(){
                    private static final long serialVersionUID = 7585237706442299067L;
                    protected TimeZone getTimeZone() {
                        return controller.getConfig().getTimeZone();
                    }
                });
View Full Code Here

      } else if (BooleanSerializer.BOOLEAN_TAG.equals(pLocalName)) {
        return new BooleanParser();
      } else if (DoubleSerializer.DOUBLE_TAG.equals(pLocalName)) {
        return new DoubleParser();
      } else if (DateSerializer.DATE_TAG.equals(pLocalName)) {
        return new DateParser();
      } else if (ObjectArraySerializer.ARRAY_TAG.equals(pLocalName)) {
        return new ObjectArrayParser(pConfig, pContext, this);
      } else if (MapSerializer.STRUCT_TAG.equals(pLocalName)) {
        return new MapParser(pConfig, pContext, this);
      } else if (ByteArraySerializer.BASE_64_TAG.equals(pLocalName)) {
View Full Code Here

TOP

Related Classes of org.apache.xmlrpc.parser.DateParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.