KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > tools > OPP > CDHelper


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: CDHelper.java,v 1.6 2003/11/01 18:32:40 ohlrogge Exp $
8
package org.ozoneDB.tools.OPP;
9
10 import org.exolab.castor.xml.Unmarshaller;
11 import org.exolab.castor.xml.MarshalException;
12 import org.exolab.castor.xml.ValidationException;
13 import org.ozoneDB.tools.OPP.castor.*;
14 import org.xml.sax.InputSource JavaDoc;
15
16 /**
17  * @author <a HREF="http://www.softwarebuero.de/">SMB</a>
18  * @author <a HREF="http://www.medium.net/">Medium.net</a>
19  * @version $Revision: 1.6 $Date: 2003/11/01 18:32:40 $
20  */

21 public class CDHelper {
22     public static OzoneClassDescriptor xml2Descriptor(String JavaDoc _name) throws MarshalException, ValidationException {
23         return xml2Descriptor(new InputSource JavaDoc(_name));
24     }
25
26     public static OzoneClassDescriptor xml2Descriptor(InputSource JavaDoc _source) throws MarshalException, ValidationException {
27         Unmarshaller umrs = new Unmarshaller(OzoneClassDescriptor.class);
28         //umrs.setLogWriter( logger );
29
return (OzoneClassDescriptor) umrs.unmarshal(_source);
30     }
31 }
Popular Tags