@Override protected T parse(VFSDeploymentUnit unit, VirtualFile file, T root) throws Exception { InputSource source = new VFSInputSource(file); return getHelper().parse(source, root, getObjectModelFactory(root)); }
@Override protected T parse(VFSDeploymentUnit unit, VirtualFile file, T root) throws Exception { if (file == null) throw new IllegalArgumentException("Null file"); Unmarshaller unmarshaller = factory.newUnmarshaller(); unmarshaller.setSchemaValidation(isUseSchemaValidation()); unmarshaller.setValidation(isUseValidation()); Object parsed = null; try { ObjectModelFactory factory = getObjectModelFactory(root); URL url = file.toURL(); parsed = unmarshaller.unmarshal(url.toString(), factory, root); } catch (Throwable t) { DeploymentException.rethrowAsDeploymentException("Error parsing meta data " + file.getPathName(), t); } if (parsed == null) throw new DeploymentException("The xml " + file.getPathName() + " is not well formed!"); return getOutput().cast(parsed); }