Code example for DefaultHandler

                serialize(new Sub2(), Sub2.class)); 
    private void assertValidXML(String s) throws Exception {
        SAXParser p = SAXParserFactory.newInstance().newSAXParser();
        p.parse(new InputSource(new StringReader(s)),new DefaultHandler());
     * Can we write out anonymous classes as the root object? 
    public void testAnonymousClass() throws Exception { 
        assertValidXML(serialize(new X() {},X.class)); 
    public static class PA { 
        @Exported public int[] v = new int[]{1,2,3};
Experience pair programming with AI  Get Codota for Java