public InputStream getByteStream() { URL url = SecurityActions.loadResource(getClass(), loc); InputStream is; try { is = url.openStream(); } catch (IOException e) { throw new RuntimeException(ErrorCodes.CLASS_NOT_LOADED + loc); } if (is == null) throw new RuntimeException(ErrorCodes.NULL_VALUE + "inputstream is null for " + loc); return is; }
public InputStream getByteStream() { URL url = SecurityActions.loadResource(getClass(), loc); InputStream is; try { is = url.openStream(); } catch (IOException e) { throw new RuntimeException(ErrorCodes.CLASS_NOT_LOADED + loc); } if (is == null) throw new RuntimeException(ErrorCodes.NULL_VALUE + "inputstream is null for " + loc); return is; }
private static Schema getJAXPSchemaInstance(String schemaLocation) throws SAXException { URL schemaURL = SecurityActions.loadResource(JAXBUtil.class, schemaLocation); if (schemaURL == null) throw new IllegalStateException(ErrorCodes.NULL_VALUE + "Schema URL :" + schemaLocation); SchemaFactory scFact = getSchemaFactory(); Schema schema = scFact.newSchema(schemaURL); return schema; }
private static Schema getJAXPSchemaInstance(String schemaLocation) throws SAXException { URL schemaURL = SecurityActions.loadResource(JAXBUtil.class, schemaLocation); if (schemaURL == null) throw new IllegalStateException(ErrorCodes.NULL_VALUE + "Schema URL :" + schemaLocation); SchemaFactory scFact = getSchemaFactory(); Schema schema = scFact.newSchema(schemaURL); return schema; }
private static Source[] sources() throws IOException { List<String> schemas = SchemaManagerUtil.getSchemas(); Source[] sourceArr = new Source[schemas.size()]; int i = 0; for (String schema : schemas) { URL url = SecurityActions.loadResource(JAXPValidationUtil.class, schema); if (url == null) throw new RuntimeException(ErrorCodes.NULL_VALUE + "schema url:" + schema); sourceArr[i++] = new StreamSource(url.openStream()); } return sourceArr; }
private static Source[] sources() throws IOException { List<String> schemas = SchemaManagerUtil.getSchemas(); Source[] sourceArr = new Source[schemas.size()]; int i = 0; for (String schema : schemas) { URL url = SecurityActions.loadResource(JAXPValidationUtil.class, schema); if (url == null) throw new RuntimeException(ErrorCodes.NULL_VALUE + "schema url:" + schema); sourceArr[i++] = new StreamSource(url.openStream()); } return sourceArr; }
public InputStream getByteStream() { URL url = SecurityActions.loadResource(getClass(), loc); InputStream is; try { is = url.openStream(); } catch (IOException e) { throw new RuntimeException(logger.classNotLoadedError(loc)); } if (is == null) throw logger.nullValueError("inputstream is null for " + loc); return is; }
private static Source[] sources() throws IOException { List<String> schemas = SchemaManagerUtil.getSchemas(); Source[] sourceArr = new Source[schemas.size()]; int i = 0; for (String schema : schemas) { URL url = SecurityActions.loadResource(JAXPValidationUtil.class, schema); if (url == null) throw logger.nullValueError("schema url:" + schema); sourceArr[i++] = new StreamSource(url.openStream()); } return sourceArr; }
public InputStream getByteStream() { URL url = SecurityActions.loadResource(getClass(), loc); InputStream is; try { is = url.openStream(); } catch (IOException e) { throw new RuntimeException(logger.classNotLoadedError(loc)); } if (is == null) throw logger.nullValueError("inputstream is null for " + loc); return is; }
private static Source[] sources() throws IOException { List<String> schemas = SchemaManagerUtil.getSchemas(); Source[] sourceArr = new Source[schemas.size()]; int i = 0; for (String schema : schemas) { URL url = SecurityActions.loadResource(JAXPValidationUtil.class, schema); if (url == null) throw logger.nullValueError("schema url:" + schema); sourceArr[i++] = new StreamSource(url.openStream()); } return sourceArr; }
private static Source[] sources() throws IOException { List<String> schemas = SchemaManagerUtil.getSchemas(); Source[] sourceArr = new Source[schemas.size()]; int i = 0; for (String schema : schemas) { URL url = SecurityActions.loadResource(JAXPValidationUtil.class, schema); if (url == null) throw logger.nullValueError("schema url:" + schema); sourceArr[i++] = new StreamSource(url.openStream()); } return sourceArr; }
public InputStream getByteStream() { URL url = SecurityActions.loadResource(getClass(), loc); InputStream is; try { is = url.openStream(); } catch (IOException e) { throw new RuntimeException(logger.classNotLoadedError(loc)); } if (is == null) throw logger.nullValueError("inputstream is null for " + loc); return is; }
private static Schema getJAXPSchemaInstance(String schemaLocation) throws SAXException { URL schemaURL = SecurityActions.loadResource(JAXBUtil.class, schemaLocation); if (schemaURL == null) throw logger.nullValueError("Schema URL :" + schemaLocation); SchemaFactory scFact = getSchemaFactory(); Schema schema = scFact.newSchema(schemaURL); return schema; }
private static Schema getJAXPSchemaInstance(String schemaLocation) throws SAXException { URL schemaURL = SecurityActions.loadResource(JAXBUtil.class, schemaLocation); if (schemaURL == null) throw logger.nullValueError("Schema URL :" + schemaLocation); SchemaFactory scFact = getSchemaFactory(); Schema schema = scFact.newSchema(schemaURL); return schema; }
private static Schema getJAXPSchemaInstance(String schemaLocation) throws SAXException { URL schemaURL = SecurityActions.loadResource(JAXBUtil.class, schemaLocation); if (schemaURL == null) throw logger.nullValueError("Schema URL :" + schemaLocation); SchemaFactory scFact = getSchemaFactory(); Schema schema = scFact.newSchema(schemaURL); return schema; }
public static Unmarshaller getValidatingUnmarshaller(String[] pkgNames, String[] schemaLocations) throws JAXBException, SAXException, IOException { StringBuilder builder = new StringBuilder(); int len = pkgNames.length; if (len == 0) throw new IllegalArgumentException(ErrorCodes.NULL_VALUE + "Packages are empty"); for (String pkg : pkgNames) { builder.append(pkg); builder.append(":"); } Unmarshaller unmarshaller = getUnmarshaller(builder.toString()); SchemaFactory schemaFactory = getSchemaFactory(); //Get the sources Source[] schemaSources = new Source[schemaLocations.length]; int i = 0; for (String schemaLocation : schemaLocations) { URL schemaURL = SecurityActions.loadResource(JAXBUtil.class, schemaLocation); if (schemaURL == null) throw new IllegalStateException(ErrorCodes.NULL_VALUE + "Schema URL :" + schemaLocation); schemaSources[i++] = new StreamSource(schemaURL.openStream()); } Schema schema = schemaFactory.newSchema(schemaSources); unmarshaller.setSchema(schema); return unmarshaller; }
public static Unmarshaller getValidatingUnmarshaller(String[] pkgNames, String[] schemaLocations) throws JAXBException, SAXException, IOException { StringBuilder builder = new StringBuilder(); int len = pkgNames.length; if (len == 0) throw new IllegalArgumentException(ErrorCodes.NULL_VALUE + "Packages are empty"); for (String pkg : pkgNames) { builder.append(pkg); builder.append(":"); } Unmarshaller unmarshaller = getUnmarshaller(builder.toString()); SchemaFactory schemaFactory = getSchemaFactory(); //Get the sources Source[] schemaSources = new Source[schemaLocations.length]; int i = 0; for (String schemaLocation : schemaLocations) { URL schemaURL = SecurityActions.loadResource(JAXBUtil.class, schemaLocation); if (schemaURL == null) throw new IllegalStateException(ErrorCodes.NULL_VALUE + "Schema URL :" + schemaLocation); schemaSources[i++] = new StreamSource(schemaURL.openStream()); } Schema schema = schemaFactory.newSchema(schemaSources); unmarshaller.setSchema(schema); return unmarshaller; }
public static Unmarshaller getValidatingUnmarshaller(String[] pkgNames, String[] schemaLocations) throws JAXBException, SAXException, IOException { StringBuilder builder = new StringBuilder(); int len = pkgNames.length; if (len == 0) throw logger.nullValueError("Packages are empty"); for (String pkg : pkgNames) { builder.append(pkg); builder.append(":"); } Unmarshaller unmarshaller = getUnmarshaller(builder.toString()); SchemaFactory schemaFactory = getSchemaFactory(); // Get the sources Source[] schemaSources = new Source[schemaLocations.length]; int i = 0; for (String schemaLocation : schemaLocations) { URL schemaURL = SecurityActions.loadResource(JAXBUtil.class, schemaLocation); if (schemaURL == null) throw logger.nullValueError("Schema URL :" + schemaLocation); schemaSources[i++] = new StreamSource(schemaURL.openStream()); } Schema schema = schemaFactory.newSchema(schemaSources); unmarshaller.setSchema(schema); return unmarshaller; }
public static Unmarshaller getValidatingUnmarshaller(String[] pkgNames, String[] schemaLocations) throws JAXBException, SAXException, IOException { StringBuilder builder = new StringBuilder(); int len = pkgNames.length; if (len == 0) throw logger.nullValueError("Packages are empty"); for (String pkg : pkgNames) { builder.append(pkg); builder.append(":"); } Unmarshaller unmarshaller = getUnmarshaller(builder.toString()); SchemaFactory schemaFactory = getSchemaFactory(); // Get the sources Source[] schemaSources = new Source[schemaLocations.length]; int i = 0; for (String schemaLocation : schemaLocations) { URL schemaURL = SecurityActions.loadResource(JAXBUtil.class, schemaLocation); if (schemaURL == null) throw logger.nullValueError("Schema URL :" + schemaLocation); schemaSources[i++] = new StreamSource(schemaURL.openStream()); } Schema schema = schemaFactory.newSchema(schemaSources); unmarshaller.setSchema(schema); return unmarshaller; }
public static Unmarshaller getValidatingUnmarshaller(String[] pkgNames, String[] schemaLocations) throws JAXBException, SAXException, IOException { StringBuilder builder = new StringBuilder(); int len = pkgNames.length; if (len == 0) throw logger.nullValueError("Packages are empty"); for (String pkg : pkgNames) { builder.append(pkg); builder.append(":"); } Unmarshaller unmarshaller = getUnmarshaller(builder.toString()); SchemaFactory schemaFactory = getSchemaFactory(); // Get the sources Source[] schemaSources = new Source[schemaLocations.length]; int i = 0; for (String schemaLocation : schemaLocations) { URL schemaURL = SecurityActions.loadResource(JAXBUtil.class, schemaLocation); if (schemaURL == null) throw logger.nullValueError("Schema URL :" + schemaLocation); schemaSources[i++] = new StreamSource(schemaURL.openStream()); } Schema schema = schemaFactory.newSchema(schemaSources); unmarshaller.setSchema(schema); return unmarshaller; }