Package no.sws.client

Examples of no.sws.client.SwsMissingRequiredElementInResponseException


    if(element != null && element.getTextTrim().length() > 0) {
      return element.getTextTrim();
    }
    else if(required) {
      throw new SwsMissingRequiredElementInResponseException(elementName, XmlUtils.xmlElement2String(parent, Format.getPrettyFormat()));
    }
    else {
      return null;
    }
  }
View Full Code Here


      // get the lines element
      final Element linesElement = invoiceElement.getChild("lines");

      if(linesElement == null) {
        throw new SwsMissingRequiredElementInResponseException("lines", XmlUtils.xmlElement2String(invoiceElement, Format.getPrettyFormat()));
      }

      // get the line elements
      final List<Element> lineElements = linesElement.getChildren("line");

      if(lineElements == null || lineElements.size() == 0) {
        throw new SwsMissingRequiredElementInResponseException("line", XmlUtils.xmlElement2String(invoiceElement, Format.getPrettyFormat()));
      }

      final List<InvoiceLine> invoiceLines = new LinkedList<InvoiceLine>();

      for(final Element currentLineElement : lineElements) {
View Full Code Here

      // get the optional element
      final Element optionalElement = invoiceElement.getChild("optional");

      if(optionalElement == null) {
        throw new SwsMissingRequiredElementInResponseException("optional", XmlUtils.xmlElement2String(invoiceElement, Format
            .getPrettyFormat()));
      }

      invoice.setInvoiceType(InvoiceType.valueOf(getElementValue(optionalElement, "invoiceType", true)));
View Full Code Here

    Element child = element.getChild(name);
 
    if(child == null) {
     
      if(required) {
        throw new SwsMissingRequiredElementInResponseException("name", "recipient");
      }
      else {
        return null;
      }
    }
View Full Code Here

TOP

Related Classes of no.sws.client.SwsMissingRequiredElementInResponseException

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.