Class XMLUtil

java.lang.Object
org.brerp.sped.nfe.util.XMLUtil

public class XMLUtil extends Object
XML Util
Version:
$Id: XMLUtil.java, v1.0 2012/05/20 5:10:45 PM, ralexsander Exp $
Author:
Ricardo Santana (Kenos, www.kenos.com.br)
  • Constructor Details

    • XMLUtil

      public XMLUtil()
  • Method Details

    • getElementAsInt

      public static int getElementAsInt(Document document, String value)
      Get the int value of XML node
      Parameters:
      doc -
      Returns:
      0 or int value
    • getElementAsInt

      public static int getElementAsInt(Document document, int index, String value)
      Get the int value of XML node
      Parameters:
      doc -
      Returns:
      0 or int value
    • getElementAsBool

      public static boolean getElementAsBool(Document document, String value)
      Get the result of XML node
      Parameters:
      doc -
      value -
      Returns:
      "" or result
    • getElementAsBool

      public static boolean getElementAsBool(Document document, String value, boolean defValue)
      Get the result of XML node
      Parameters:
      doc -
      value -
      Returns:
      "" or result
    • getElementAsBool

      public static boolean getElementAsBool(Document document, String value, int index, boolean defValue)
      Get the result of XML node
      Parameters:
      doc -
      value -
      Returns:
      "" or result
    • getElementAsBD

      public static BigDecimal getElementAsBD(Document document, String value)
      Get the result of XML node
      Parameters:
      doc -
      value -
      Returns:
      "" or result
    • getElementAsBD

      public static BigDecimal getElementAsBD(Document document, int index, String value)
      Get the result of XML node
      Parameters:
      doc -
      value -
      Returns:
      "" or result
    • getElement

      public static String getElement(Document document, String value)
      Get the result of XML node
      Parameters:
      doc -
      index -
      value -
      Returns:
      "" or result
    • getElement

      public static String getElement(Document document, int index, String value)
      Get the result of XML node
      Parameters:
      doc -
      index -
      value -
      Returns:
      "" or result
    • getElementAsInt

      public static int getElementAsInt(NodeList nl, String value)
      Get the int value of XML node
      Parameters:
      doc -
      Returns:
      0 or int value
    • getElementAsInt

      public static int getElementAsInt(NodeList nl, int index, String value)
      Get the int value of XML node
      Parameters:
      doc -
      Returns:
      0 or int value
    • getElementAsBD

      public static BigDecimal getElementAsBD(NodeList nl, String value)
      Get the result of XML node
      Parameters:
      doc -
      value -
      Returns:
      "" or result
    • getElementAsBD

      public static BigDecimal getElementAsBD(NodeList nl, int index, String value)
      Get the result of XML node
      Parameters:
      doc -
      value -
      Returns:
      "" or result
    • getElement

      public static String getElement(NodeList nl, String value)
      Get the result of XML node
      Parameters:
      doc -
      index -
      value -
      Returns:
      "" or result
    • getElement

      public static String getElement(NodeList nl, int index, String value)
      Get the result of XML node
      Parameters:
      doc -
      index -
      value -
      Returns:
      "" or result
    • printDANFe

      public static String printDANFe(net.sf.jasperreports.engine.JasperPrint jasperPrint, PrintInfo printInfo) throws IOException, net.sf.jasperreports.engine.JRException
      Imprime a DANFe a partir de um JasperPrint
      Parameters:
      jasperPrint -
      Returns:
      Throws:
      IOException
      net.sf.jasperreports.engine.JRException
    • printDANFe

      public static String printDANFe(List<net.sf.jasperreports.engine.JasperPrint> jasperPrintList, PrintInfo printInfo) throws IOException, net.sf.jasperreports.engine.JRException
      Imprime a DANFe a partir de um JasperPrint
      Parameters:
      jasperPrint -
      Returns:
      Throws:
      IOException
      net.sf.jasperreports.engine.JRException
    • getJasperPrint

      public static net.sf.jasperreports.engine.JasperPrint getJasperPrint(Map<String,Object> parameters, File xmlNF, File jasperFile) throws net.sf.jasperreports.engine.JRException, AdempiereException, IOException
      Cria o JasperPrint a Partir de um XML.
      Parameters:
      parameters -
      xmlNF -
      jasperFile -
      Returns:
      Throws:
      net.sf.jasperreports.engine.JRException
      AdempiereException
      IOException
    • getParametersDanfe

      public static Map<String,Object> getParametersDanfe(MLBRDocFiscal df, File jasper)
      Preenche os ParĂ¢metros da DANFe Frente msgVersaoTeste PreImpresso msgPrevisualizacao
      Returns:
    • getPDF

      public static File getPDF(net.sf.jasperreports.engine.JasperPrint jasperPrint, String fileName) throws IOException, net.sf.jasperreports.engine.JRException
      Throws:
      IOException
      net.sf.jasperreports.engine.JRException
    • getLotPDF

      public static File getLotPDF(List<net.sf.jasperreports.engine.JasperPrint> jasperPrintList, String fileName) throws IOException, net.sf.jasperreports.engine.JRException
      Throws:
      IOException
      net.sf.jasperreports.engine.JRException