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 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; }