Package org.exolab.castor.xml

Examples of org.exolab.castor.xml.Unmarshaller


            FileReader reader = null;
            try
            {
                reader = new FileReader(f);

                Unmarshaller unmarshaller = new Unmarshaller(this.loadMapping());
                portlets = (Portlets) unmarshaller.unmarshal(reader);

                doc.setPortlets(portlets);

            }
            catch (IOException e)
View Full Code Here


            FileReader reader = null;
            try
            {
                reader = new FileReader(f);

                Unmarshaller unmarshaller = new Unmarshaller(this.loadMapping());
                portlets = (Portlets) unmarshaller.unmarshal(reader);

                doc.setPortlets(portlets);

            }
            catch (IOException e)
View Full Code Here

    public static Portlets bytesToPortlets(byte[] portletBytes, Mapping mapping)
    {
        Reader reader = new StringReader(new String(portletBytes));
        try
        {
            Unmarshaller unmarshaller = new Unmarshaller((Mapping)mapping);
            return (Portlets)unmarshaller.unmarshal(reader);

//            return Portlets.unmarshal(reader);
        }
        catch (MarshalException e)
        {
View Full Code Here

            DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = dbfactory.newDocumentBuilder();
      
            Document d = builder.parse(new File(registryFile));

            Unmarshaller unmarshaller = new Unmarshaller(mapping);
            RegistryFragment fragment = (RegistryFragment) unmarshaller.unmarshal((Node) d);
           
        }
        catch (Exception e)
        {
            e.printStackTrace();
View Full Code Here

                FileReader reader = new FileReader(xregFile);
                mapping = new Mapping();
                InputSource is = new InputSource(new FileReader(map));
                is.setSystemId(mapFile);
                mapping.loadMapping(is);
                Unmarshaller unmarshaller = new Unmarshaller(mapping);
                RegistryFragment fragment = (RegistryFragment) unmarshaller.unmarshal(reader);
                assertNotNull(fragment);
                Vector portlets = fragment.getPortlets();

                // test abstract
View Full Code Here

            FileReader reader = new FileReader(xregFile);
            mapping = new Mapping();
            InputSource is = new InputSource(new FileReader(map));
            is.setSystemId(mapFile);
            mapping.loadMapping(is);
            Unmarshaller unmarshaller = new Unmarshaller(mapping);
            RegistryFragment fragment = (RegistryFragment) unmarshaller.unmarshal(reader);
            assertNotNull(fragment);
            Vector securityEntries = fragment.getSecurityEntries();
            assertTrue("Security Entries exist", !securityEntries.isEmpty());

            // test abstract
View Full Code Here

            FileReader reader = new FileReader(xregFile);
            mapping = new Mapping();
            InputSource is = new InputSource(new FileReader(map));
            is.setSystemId(mapFile);
            mapping.loadMapping(is);
            Unmarshaller unmarshaller = new Unmarshaller(mapping);
            RegistryFragment fragment = (RegistryFragment) unmarshaller.unmarshal(reader);
            assertNotNull(fragment);
            Vector securityEntries = fragment.getSecurityEntries();
            assertTrue("Security Entries exist", !securityEntries.isEmpty());

            // Test the wide-open entry
View Full Code Here

                FileReader reader = new FileReader(xregFile);
                mapping = new Mapping();
                InputSource is = new InputSource(new FileReader(map));
                is.setSystemId(mapFile);
                mapping.loadMapping(is);
                Unmarshaller unmarshaller = new Unmarshaller(mapping);
                ContentURL url = (ContentURL) unmarshaller.unmarshal(reader);
                assertNotNull(url);

                System.out.println(url.getURL());
                assertTrue(url.getURL().equals("http://www.xmlhack.com/rss.php"));
                assertTrue(url.isCacheKey());
View Full Code Here

            DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = dbfactory.newDocumentBuilder();

            Document doc = builder.parse(file);

            Unmarshaller unmarshaller = new Unmarshaller(this.mapper);
            ForwardsConfiguration configuration =
                (ForwardsConfiguration) unmarshaller.unmarshal((Node) doc);

            Iterator it = configuration.getForwards().iterator();
            while (it.hasNext())
            {
                Forward forward = (Forward)it.next();
View Full Code Here

            DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = dbfactory.newDocumentBuilder();
      
            Document d = builder.parse(new File(file));

            Unmarshaller unmarshaller = new Unmarshaller(this.mapping);
            RegistryFragment fragment = (RegistryFragment) unmarshaller.unmarshal((Node) d);

            //mark this fragment as changed
            fragment.setChanged(true);

            // if we get here, we successfully loaded the new fragment
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.Unmarshaller

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.