1 22 package org.jboss.deployment; 23 24 import java.net.URL ; 25 26 import org.jboss.xb.binding.Unmarshaller; 27 import org.jboss.xb.binding.UnmarshallerFactory; 28 import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; 29 30 37 public abstract class SchemaBindingSimpleSubDeployerSupport extends SimpleSubDeployerSupport 38 { 39 40 private UnmarshallerFactory factory = UnmarshallerFactory.newInstance(); 41 42 47 public abstract SchemaBinding getSchemaBinding(); 48 49 protected void parseMetaData(DeploymentInfo di, URL url) throws DeploymentException 50 { 51 try 52 { 53 Unmarshaller unmarshaller = factory.newUnmarshaller(); 54 di.metaData = unmarshaller.unmarshal(url.toString(), getSchemaBinding()); 55 if (di.metaData == null) 56 throw new RuntimeException ("The xml " + url + " is not well formed!"); 57 } 58 catch (Throwable t) 59 { 60 DeploymentException.rethrowAsDeploymentException("Error parsing meta data " + url, t); 61 } 62 } 63 } 64 | Popular Tags |