Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. /**
  2. *
  3. */
  4. package com.bmchild.service.xml;
  5.  
  6. import java.io.IOException;
  7. import java.io.InputStream;
  8.  
  9. import org.dom4j.Document;
  10. import org.dom4j.Node;
  11.  
  12.  
  13. /**
  14. * @author bchild
  15. *
  16. */
  17. public interface XMLService {
  18.  
  19. String ENCODING = "ISO-8859-1";
  20.  
  21. /**
  22. * Creates an XML document with the root
  23. *
  24. * @param root
  25. * @param xmlMap
  26. * @return
  27. */
  28. Document createDocument(String root);
  29.  
  30. /**
  31. * Recursive method to create an element and, if necessary, its parents and siblings
  32. * @param document
  33. * @param xpath to single element
  34. * @param value if null an empty element will be created
  35. * @return the created Node
  36. */
  37. Node addElementToDocument(Document document, String xpath, String value);
  38.  
  39. /**
  40. * Transforms one xml document to another
  41. * @param document to transform
  42. * @param xlsResourceName name of the transformation file
  43. * @return transformed Document
  44. */
  45. Document transformDocument(Document document, String xlsResourceName);
  46.  
  47. /**
  48. * Gets the xml as a string
  49. * @param document
  50. */
  51. String documentToString(Document document);
  52.  
  53. /**
  54. * Gets the input stream for the document based on default settings
  55. * @param document
  56. * @return
  57. * @throws IOException
  58. */
  59. InputStream getInputStream(Document document) throws IOException;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement