public Object newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs) { final EjbJarDD dd; if (root == null) { root = dd = new EjbJarDD(); } else { dd = (EjbJarDD)root; } if (attrs.getLength() > 0) { for (int i = 0; i < attrs.getLength(); ++i) { if (attrs.getLocalName(i).equals("version")) { dd.setVersion(attrs.getValue(i)); } } } return root; }
public Object newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs) { final EjbJarDD dd; if (root == null) { root = dd = new EjbJarDD(); } else { dd = (EjbJarDD)root; } if (attrs.getLength() > 0) { for (int i = 0; i < attrs.getLength(); ++i) { if (attrs.getLocalName(i).equals("version")) { dd.setVersion(attrs.getValue(i)); } } } return root; }
public static EjbJarDD parse(URL ddResource, EjbJarDD dd) throws JBossXBException, IOException { ObjectModelFactory factory = null; Unmarshaller unmarshaller = null; if (ddResource != null) { log.debug("found jboss.xml " + ddResource); if (dd == null) dd = new EjbJarDD(); factory = new JBossDDObjectFactory(dd); UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance(); unmarshaller = unmarshallerFactory.newUnmarshaller(); unmarshaller.setEntityResolver(new JBossEntityResolver()); unmarshaller.setNamespaceAware(true); unmarshaller.setSchemaValidation(true); unmarshaller.setValidation(true); dd = (EjbJarDD)unmarshaller.unmarshal(ddResource.openStream(), factory, null); } return dd; }
public static EjbJarDD parse(URL ddResource, EjbJarDD dd) throws JBossXBException, IOException { ObjectModelFactory factory = null; Unmarshaller unmarshaller = null; if (ddResource != null) { log.debug("found jboss.xml " + ddResource); if (dd == null) dd = new EjbJarDD(); factory = new JBossDDObjectFactory(dd); UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance(); unmarshaller = unmarshallerFactory.newUnmarshaller(); unmarshaller.setEntityResolver(new JBossEntityResolver()); unmarshaller.setNamespaceAware(true); unmarshaller.setSchemaValidation(true); unmarshaller.setValidation(true); dd = (EjbJarDD)unmarshaller.unmarshal(ddResource.openStream(), factory, null); } return dd; }