Lines Matching defs:storage
72 public PolicySourceModel unmarshalModel(final Object storage) throws PolicyException {
73 final XMLEventReader reader = createXMLEventReader(storage);
298 * Method checks if the storage type is supported and transforms it to XMLEventReader instance which is then returned.
299 * Throws PolicyException if the transformation is not succesfull or if the storage type is not supported.
301 * @param storage An XMLEventReader instance.
302 * @return The storage cast to an XMLEventReader.
305 private XMLEventReader createXMLEventReader(final Object storage)
307 if (storage instanceof XMLEventReader) {
308 return (XMLEventReader) storage;
310 else if (!(storage instanceof Reader)) {
311 throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0022_STORAGE_TYPE_NOT_SUPPORTED(storage.getClass().getName())));
315 return XMLInputFactory.newInstance().createXMLEventReader((Reader) storage);