Package net.rootnode.loomchild.util.exceptions

Examples of net.rootnode.loomchild.util.exceptions.XmlException


      SAXParser saxParser = parserFactory.newSAXParser();
      XMLReader xmlReader = saxParser.getXMLReader();
      xmlReader.setEntityResolver(new IgnoreDTDEntityResolver());
      return xmlReader;
    } catch (ParserConfigurationException e) {
      throw new XmlException("SAX Parser configuration error.", e);
    } catch (SAXException e) {
      throw new XmlException("Error creating XMLReader.", e);
    }
  }
View Full Code Here


      SchemaFactory schemaFactory = SchemaFactory
          .newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
      Schema schema = schemaFactory.newSchema(sourceArray);
      return schema;
    } catch (SAXException e) {
      throw new XmlException("Error creating XML Schema.", e);
    }
  }
View Full Code Here

  public static JAXBContext getContext(String context) {
    try {
      JAXBContext jaxbContext = JAXBContext.newInstance(context);
      return jaxbContext;
    } catch (JAXBException e) {
      throw new XmlException("Error creating JAXB context", e);
    }
  }
View Full Code Here

      ClassLoader classLoader) {
    try {
      JAXBContext jaxbContext = JAXBContext.newInstance(context, classLoader);
      return jaxbContext;
    } catch (JAXBException e) {
      throw new XmlException("Error creating JAXB context", e);
    }
  }
View Full Code Here

  public static JAXBContext getContext(Class<?>... classesToBeBound) {
    try {
      JAXBContext jaxbContext = JAXBContext.newInstance(classesToBeBound);
      return jaxbContext;
    } catch (JAXBException e) {
      throw new XmlException("Error creating JAXB context", e);
    }
  }
View Full Code Here

      Source source = new StreamSource(reader);
      Templates templates;
      templates = factory.newTemplates(source);
      return templates;
    } catch (TransformerConfigurationException e) {
      throw new XmlException("Error creating XSLT templates.", e);
    }
  }
View Full Code Here

      for (Map.Entry<String, Object> entry : parameterMap.entrySet()) {
        transformer.setParameter(entry.getKey(), entry.getValue());
      }
      transformer.transform(source, result);
    } catch (TransformerConfigurationException e) {
      throw new XmlException("Error creating XSLT transformer.", e);
    } catch (TransformerException e) {
      throw new XmlException("XSLT transformer error.", e);
    }
  }
View Full Code Here

    try {
      Source source = new StreamSource(reader);
      Validator validator = schema.newValidator();
      validator.validate(source);
    } catch (SAXException e) {
      throw new XmlException("Validation error.", e);
    } catch (IOException e) {
      throw new IORuntimeException(e);
    }
  }
View Full Code Here

      unmarshaller.setSchema(schema);
      marshaller = context.createMarshaller();
      marshaller.setSchema(schema);
      marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
    } catch (JAXBException e) {
      throw new XmlException("JAXB error", e);
    }
  }
View Full Code Here

  public void marshal(Writer writer, Object object) {
    try {
      marshaller.marshal(object, writer);
    } catch (JAXBException e) {
      throw new XmlException("JAXB marshalling error", e);
    }
  }
View Full Code Here

TOP

Related Classes of net.rootnode.loomchild.util.exceptions.XmlException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.