Package org.exolab.castor.xml

Examples of org.exolab.castor.xml.Unmarshaller


                FileReader reader = new FileReader(psmlFile);
                mapping = new SynchronizedMapping();
                InputSource is = new InputSource( new FileReader(map) );
                is.setSystemId( mapFile );
                mapping.loadMapping( is );
                Unmarshaller unmarshaller = new Unmarshaller(mapping);
                Security security = (Security)unmarshaller.unmarshal(reader);
                assertNotNull(security);
                assertTrue(security.getId().equals("1000"));

            }
            catch (Exception e)
View Full Code Here


            InputSource is = new InputSource( new FileReader(map) );
            is.setSystemId( mapFile );
            mapping.loadMapping( is );

            System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");
            Unmarshaller unmarshaller = new Unmarshaller(mapping);
            Portlets rootset = (Portlets)unmarshaller.unmarshal(reader);
            System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");
           
            assertTrue(rootset.getName().equals("theRootSet"));
            assertTrue(rootset.getId().equals("01"));
           
View Full Code Here

                mapping = new SynchronizedMapping();
                InputSource is = new InputSource( new FileReader(map) );
                is.setSystemId( mapFile );
                mapping.loadMapping( is );
                System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");
                Unmarshaller unmarshaller = new Unmarshaller(mapping);
                Portlets rootset = (Portlets)unmarshaller.unmarshal(reader);
                System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");

                assertTrue(rootset.getName().equals("theRootSet"));
                assertTrue(rootset.getId().equals("01"));
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

        {
            synchronized(watcher)
            {
                file = new File(directory, name + extension).getCanonicalPath();

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

                fragment.setChanged(true);

                updateFragment(file, fragment);
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

        {
            synchronized(watcher)
            {
                file = new File(directory, name + extension).getCanonicalPath();

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

                fragment.setChanged(true);

                updateFragment(file, fragment);
View Full Code Here

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

                Document d = builder.parse(f);

                Unmarshaller unmarshaller = new Unmarshaller(this.mapping);
                portlets = (Portlets)unmarshaller.unmarshal((Node) d);

                doc.setPortlets(portlets);

            }
            catch (IOException e)
View Full Code Here

     * @param the loaded portlets structure or null
     */
    protected Portlets load(Reader reader)
        throws IOException, MarshalException, ValidationException, MappingException
    {
        Unmarshaller unmarshaller = new Unmarshaller(this.mapping);
        Portlets portlets = (Portlets)unmarshaller.unmarshal(reader);
        return portlets;
    }
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

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.