package org.jdom.input; import org.jdom.*; import java.util.Map; /** An interface defining a JDOM object factory Shoud support all public constructors of the jdom classes */ public interface JDOMFactory { // **** constructing Attributes **** /** *
* This will create a new Attribute with the
* specified (local) name and value, and in the provided
* {@link Namespace}.
*
String name of Attribute.
* @param value String value for new attribute.
*/
public Attribute attribute(String name, String value, Namespace namespace);
/**
*
* This will create a new Attribute with the
* specified (local) name and value, and place it in
* the specified namespace (with prefix).
*
String name of Attribute.
* @param prefix String prefix for Attribute.
* @param uri String URI for namespace this
* Attribute is in.
* @param value String value for new attribute.
*/
public Attribute attribute(String name, String prefix, String uri, String value);
/**
*
* This will create a new Attribute with the
* specified (local) name and value, and does not place
* the attribute in a {@link Namespace}.
*
* Note: This actually explicitly puts the
* Attribute in the "empty" Namespace
* ({@link Namespace#NO_NAMESPACE}).
*
String name of Attribute.
* @param value String value for new attribute.
*/
public Attribute attribute(String name, String value);
// **** constructing CDATA ****
/**
* * This creates the CDATA with the supplied * text. *
* * @param textString content of CDATA.
*/
public CDATA cdata(String text) ;
// **** constructing Comment ****
/**
* * This creates the comment with the supplied * text. *
* * @param textString content of comment.
*/
public Comment comment(String text);
// **** constructing DocType
/**
*
* This will create the DocType with
* the specified element name and a reference to an
* external DTD.
*
String name of
* element being constrained.
* @param publicID String public ID of
* referenced DTD
* @param systemID String system ID of
* referenced DTD
*/
public DocType docType(String elementName, String publicID, String systemID);
/**
*
* This will create the DocType with
* the specified element name and reference to an
* external DTD.
*
String name of
* element being constrained.
* @param systemID String system ID of
* referenced DTD
*/
public DocType docType(String elementName, String systemID);
/**
*
* This will create the DocType with
* the specified element name
*
String name of
* element being constrained.
*/
public DocType docType(String elementName);
// **** constructing Document
/**
*
* This will create a new Document,
* with the supplied {@link Element}
* as the root element and the supplied
* {@link DocType} declaration.
*
Element for document root.
* @param docType DocType declaration.
*/
public Document document(Element rootElement, DocType docType);
/**
*
* This will create a new Document,
* with the supplied {@link Element}
* as the root element, and no {@link DocType}
* declaration.
*
Element for document root
*/
public Document document(Element rootElement);
// **** constructing Entity
/**
*
* This will create a new Entity
* with the supplied name.
*
String name of element.
*/
public Entity entity(String name);
// **** constructing Elements ****
/**
*
* This will create a new Element
* with the supplied (local) name, and define
* the {@link Namespace} to be used.
*
String name of element.
* @namespace Namespace to put element in.
*/
public Element element(String name, Namespace namespace);
/**
*
* This will create an Element in no
* {@link Namespace}.
*
String name of element.
*/
public Element element(String name);
/**
*
* This will create a new Element with
* the supplied (local) name, and specifies the URI
* of the {@link Namespace} the Element
* should be in, resulting it being unprefixed (in the default
* namespace).
*
String name of element.
* @param uri String URI for Namespace element
* should be in.
*/
public Element element(String name, String uri);
/**
*
* This will create a new Element with
* the supplied (local) name, and specifies the prefix and URI
* of the {@link Namespace} the Element
* should be in.
*
String name of element.
* @param uri String URI for Namespace element
* should be in.
*/
public Element element(String name, String prefix, String uri);
// **** constructing ProProcessingInstruction ****
/**
*
* This will create a new ProcessingInstruction
* with the specified target and data.
*
String target of PI.
* @param data Map data for PI, in
* name/value pairs
*/
public ProcessingInstruction processingInstruction(String target, Map data);
/**
*
* This will create a new ProcessingInstruction
* with the specified target and data.
*
String target of PI.
* @param rawData String data for PI.
*/
public ProcessingInstruction processingInstruction(String target, String data);
}