Desktop tool for browsing account info from EVE-Online
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

JDOMFactory.java 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. /*--
  2. $Id: JDOMFactory.java,v 1.9 2007/11/10 05:28:59 jhunter Exp $
  3. Copyright (C) 2000-2007 Jason Hunter & Brett McLaughlin.
  4. All rights reserved.
  5. Redistribution and use in source and binary forms, with or without
  6. modification, are permitted provided that the following conditions
  7. are met:
  8. 1. Redistributions of source code must retain the above copyright
  9. notice, this list of conditions, and the following disclaimer.
  10. 2. Redistributions in binary form must reproduce the above copyright
  11. notice, this list of conditions, and the disclaimer that follows
  12. these conditions in the documentation and/or other materials
  13. provided with the distribution.
  14. 3. The name "JDOM" must not be used to endorse or promote products
  15. derived from this software without prior written permission. For
  16. written permission, please contact <request_AT_jdom_DOT_org>.
  17. 4. Products derived from this software may not be called "JDOM", nor
  18. may "JDOM" appear in their name, without prior written permission
  19. from the JDOM Project Management <request_AT_jdom_DOT_org>.
  20. In addition, we request (but do not require) that you include in the
  21. end-user documentation provided with the redistribution and/or in the
  22. software itself an acknowledgement equivalent to the following:
  23. "This product includes software developed by the
  24. JDOM Project (http://www.jdom.org/)."
  25. Alternatively, the acknowledgment may be graphical using the logos
  26. available at http://www.jdom.org/images/logos.
  27. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  28. WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  29. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  30. DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT
  31. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  32. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  33. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  34. USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  35. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  36. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  37. OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  38. SUCH DAMAGE.
  39. This software consists of voluntary contributions made by many
  40. individuals on behalf of the JDOM Project and was originally
  41. created by Jason Hunter <jhunter_AT_jdom_DOT_org> and
  42. Brett McLaughlin <brett_AT_jdom_DOT_org>. For more information
  43. on the JDOM Project, please see <http://www.jdom.org/>.
  44. */
  45. package org.jdom;
  46. import java.util.*;
  47. /**
  48. * An interface to be used by builders when constructing JDOM objects. The
  49. * <code>DefaultJDOMFactory</code> creates the standard top-level JDOM classes
  50. * (Element, Document, Comment, etc). Another implementation of this factory
  51. * could be used to create custom classes.
  52. *
  53. * @version $Revision: 1.9 $, $Date: 2007/11/10 05:28:59 $
  54. * @author Ken Rune Holland
  55. * @author Phil Nelson
  56. * @author Bradley S. Huffman
  57. */
  58. public interface JDOMFactory {
  59. // **** constructing Attributes ****
  60. /**
  61. * <p>
  62. * This will create a new <code>Attribute</code> with the
  63. * specified (local) name and value, and in the provided
  64. * <code>{@link org.jdom.Namespace}</code>.
  65. * </p>
  66. *
  67. * @param name <code>String</code> name of <code>Attribute</code>.
  68. * @param value <code>String</code> value for new attribute.
  69. */
  70. public Attribute attribute(String name, String value, Namespace namespace);
  71. /**
  72. * This will create a new <code>Attribute</code> with the
  73. * specified (local) name, value, and type, and in the provided
  74. * <code>{@link org.jdom.Namespace}</code>.
  75. *
  76. * @param name <code>String</code> name of <code>Attribute</code>.
  77. * @param value <code>String</code> value for new attribute.
  78. * @param type <code>int</code> type for new attribute.
  79. * @param namespace <code>Namespace</code> namespace for new attribute.
  80. */
  81. public Attribute attribute(String name, String value,
  82. int type, Namespace namespace);
  83. /**
  84. * This will create a new <code>Attribute</code> with the
  85. * specified (local) name and value, and does not place
  86. * the attribute in a <code>{@link org.jdom.Namespace}</code>.
  87. * <p>
  88. * <b>Note</b>: This actually explicitly puts the
  89. * <code>Attribute</code> in the "empty" <code>Namespace</code>
  90. * (<code>{@link org.jdom.Namespace#NO_NAMESPACE}</code>).
  91. * </p>
  92. *
  93. * @param name <code>String</code> name of <code>Attribute</code>.
  94. * @param value <code>String</code> value for new attribute.
  95. */
  96. public Attribute attribute(String name, String value);
  97. /**
  98. * This will create a new <code>Attribute</code> with the
  99. * specified (local) name, value and type, and does not place
  100. * the attribute in a <code>{@link org.jdom.Namespace}</code>.
  101. * <p>
  102. * <b>Note</b>: This actually explicitly puts the
  103. * <code>Attribute</code> in the "empty" <code>Namespace</code>
  104. * (<code>{@link org.jdom.Namespace#NO_NAMESPACE}</code>).
  105. * </p>
  106. *
  107. * @param name <code>String</code> name of <code>Attribute</code>.
  108. * @param value <code>String</code> value for new attribute.
  109. * @param type <code>int</code> type for new attribute.
  110. */
  111. public Attribute attribute(String name, String value, int type);
  112. // **** constructing CDATA ****
  113. /**
  114. * This creates the CDATA with the supplied text.
  115. *
  116. * @param str <code>String</code> content of CDATA.
  117. */
  118. public CDATA cdata(String str);
  119. // **** constructing Text ****
  120. /**
  121. * This creates the Text with the supplied text.
  122. *
  123. * @param str <code>String</code> content of Text.
  124. */
  125. public Text text(String str);
  126. // **** constructing Comment ****
  127. /**
  128. * This creates the comment with the supplied text.
  129. *
  130. * @param text <code>String</code> content of comment.
  131. */
  132. public Comment comment(String text);
  133. // **** constructing DocType
  134. /**
  135. * This will create the <code>DocType</code> with
  136. * the specified element name and a reference to an
  137. * external DTD.
  138. *
  139. * @param elementName <code>String</code> name of
  140. * element being constrained.
  141. * @param publicID <code>String</code> public ID of
  142. * referenced DTD
  143. * @param systemID <code>String</code> system ID of
  144. * referenced DTD
  145. */
  146. public DocType docType(String elementName,
  147. String publicID, String systemID);
  148. /**
  149. * This will create the <code>DocType</code> with
  150. * the specified element name and reference to an
  151. * external DTD.
  152. *
  153. * @param elementName <code>String</code> name of
  154. * element being constrained.
  155. * @param systemID <code>String</code> system ID of
  156. * referenced DTD
  157. */
  158. public DocType docType(String elementName, String systemID);
  159. /**
  160. * This will create the <code>DocType</code> with
  161. * the specified element name
  162. *
  163. * @param elementName <code>String</code> name of
  164. * element being constrained.
  165. */
  166. public DocType docType(String elementName);
  167. // **** constructing Document
  168. /**
  169. * This will create a new <code>Document</code>,
  170. * with the supplied <code>{@link org.jdom.Element}</code>
  171. * as the root element and the supplied
  172. * <code>{@link org.jdom.DocType}</code> declaration.
  173. *
  174. * @param rootElement <code>Element</code> for document root.
  175. * @param docType <code>DocType</code> declaration.
  176. */
  177. public Document document(Element rootElement, DocType docType);
  178. /**
  179. * This will create a new <code>Document</code>,
  180. * with the supplied <code>{@link org.jdom.Element}</code>
  181. * as the root element and the supplied
  182. * <code>{@link org.jdom.DocType}</code> declaration.
  183. *
  184. * @param rootElement <code>Element</code> for document root.
  185. * @param docType <code>DocType</code> declaration.
  186. * @param baseURI the URI from which this doucment was loaded.
  187. */
  188. public Document document(Element rootElement, DocType docType, String baseURI);
  189. /**
  190. * This will create a new <code>Document</code>,
  191. * with the supplied <code>{@link org.jdom.Element}</code>
  192. * as the root element, and no <code>{@link org.jdom.DocType}</code>
  193. * declaration.
  194. *
  195. * @param rootElement <code>Element</code> for document root
  196. */
  197. public Document document(Element rootElement);
  198. // **** constructing Elements ****
  199. /**
  200. * This will create a new <code>Element</code>
  201. * with the supplied (local) name, and define
  202. * the <code>{@link org.jdom.Namespace}</code> to be used.
  203. *
  204. * @param name <code>String</code> name of element.
  205. * @param namespace <code>Namespace</code> to put element in.
  206. */
  207. public Element element(String name, Namespace namespace);
  208. /**
  209. * This will create an <code>Element</code> in no
  210. * <code>{@link org.jdom.Namespace}</code>.
  211. *
  212. * @param name <code>String</code> name of element.
  213. */
  214. public Element element(String name);
  215. /**
  216. * This will create a new <code>Element</code> with
  217. * the supplied (local) name, and specifies the URI
  218. * of the <code>{@link org.jdom.Namespace}</code> the <code>Element</code>
  219. * should be in, resulting it being unprefixed (in the default
  220. * namespace).
  221. *
  222. * @param name <code>String</code> name of element.
  223. * @param uri <code>String</code> URI for <code>Namespace</code> element
  224. * should be in.
  225. */
  226. public Element element(String name, String uri);
  227. /**
  228. * This will create a new <code>Element</code> with
  229. * the supplied (local) name, and specifies the prefix and URI
  230. * of the <code>{@link org.jdom.Namespace}</code> the <code>Element</code>
  231. * should be in.
  232. *
  233. * @param name <code>String</code> name of element.
  234. * @param uri <code>String</code> URI for <code>Namespace</code> element
  235. * should be in.
  236. */
  237. public Element element(String name, String prefix, String uri);
  238. // **** constructing ProcessingInstruction ****
  239. /**
  240. * This will create a new <code>ProcessingInstruction</code>
  241. * with the specified target and data.
  242. *
  243. * @param target <code>String</code> target of PI.
  244. * @param data <code>Map</code> data for PI, in
  245. * name/value pairs
  246. */
  247. public ProcessingInstruction processingInstruction(String target,
  248. Map data);
  249. /**
  250. * This will create a new <code>ProcessingInstruction</code>
  251. * with the specified target and data.
  252. *
  253. * @param target <code>String</code> target of PI.
  254. * @param data <code>String</code> data for PI.
  255. */
  256. public ProcessingInstruction processingInstruction(String target,
  257. String data);
  258. // **** constructing EntityRef ****
  259. /**
  260. * This will create a new <code>EntityRef</code>
  261. * with the supplied name.
  262. *
  263. * @param name <code>String</code> name of element.
  264. */
  265. public EntityRef entityRef(String name);
  266. /**
  267. * This will create a new <code>EntityRef</code>
  268. * with the supplied name, public ID, and system ID.
  269. *
  270. * @param name <code>String</code> name of element.
  271. * @param publicID <code>String</code> public ID of element.
  272. * @param systemID <code>String</code> system ID of element.
  273. */
  274. public EntityRef entityRef(String name, String publicID, String systemID);
  275. /**
  276. * This will create a new <code>EntityRef</code>
  277. * with the supplied name and system ID.
  278. *
  279. * @param name <code>String</code> name of element.
  280. * @param systemID <code>String</code> system ID of element.
  281. */
  282. public EntityRef entityRef(String name, String systemID);
  283. // =====================================================================
  284. // List manipulation
  285. // =====================================================================
  286. public void addContent(Parent parent, Content content);
  287. public void setAttribute(Element element, Attribute a);
  288. public void addNamespaceDeclaration(Element element, Namespace additional);
  289. }